Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Help with Strategy
Collapse
X
-
Hello mestril,
A bool has a true or false value can be changed when a condition is true and used to stop an event from happening multiple times until the bool is set back to the original value.
For example:
private bool myBool = false;
if (/* some condition to set the bool back*/)
{
myBool = false;
}
if (myBool == false /* && other conditions for action here */)
{
myBool = true;
// execution action here
}
With this the bool would bet set to true to stop the action, and then set back to false to allow the action to happen again.
Below is a public link to a 3rd party educational site on bool.
As well as a link to a forum post with helpful information about getting started with NinjaScript.
https://ninjatrader.com/support/foru...040#post786040
Also, below is a link to examples of a breakeven with the Strategy Builder.
As well as a more complex script.
As a tip, below is a link to a forum post with steps to export a script so this may be shared with recipients.
https://ninjatrader.com/support/foru...06#post1054106Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
88 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
134 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
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
67 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment