Support Board
Date/Time: Fri, 14 Mar 2025 11:33:16 +0000
Post From: Sub-second order fills not shown when using GetOrderFillEntry
[2022-06-02 10:25:14] |
ray42 - Posts: 21 |
Hi, I'm trying to print out all the executed fills, but I'm not able to print out the orders that were executed within 1-sec. if (sc.SetDefaults){
sc.GraphName = "PrintFills"; sc.AllowMultipleEntriesInSameDirection = false; sc.SupportReversals = true; sc.AllowOppositeEntryWithOpposingPositionOrOrders = true; sc.CancelAllOrdersOnEntriesAndReversals = false; sc.AllowEntryWithWorkingOrders = false; sc.CancelAllWorkingOrdersOnExit = true; sc.AllowOnlyOneTradePerBar = false; sc.MaintainTradeStatisticsAndTradesData = true; sc.AutoLoop = true; sc.HideStudy = 1; return; } sc.SupportTradingScaleIn = 0; sc.SupportTradingScaleOut = 0; int& PriorOrderFillEntrySize = sc.GetPersistentInt(1); int CurrentOrderFillEntrySize = sc.GetOrderFillArraySize(); if (CurrentOrderFillEntrySize != PriorOrderFillEntrySize){ PriorOrderFillEntrySize = CurrentOrderFillEntrySize; if (CurrentOrderFillEntrySize > 0){ s_SCOrderFillData OrderFillData; sc.GetOrderFillEntry(CurrentOrderFillEntrySize - 1, OrderFillData); SCString OrderFillMessage; s_SCPositionData SCPositionData; int got_position = sc.GetTradePosition(SCPositionData); SCString LogMessage; LogMessage.Format("[%s] %s [x %u] @ %f [Side: %d]", sc.DateTimeToString(OrderFillData.FillDateTime, FLAG_DT_COMPLETE_DATETIME_MS).GetChars(), OrderFillData.Symbol.GetChars(), static_cast<uint32_t>(OrderFillData.Quantity), OrderFillData.FillPrice, OrderFillData.BuySell ); sc.AddMessageToLog(LogMessage, 0); } } For example, when I export the fills to .txt I see orders like this: Fills 2022-06-02 08:24:59.635377 2022-06-02 08:24:59.635250 [Sim]ESM22-CME Trade simulation fill.... Fills 2022-06-02 08:24:59.635602 2022-06-02 08:24:59.635275 [Sim]ESM22-CME Trade simulation fill.... But in the logs output, I only see the first filled order. Am I missing a setting or show can I handle these type of filled orders? Thank you! |