Support Board
Date/Time: Tue, 22 Apr 2025 00:12:27 +0000
Post From: SOLVED Issues trying to to read all orders on each study interval.
[2025-02-19 18:23:38] |
cmet - Posts: 690 |
Try adding sc.UpdateAlways = 1; and using sc.GetOrderByIndex() instead. Something like this: SCSFExport scsf_TradeCopierFunction(SCStudyInterfaceRef sc)
{ sc.AutoLoop = 0; sc.UpdateAlways = 1; int orderIndex = 0; while (true) { s_SCTradeOrder order; //next order if (sc.GetOrderByIndex(orderIndex, order) == 0) { break; } //order info SCString msg; msg.Format("Order #%d | Account: %s | Symbol: %s | Qty: %d | Type: %d | Status: %d | Price: %.2f", orderIndex, order.TradeAccount.GetChars(), order.Symbol.GetChars(), order.Quantity, order.OrderType, order.OrderStatusCode, order.Price1); sc.AddMessageToLog(msg, 1); orderIndex++; } } Date Time Of Last Edit: 2025-02-19 19:17:28
|