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
Next Bar Open
Collapse
X
-
Next Bar Open
How do obtain the next bars open? I am unable to use the opening of the market in my calculation because the program calculates the signals on the close.Tags: None
-
You should lnow the open at the open. Why does it calculate it at the close. Why not the open? How would you then code this (next bar open + range ) or ( if next bar open < close)
Comment
-
Of course you know the open at the open. If that's what you want, see the CaclulateOnBarClose property so that you can run tick by tick.
During a backtest, you know the OHLC of the final bar which is the close of the bar.
We have no concept of "next bar open" since you can only evaluate your program logic at the point of evaluation which is at the close of a bar or on every tick. With NinjaTrader, you don't get access to future data.
Therefore, if next bar open < close is not valid since you are comparing a future's bar open price to the current bar open price.
Here is some documentation - http://www.ninjatrader-support.com/H...BarClose1.htmlRayNinjaTrader Customer Service
Comment
-
-
-
Not when using the pit open. When do you think this feature will be add and do you have anymore work arounds
Comment
-
Hi Ray/Brady, Have you find the way to make it work?
I also need to have next bar open in backtest.
It seems that when running backtest, if I do enterlong(), the market price of it will be assumed to be the next bar open price. My strategy will need to limited price to the next bar open price such that it will have more guarantee performance in real time.
I hope NT7 already has this implemented or in any way of coding I can make it to work. (I am a programmer).
Comment
-
pcijoin, there are unfortunately no changes here, we still do not allow peeking into the future - which exact order / signal are you trying to implement? In Market Replay you could work with CalculateOnBarClose = false and just submit a tick after the open then.BertrandNinjaTrader Customer Service
Comment
-
Hi Bertland, thanks for your reply!
Here is the detail problem I am having with NT Backtesting:
First of all, the NT backtesting of my strategy showed good performance.
During NT backtest as the attachment image shown, I assume NT run the stategy as:
When the bar closed, the next open price will be assumed to be the market price of enterlong() or entershort().
But during the real time, if the same strategy do enterlong() or short(), the price it filled may not be the next bar open price as the NT backtesting shows. Therefore, in order to make backtesting to be more similar to the real time running of this strategy that is already working good in backtesting, I am thinking to limit the price to the next bar open price. If it can't get the price of the next bar open, it should not enter the position.
I hope I explain well here, if not, please let me know.
Again, is there anyway I can implement this? Is my concept of NT backtesting is correct or not? Please guide and help! Thank you!
P.S. See attachment picture for detail
Originally posted by NinjaTrader_Bertrand View Postpcijoin, there are unfortunately no changes here, we still do not allow peeking into the future - which exact order / signal are you trying to implement? In Market Replay you could work with CalculateOnBarClose = false and just submit a tick after the open then.
Comment
-
Thanks for the detailed clarification - while you would unfortunately not have access to the future open price, you could add bid / ask series to your strategy and submit against those (NT7 only), which will give you a more realistic picture of your market order fills.
BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
57 views
0 likes
|
Last Post
by DynamicTest
Today, 08:25 PM
|
||
Started by ScottWalsh, Today, 06:52 PM
|
4 responses
36 views
0 likes
|
Last Post
by ScottWalsh
Today, 07:40 PM
|
||
Started by olisav57, Today, 07:39 PM
|
0 responses
7 views
0 likes
|
Last Post
by olisav57
Today, 07:39 PM
|
||
Started by trilliantrader, Today, 03:01 PM
|
2 responses
19 views
0 likes
|
Last Post
by helpwanted
Today, 07:25 PM
|
||
Started by cre8able, Today, 07:24 PM
|
0 responses
9 views
0 likes
|
Last Post
by cre8able
Today, 07:24 PM
|
Comment