Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 17:08:47 +0000



Post From: Order events?

[2024-05-27 04:20:00]
User504477 - Posts: 26
I implemented this logic to capture the just placed order from the chart.

---
s_SCTradeOrder orderInfo;
SCString text;

int& index = sc.GetPersistentInt(1);

while (sc.GetOrderByIndex(index, orderInfo) != SCTRADING_ORDER_ERROR)
{
  ++index;

  orders[orderInfo.InternalOrderID][orderInfo.OrderStatusCode] = orderInfo;

  text.Format("%d, %d, %s, %f, %f, %s, %s, %d", orderInfo.InternalOrderID,
    orderInfo.ParentInternalOrderID,
    orderInfo.OrderType.GetChars(),
    orderInfo.OrderQuantity,
    orderInfo.FilledQuantity,
    orderTypes[orderInfo.BuySell].GetChars(),
    orderStatusMap[orderInfo.OrderStatusCode].GetChars(),
    orderInfo.IsSimulated);

  log2(sc, text);
}

I'm facing couple of issues.

1. In sim mode, it logs the following when I place a BUY LIMIT order.

1159, 0, Limit, 1.000000, 0.000000, SCT_ORDERTYPE_LIMIT, Open, 1

but in non-sim mode (realtime), logs nothing.

2. When I close(Cancel) the BUY LIMIT order, I get nothing in both modes.

What am I missing?
Date Time Of Last Edit: 2024-05-27 18:02:06