you typed is it first tick of bar earlier. do i need to put that somewhere in the strategy. or, just the bool is enough?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
entry orders keep happening
Collapse
X
-
..how long does the "false" last for? is it just for one bar?
you typed is it first tick of bar earlier. do i need to put that somewhere in the strategy. or, just the bool is enough?
-
..you typed if (IsFirstTickOfBar) earlier in the thread. do i need that somewhere in the strategy? or, is that bool you gave an example of all this is needed?
Comment
-
thanks for the replies. okay sweet. this is where i am with a stop loss i'm working on. i don't know how to reset a bool. can you offer guidance? where do i put the isfirsttickofbar? i see it in the options to be selected in the strategy builder.
Comment
-
Hello SteveReiza,
If the bool started as false, and was assigned a value of true, set this to false to reset it.
If the bool started as true, and was assigned a value of false, set this to true to reset it.
In this sample myBool is a bool that starts as false. The entry condition requires the bool to be false and places an order and changes the bool to true. On the first tick of a new bar the bool is reset back to false to allow a new order. This sample would allow only one entry method to be called per bar.Code:private bool myBool; if (myBool == true && IsFirstTickOfBar == true) { myBool = false; // reset bool to false on first tick of new bar } if (myBool == false && Close[0] > Open[0]) // require the bool to be false to allow an entry { EnterLong(); myBool = true; // after calling an entry method set the bool to true to prevent further orders until reset back to false }Chelsea B.NinjaTrader Customer Service
Comment
-
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
92 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
138 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
122 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
73 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment