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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment