• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with Strategy

    Deleted....
    Last edited by mestril; 06-07-2019, 08:23 AM.

    #2
    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.
    https://www.dotnetperls.com/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.
    https://ninjatrader.com/support/foru...427#post527427

    As well as a more complex script.
    https://ninjatrader.com/support/foru...269#post802269


    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#post1054106
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by gosaraf, Today, 01:50 AM
    0 responses
    2 views
    0 likes
    Last Post gosaraf
    by gosaraf
     
    Started by amilanoski, Yesterday, 08:04 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by PanicTrades, Yesterday, 07:01 PM
    2 responses
    23 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by _Zero_, Yesterday, 03:46 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by jeronymite, Yesterday, 11:18 PM
    0 responses
    6 views
    0 likes
    Last Post jeronymite  
    Working...
    X