StrategyEngine
Máquina estatal + procesamiento de mensajes. Maneja transiciones ProcessState y datos de mercado enrutándose a PnLManager.
Constructores
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
public ProcessStates ProcessState { get; private set; }
value = strategyEngine.ProcessState
strategyEngine.ProcessState = value
Estado actual del proceso.
public TimeSpan UnrealizedPnLInterval { get; set; }
value = strategyEngine.UnrealizedPnLInterval
strategyEngine.UnrealizedPnLInterval = value
Intervalo para el no realizado PnLrefrescante.
Métodos
public void ForceStop()
strategyEngine.ForceStop()
Estado de fuerza para detener (para reiniciar).
public void OnMessage(Message message)
strategyEngine.OnMessage(message)
Mensaje entrante del proceso: transiciones estatales + enrutamiento de datos del mercado.
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.
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
public event Action<SecurityId, decimal, DateTime, DateTime> CurrentPriceUpdated
strategyEngine.CurrentPriceUpdated += handler
Fuegos cuando actualizaciones de precios actuales de los datos del mercado.
public event Action<DateTime> PnLRefreshRequired
strategyEngine.PnLRefreshRequired += handler
Fuegos cuando PnL debe ser recalculado.
public event Action<ProcessStates> StateChanged
strategyEngine.StateChanged += handler
Fuegos cuando ProcessStatecambia.