[FONT=Courier New]private int myBar; private bool Conditions = false; if(Conditions) myBar = CurrentBar; if(myBar == CurrentBar - 1) { myBar = 0; //The next bar has occurred. } [/FONT]
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
Enter positions on Next Bar Close
Collapse
X
-
Thank you for bringing this to our attention, bltdavid. Here is an edited version of the above code.
Code:
-
Originally posted by NinjaTrader_CodyB View PostHello,
Through using custom logic you would be able do this.
One process that I can think of is adding in a variable that you assign to CurrentBar and then check when the CurrentBar is equal to this value + 1.
For example:
private int myBar
if(Conditions is true)
CurrentBar = myBar;
if(myBar == CurrentBar - 1)
//The next bar has occurred.
Leave a comment:
-
Hello,
Through using custom logic you would be able do this.
One process that I can think of is adding in a variable that you assign to CurrentBar and then check when the CurrentBar is equal to this value + 1.
For example:
private int myBar
if(Conditions is true)
CurrentBar = myBar;
if(myBar == CurrentBar - 1)
//The next bar has occurred.Last edited by NinjaTrader_CodyB; 03-06-2016, 04:37 PM.
Leave a comment:
-
Enter positions on Next Bar Close
Hi,
Can NinjaTrader Strategies be configured to enter long/short positions on the close of the next bar?
Thanks,
JamesTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
12 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
||
Started by strategist007, Yesterday, 07:51 PM
|
0 responses
13 views
0 likes
|
Last Post Yesterday, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,982 views
3 likes
|
Last Post
by jhudas88
Yesterday, 06:59 PM
|
Leave a comment: