• 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

Strategy Builder Variables

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

    Strategy Builder Variables

    Hello, I love the new Ninjatrader 8 but I'm having trouble building the following strategy in the strategy builder because of the variable involved. If price crosses below the 60 period SMA, I want to enter a short position, not right away, but wait until price reverses and crosses back above the 15 period SMA so I'm shorting on the retracement. So, I need to hold the state of the 60 period SMA cross below and then look and wait for the next condition which is price moving back above the 15 SMA and then enter a short position. Is that possible in the strategy builder?

    I also wish to reverse the strategy and go long when price crosses above the 60 SMA.

    Thanks, Trevor

    #2
    Hello Trevor.

    Thank you for the post and welcome to the NinjaTrader forum.

    You will have to set up a boolean variable that will act as a toggle for your short entry (Photo 1).
    When the 60 SMA crossbelow happens, set the bool to true (Photo 2) in set 1.

    Now make another set of conditions (Set 2) and enter short if the bool is true and if the SMA 15 crossabove happens (Photo 3). You might also want to set the bool variable back to false after you have entered short.

    Please let us know if we may be of any further assistance.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks very much, Chris. How do I set the bool variable back to false after I have entered short? Can you show me a screenshot? The strategy is working but it keeps continuing to short on every cross of the 15 SMA for the rest of the day and I just want to short once after the cross of the 60 SMA and not do it again until there's a new cross of the 60 SMA.

      Comment


        #4
        Hello,

        Thank you for the reply. In Set 2, in your "Actions" list. After you have entered short, set ShortTrade back to false.


        Please let us know if we may be of any further assistance.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ralett, Today, 07:29 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by bboyle1234, Today, 10:46 PM
        0 responses
        1 view
        0 likes
        Last Post bboyle1234  
        Started by swcooke, Today, 04:29 PM
        0 responses
        4 views
        0 likes
        Last Post swcooke
        by swcooke
         
        Started by bboyle1234, Today, 04:27 PM
        0 responses
        2 views
        0 likes
        Last Post bboyle1234  
        Started by swcooke, Today, 03:31 PM
        2 responses
        11 views
        0 likes
        Last Post swcooke
        by swcooke
         
        Working...
        X