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
Advancing the active or current bar
Collapse
X
-
Advancing the active or current bar
In my strategy, I am using <IsFirstTickOfBar> when making an entry but there are times that I would like to make the entry on the next bar. Is there a way to advance that bar, I tried nesting <IsFirstTickOfBar> but it did not work for me.Tags: None
-
Hello galsermil,
You cannot advance the data or manipulate the data in any way, the way your script processes is a result of how it processes the bar data and incoming data.
You would have to make your own logic which handles that situation. A simple way would be to use a bool variable. At the time when you see the entry should be submitted you could set the variable to true, on the next bar if the variable is true submit the order. You can also use more complex ways like storing the CurrentBar to check if a number of bars elapsed.
JesseNinjaTrader Customer Service
-
Thank you. I think I have myself between a rock and a hard place because I am using <IsFirstTickOfBar> in order to get my entry as close to the Open of the bar as possible but the signal to not use that bar is produced during that bar, usually quite early but not always. I suppose that I will have to find my warning at bar[1] or not at all..
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Ashkam, 04-29-2024, 09:28 AM
|
4 responses
43 views
0 likes
|
Last Post
by Ashkam
Today, 02:38 PM
|
||
Started by nightstalker, Yesterday, 02:05 PM
|
1 response
29 views
0 likes
|
Last Post Today, 02:16 PM | ||
Started by dcriador, Today, 02:09 PM
|
0 responses
5 views
0 likes
|
Last Post
by dcriador
Today, 02:09 PM
|
||
Started by nicthe, Today, 07:38 AM
|
4 responses
21 views
0 likes
|
Last Post
by bltdavid
Today, 01:58 PM
|
||
Decrease the size of the RegionHIghLightY on each tick when the price touches it
by cmtjoancolmenero
Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
|
30 responses
98 views
0 likes
|
Last Post Today, 01:53 PM |
Comment