Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 18:02:06 +0000



Post From: sc.GetOrderByIndex does not return any orders when trading live to Interactive Brokers

[2017-08-23 04:10:16]
jseppa - Posts: 18
Hi,

I'm not able to see any orders when I connect my study to live trading feed, however it works fine with simulated trading.

The following code returns nothing when I create a real order directly on the chart (using trading chart dom):
while (true)
  {
    s_SCTradeOrder OrderDetails;
    if (sc.GetOrderByIndex(Index, OrderDetails) == SCTRADING_ORDER_ERROR)
      break;

    Index++; // Increment the index for the next call to sc.GetOrderByIndex

    // Log the order
    logOrderDetails(sc, OrderDetails);
}

however when I enable "Trade Simulated Mode on" and create an order in the same way, it works fine:


Chart: JD [M] 5 Min #1 | Study: Test Function | id=[751938] pid=[751937] [Sell] [Stop(2)] [Pending Child-Client(3)] qty=[0] [JD] price=[41.31] | 2017-08-23 00:06:32 *
Chart: JD [M] 5 Min #1 | Study: Test Function | id=[751937] pid=[0] [Buy] [Limit(1)] [Open(5)] qty=[1000] [JD] price=[41.81] | 2017-08-23 00:06:32 *

Am I missing a setting somewhere? I've set the following:
sc.SendOrdersToTradeService = true;

Cheers,

Jason