Support Board
Date/Time: Tue, 26 Nov 2024 17:31:42 +0000
ACSIL order entry using wrong prices in Bar based back test.
View Count: 332
[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. |
[2023-11-02 14:16:19] |
Sierra_Chart Engineering - Posts: 17182 |
A limit order can fill at a better price. That makes sense. However, you can prevent that by setting this to No: Global Trade Settings Windows: Allow Simulated Resting Limit Order to Fill at a Better Price (Global Settings >> General Trade Settings >> General) Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-11-02 14:16:48
|
[2023-11-02 14:34:50] |
quriousqitty - Posts: 13 |
Unfortunately, the case is that I'm getting worse fills. Sometimes a whole point away. I'm not sure if bar close is consistent because after I run ACSIL with replay, sometimes the signals I get are drawn as arrows and they're wrong e.g. If I was waiting for a new bar to break previous close, it doesn't always do so. Once I use 'Reload & Recalculate', everything is drawn correctly. |
[2023-11-03 14:52:25] |
Sierra_Chart Engineering - Posts: 17182 |
A Limit order cannot fill at a worse price, than the limit price. This is impossible. If Bar Based backtesting does not work as you require, then do not use it. This is impossible for us to say anything about, without in-depth analysis and debugging of exactly what you are doing: I'm not sure if bar close is consistent because after I run ACSIL with replay, sometimes the signals I get are drawn as arrows and they're wrong e.g. If I was waiting for a new bar to break previous close, it doesn't always do so. Once I use 'Reload & Recalculate', everything is drawn correctly.
Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-11-03 14:53:11
|
[2023-11-17 02:23:24] |
quriousqitty - Posts: 13 |
Just in case anyone runs into this issue in the future, bar close at sc.Index might not be what you want. If you want to act on a close of a bar, wait for sc.Index - 1.
|
To post a message in this thread, you need to log in with your Sierra Chart account: