StrategyEngine
StockSharp.Algo.Strategies.Decomposed
ステートマシン+メッセージ処理。ProcessStatetransitions and market dataルーティングをPnLManagerに処理します。
コンストラクター
StrategyEngine
public StrategyEngine(IStrategyHost host, IPnLManager pnlManager)
strategyEngine = StrategyEngine(host, pnlManager)
ステートマシン+メッセージ処理。ProcessStatetransitions and market dataルーティングをPnLManagerに処理します。
- host
- 戦略ホスト。
- pnlManager
- 担当: 代表取締役社長 兼 務 俊一
プロパティ
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.
メソッド
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.