StrategyEngine

StockSharp.Algo.Strategies.Decomposed

Máquina estatal + procesamiento de mensajes. Maneja transiciones ProcessState y datos de mercado enrutándose a PnLManager.

Constructores

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

Máquina estatal + procesamiento de mensajes. Maneja transiciones ProcessState y datos de mercado enrutándose a PnLManager.

host
Es el anfitrión de la estrategia.
pnlManager
PnLmanager.

Propiedades

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

Estado actual del proceso.

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

Intervalo para el no realizado PnLrefrescante.

Métodos

ForceStop
public void ForceStop()
strategyEngine.ForceStop()

Estado de fuerza para detener (para reiniciar).

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

Mensaje entrante del proceso: transiciones estatales + enrutamiento de datos del mercado.

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

Solicitar estrategia de inicio. Envía mensaje de cambio de estado a través de host.

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

Solicita la parada de estrategia. Envía el mensaje de cambio de estado a través de host.

Eventos

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

Fuegos cuando actualizaciones de precios actuales de los datos del mercado.

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

Fuegos cuando PnL debe ser recalculado.

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

Fuegos cuando ProcessStatecambia.