Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Calculate Bar on Close
Collapse
X
-
Hello,
You could achieve this by having your strategy set to CalculateOnBarClose and add in a 1 tick data series for intrabar granularity and checking your calculations for intrabar within BarsInProgress == 1. I would recommend to review our reference sample for Backtesting NinjaScript Strategies with an intrabar granularity: http://ninjatrader.com/support/forum...ead.php?t=6652 This reference sample should provide a great example of how you can get intrabar calculations with CalculateOnBarClose set to true.
Please let me know if you have any further questions.Cody B.NinjaTrader Customer Service
-
This is related and I'm hoping somebody can just clarify quickly:
I have two scenarios in a strategy with OnBarClose and OnEachTick in Playback with 10 minute bars
If I call SMA(20) within OnBarUpdate and it's calculated OnBarClose, this will use wait for the current bar to close and then use the prior 20 ten minute bars.
If I call SMA(20) within OnBarUpdate and it's calculated OnEachTick, at any time in the current 10 minute bar does this use the prior 19 ten minute bars and the current tick? Or does it use the prior 20 ticks?
I hope that's clearly stated to get a clear answer because it's driving me crazy.
Thanks in advance!
Comment
-
Hey, yes using NT8 B9, but I suspect that this question applies to both NT7 and NT8.
I just never really used CalculateOnBarClose=False when backtesting in NT7, so I'm trying to just figure out exactly what is happening without a trial and error sort of process.
I can clarify the question if needed, but I'm just curious OnEachTick uses 20 prior 10 minute bars in my example before, 20 tick bars, or 19 ten minute bars and the current tick.
Thanks again
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by The_Sec, Yesterday, 03:37 PM
|
1 response
11 views
0 likes
|
Last Post Today, 06:17 AM | ||
Started by vecnopus, Today, 06:15 AM
|
0 responses
1 view
0 likes
|
Last Post
by vecnopus
Today, 06:15 AM
|
||
Started by Aviram Y, Today, 05:29 AM
|
0 responses
5 views
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
27 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
36 views
0 likes
|
Last Post Today, 05:15 AM |
Comment