MarketEmulator

StockSharp.Algo.Testing.Emulation

モジュラーアーキテクチャーで市場エミュレータv2. ラップMatchingEngineAdapterとエミュレーション固有のロジックを追加します。 (ランダムボリューム、ティック/L1→オーダーブック変換、キャンドルマッチング、手数料、価格制限).

継承元: BaseLogReceiver

実装: IMarketEmulator, IMessageTransport, ILogSource, IDisposable

コンストラクター

MarketEmulator
public MarketEmulator(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IExchangeInfoProvider exchangeInfoProvider, IdGenerator transactionIdGenerator)
marketEmulator = MarketEmulator(securityProvider, portfolioProvider, exchangeInfoProvider, transactionIdGenerator)

新規インスタンスを初期化します。

プロパティ

CurrentTime
public override DateTime CurrentTime { get; }
value = marketEmulator.CurrentTime

現在のUTCの時間。

ExchangeInfoProvider
public IExchangeInfoProvider ExchangeInfoProvider { get; }
value = marketEmulator.ExchangeInfoProvider

取引所および取引銀行のプロバイダ。

OrderIdGenerator
public IncrementalIdGenerator OrderIdGenerator { get; set; }
value = marketEmulator.OrderIdGenerator
marketEmulator.OrderIdGenerator = value

注文IDジェネレータ。

PortfolioManager
public EmulatedPortfolioManager PortfolioManager { get; }
value = marketEmulator.PortfolioManager

ポートフォリオのステータスを処理するポートフォリオマネージャー。

PortfolioProvider
public IPortfolioProvider PortfolioProvider { get; }
value = marketEmulator.PortfolioProvider

注文を登録するために使用されるポートフォリオ。値が与えられていない場合は、デフォルト名で生成されるポートフォリオが作成されます。

PossibleSupportedMessages
public IEnumerable<MessageTypeInfo> PossibleSupportedMessages { get; }
value = marketEmulator.PossibleSupportedMessages

対応可能なメッセージタイプ。

ProcessedMessageCount
public long ProcessedMessageCount { get; private set; }
value = marketEmulator.ProcessedMessageCount
marketEmulator.ProcessedMessageCount = value

処理されたメッセージ数。

RandomProvider
public IEmulationRandomizer RandomProvider { get; set; }
value = marketEmulator.RandomProvider
marketEmulator.RandomProvider = value

Where anything in the strategy that draws at random takes its draws from.

SecurityProvider
public ISecurityProvider SecurityProvider { get; }
value = marketEmulator.SecurityProvider

機器に関する情報提供者

Settings
public MarketEmulatorSettings Settings { get; }
value = marketEmulator.Settings

エミュレータの設定.

TradeIdGenerator
public IncrementalIdGenerator TradeIdGenerator { get; set; }
value = marketEmulator.TradeIdGenerator
marketEmulator.TradeIdGenerator = value

トレードIDジェネレーター。

TransactionIdGenerator
public IdGenerator TransactionIdGenerator { get; }
value = marketEmulator.TransactionIdGenerator

トランザクションIDジェネレータ。

VerifyMode
public bool VerifyMode { get; set; }
value = marketEmulator.VerifyMode
marketEmulator.VerifyMode = value

延長検証モード。

メソッド

ApplyCommissionsAsync
private ValueTask ApplyCommissionsAsync(List<Message> messages, CancellationToken cancellationToken)
result = marketEmulator.ApplyCommissionsAsync(messages, cancellationToken)

Price every trade in this batch. Called once, where the batch leaves the emulator.

CheckLimitOrders
private void CheckLimitOrders(SecurityId securityId, decimal? tradePrice, DateTime time, List<Message> results)
marketEmulator.CheckLimitOrders(securityId, tradePrice, time, results)

Re-evaluate resting limit orders against the current order book and execute the ones the market has moved through. Unlike stop orders, limit orders are otherwise matched only at registration time, so a tick/quote trading through a resting limit would leave it sitting in the book and later fill at a price the market has left behind.

GetSecurityState
public SecurityState GetSecurityState(SecurityId securityId)
result = marketEmulator.GetSecurityState(securityId)

State the emulation keeps for one security: its book, its orders and its definition.

securityId
Security to read.

戻り値: The state.

ReleaseStoredCandles
private void ReleaseStoredCandles(DateTime time, List<Message> results)
marketEmulator.ReleaseStoredCandles(time, results)

Hand over every bar still held whose close falls no later than , each at its own close and in order.

ReplayCandle
private void ReplayCandle(SecurityId securityId, SecurityEmulator emulator, CandleMessage candle, DateTime time, List<Message> results)
marketEmulator.ReplayCandle(securityId, emulator, candle, time, results)

Replay a closed candle as the prices it recorded, in the order it recorded them.

SendOutMessageAsync
public ValueTask SendOutMessageAsync(Message message, CancellationToken cancellationToken)
result = marketEmulator.SendOutMessageAsync(message, cancellationToken)

送信する

イベント

NewOutMessageAsync
public event Func<Message, CancellationToken, ValueTask> NewOutMessageAsync
marketEmulator.NewOutMessageAsync += handler

新規メッセージイベント