SecurityEmulator

StockSharp.Algo.Testing.Emulation

Emulador financeiro-estado específico do instrumento. Lida com lógica específica da emulação: carck→orderbook, L1→orderbook, armazenamento de velas, limites de preço.

Construtores

SecurityEmulator
public SecurityEmulator(MarketEmulator parent, MatchingEngineAdapter engine, SecurityId securityId)
securityEmulator = SecurityEmulator(parent, engine, securityId)

Emulador financeiro-estado específico do instrumento. Lida com lógica específica da emulação: carck→orderbook, L1→orderbook, armazenamento de velas, limites de preço.

Propriedades

IsCandleMatchingMode
public bool IsCandleMatchingMode { get; private set; }
value = securityEmulator.IsCandleMatchingMode
securityEmulator.IsCandleMatchingMode = value

É verdade quando o livro de pedidos foi preenchido a partir de dados de velas.

NextStoredCandleReleaseTime
public DateTime? NextStoredCandleReleaseTime { get; }
value = securityEmulator.NextStoredCandleReleaseTime

The earliest moment at which a candle still held here becomes known, or when none is held.

Métodos

EndHistory
public void EndHistory(DateTime time)
securityEmulator.EndHistory(time)

The replay holds no more history of this security.

time
The moment of the replay at which it ran out.
GetReleaseTime
private static DateTime GetReleaseTime(CandleMessage candle)
result = SecurityEmulator.GetReleaseTime(candle)

The moment a bar becomes known, which is its close. A bar that states no meaningful close - a non-time one supplied from outside, say - becomes known at the first instant after its open, which is the earliest moment anything can be said about it.

OnQuoteChange
public void OnQuoteChange()
securityEmulator.OnQuoteChange()

Chamado quando QuoteChange é recebido - modo de saída de velas correspondente.

ProcessStoredCandles
public List<CandleMessage> ProcessStoredCandles(DateTime currentTime, List<Message> results)
result = securityEmulator.ProcessStoredCandles(currentTime, results)

Release the candles that have closed by , stamped with the moment they became known, and hand them back so the caller can put the prices each one recorded into the book before publishing it.

ProcessTick
public void ProcessTick(ExecutionMessage tick, decimal levelVolume, List<Message> results)
securityEmulator.ProcessTick(tick, levelVolume, results)

Move synthesized liquidity to a print when no depth data has been received.

tick
The print.
levelVolume
How much the synthesized levels hold.
results
Where the messages go.
TryCloseMarket
public bool TryCloseMarket(DateTime time)
result = securityEmulator.TryCloseMarket(time)

Close the market once the history is over: past the moment it ran out and past the release of the last bar it recorded, so an order sent on that bar still meets the prices the bar recorded.

time
The current time.

Retorna: when the market closed now.