StrategyEngine

StockSharp.Algo.Strategies.Decomposed

国产机+信息处理. 处理ProcessState的过渡和市场数据路由到PnLManager.

构造函数

StrategyEngine
public StrategyEngine(IStrategyHost host, IPnLManager pnlManager)
strategyEngine = StrategyEngine(host, pnlManager)

国产机+信息处理. 处理ProcessState的过渡和市场数据路由到PnLManager.

host
战略东道主。
pnlManager
PnL manager.

属性

ProcessState
public ProcessStates ProcessState { get; private set; }
value = strategyEngine.ProcessState
strategyEngine.ProcessState = value

当前的进程状态 。

UnrealizedPnLInterval
public TimeSpan UnrealizedPnLInterval { get; set; }
value = strategyEngine.UnrealizedPnLInterval
strategyEngine.UnrealizedPnLInterval = value

Interval for unrealized PnL refresh.

方法

ForceStop
public void ForceStop()
strategyEngine.ForceStop()

要停止的强制状态( 用于重置) 。

OnMessage
public void OnMessage(Message message)
strategyEngine.OnMessage(message)

处理接发的信息——状态过渡+市场数据路由.

RequestStartAsync
public ValueTask RequestStartAsync(CancellationToken cancellationToken)
result = strategyEngine.RequestStartAsync(cancellationToken)

请求策略启动。 通过主机发送状态更改消息 。

RequestStopAsync
public ValueTask RequestStopAsync(CancellationToken cancellationToken)
result = strategyEngine.RequestStopAsync(cancellationToken)

请求策略停止。 通过主机发送状态更改消息 。

事件

CurrentPriceUpdated
public event Action<SecurityId, decimal, DateTime, DateTime> CurrentPriceUpdated
strategyEngine.CurrentPriceUpdated += handler

当当前价格从市场数据更新时起火.

PnLRefreshRequired
public event Action<DateTime> PnLRefreshRequired
strategyEngine.PnLRefreshRequired += handler

Fires when PnL should be recalculated.

StateChanged
public event Action<ProcessStates> StateChanged
strategyEngine.StateChanged += handler

Fires when ProcessState changes.