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
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 dustydbayer, Today, 01:59 AM
|
0 responses
1 view
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
0 responses
3 views
0 likes
|
Last Post
by inanazsocial
Today, 01:15 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
22 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by Davidtowleii, Today, 12:15 AM
|
0 responses
3 views
0 likes
|
Last Post
by Davidtowleii
Today, 12:15 AM
|
||
Started by guillembm, Yesterday, 11:25 AM
|
2 responses
10 views
0 likes
|
Last Post
by guillembm
Yesterday, 11:58 PM
|
Comment