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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
47 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
22 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
15 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
21 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
23 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment