Can anybody say is it possible to enter position when CalculateOnBarClose = true and exit position wen it is false??
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CalculateOnBarClose = false\true
Collapse
X
-
nkonkov, it is definitely possible to use the two settings albeit with a slight workaround as described in the reference sample titled Separating logic to either calculate once on bar close or on every tick.
Basically, you will use CalculateOnBarClose = false and use a filter in OnBarUpdate() like this:
Code:OnBarUpdate() { if (FirstTickOfBar) { // do once per bar calculations at the very beginning of the bar. be sure to adjust your bar indexes by -1 because the bar of interest is now one bar back. } }AustinNinjaTrader Customer Service
-
nkonkov, this can unfortunately not easily be done, as in backtesting you would only have access to the bar's OHLCV info. Best next step would be to work results for past out in our Market Replay, which allows you replaying the days at 500X speed with access to the intrabar formation needed for testing this setup.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
61 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
149 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
99 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
286 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment