Support Board
Date/Time: Fri, 31 Jan 2025 19:57:22 +0000
Post From: backtest with manual looping, sc.GetTradePosition() doesn't update?
[2019-05-20 03:38:17] |
Sierra Chart Engineering - Posts: 104368 |
You need to add this to your code just below the sc.SetDefaults code block : if (sc.IsFullRecalculation)
return; Because there is a very important other time, sc.IsFullRecalculation is only true once on the first bar during a back test.when doing a backtest, where the one sc.IsFullRecalculation==1 with sc.StartUpdateIndex==0 pass is your *only* opportunity to place orders. And, last but very much not least, the devious thing about the None of what you are saying is true at all. When that error occurs, the order is rejected. It is that straightforward and simple.
"Order entry skipped because full recalculation" message is that it will subvert the API and tell you that your order succeeded, but publish that complaint to the log AND then mess with the API in that you won't see any actual trade position change happen due to your filled order. However your order will get filled under backtest, so you just have to ignore it. 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, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2019-05-20 03:41:26
|