Support Board
Date/Time: Mon, 21 Apr 2025 16:48:53 +0000
Post From: SOLVED Issue with function sc.GetOrderForSymbolAndAccountByIndex(...)
[2025-02-24 22:56:55] |
cmet - Posts: 690 |
Can see if this keeps the loop from exiting. Other than that, I'm outta ideas. Maybe someone else will jump in. SCSFExport scsf_PersistentOrderScan(SCStudyInterfaceRef& sc) {
if (sc.SetDefaults) { sc.AutoLoop = 0; sc.UpdateAlways = 1; return; } sc.RefreshTradeData(); int orderIndex = 0; s_SCTradeOrder order; SCString emptyString; bool ordersFound = false; while (true) { if (sc.GetOrderForSymbolAndAccountByIndex(emptyString, emptyString, orderIndex, order) == SCTRADING_ORDER_ERROR) { if (!ordersFound) { sc.FlagFullRecalculate = 1; } orderIndex = 0; continue; } ordersFound = true; orderIndex++; } } |