Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 17:20:52 +0000



Post From: ACSIL order entry using wrong prices in Bar based back test.

[2023-11-02 02:51:56]
quriousqitty - Posts: 13
I am trying to make an order while doing bar based backtesting with ACSIL.

Here's the code:

    s_SCNewOrder order;

    order.OrderQuantity = 1;
    order.OrderType = SCT_ORDERTYPE_LIMIT;
    order.TimeInForce = SCT_TIF_GTC;
    order.Price1 = sc.Close[sc.Index];

    int orderResult = sc.BuyEntry(order);

I don't know why but, the price in the trades log for bar based backtest is always either low of bar of high of bar and never the close which is what I've set. Is this a bug or is there something I'm doing wrong.