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!
See more
See less

Partner 728x90

Collapse

How can I have Strategy Wizard wait to confirm a trigger?

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

    How can I have Strategy Wizard wait to confirm a trigger?

    New to the Strategy Wizard and Condition Builder, my apologies if this has an obvious answer I'm overlooking.
    I'm putting together a basic moving average cross where the cross will trigger a trade.
    I put the lookback period on the cross to "4" and have a separate condition where the fast moving avg is either greater than or less than the slow moving avg (depending on the cross) as a confirmation. Moving averages can stay together or intertwine for an extended period. I am looking for the trade to be triggered based on the cross but actually occur once the averages diverge, if they indeed diverge in the direction of said cross. If they diverge in the opposite direction of the cross, than trade wouldn't occur. Any thoughts on which conditions can do that for me. Any help is most appreciated.
    Thanks

    #2
    Hello decoda,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    So we are looking for the fast crossing above the slow, then we say the direction is up, if the fast goes down then trade cannot occur? Likewise, if the fast crosses below the slow, then we say the direction is down, is the fast goes up then trade cannot occur?

    I look forward to your response.

    Comment


      #3
      Patrick,
      Yes, that is correct. In addition, the trade would not happen until an actual divergence beyond the cross has occurred.
      Thanks for your help.

      Comment


        #4
        Hello decoda,

        Thank you for your response.

        Please detail what you mean by divergence. Is this both moving averages trending in the same direction but different from the previous direction, or is this both moving average moving away from each other by a set value?

        Comment


          #5
          Patrick,
          Essentially, I want the two moving averages moving away from each other. It doesn't matter direction, as long as the divergence is in the same direction as the cross (ex: fast crosses above slow but stays with the slow for a number of bars, once the fast breaks away from the slow in the upward direction; the trade is triggered. If it breaks away to the downside, the signal is reset til the next cross). My main concern is getting whipsawed when the two averages sit on top of each other for a period of time. The divergence can be a set tick/$ amount or a "greater than/less than" scenario. Thanks again for your help.

          Comment


            #6
            Hello decoda,

            Thank you for your response.

            Can you provide the set tick amount and expand on how you would calculate the divergence base don greater than or less than?

            Comment


              #7
              Patrick,
              For example, the divergence could be 1 tick or .01 of $ value on a crude oil (CL) future as one option or another option would be the following statement (change terminology as needed so Strategy Wizard/Condition Builder understands):
              "after fast MA crosses above slow MA, trade when fast MA > slow MA". I have the cross above setting with a lookback of 4, so the hope is the trade occurs 4 bars after the cross, provided the fast MA stays above slow MA. If they're still more or less equal at that point, I would still like the trade to trigger once the fast MA breaks away to the upside, no matter how many bars down the road it is.
              Thanks

              Comment


                #8
                Hello decoda,

                Thank you for your patience.

                I have crated a strategy outside of the Strategy Wizard for this example as I needed to use items that are not available in the Strategy Wizard. I have also created a video explaining the strategy.

                The video is available at the following link: http://screencast.com/t/wKQtBtW1

                Download the .zip attached to this response to your desktop and then go to File > Utilities > Import NinjaScript > and select the file. You can then view the file under Tools > Options > Edit NinjaScript Strategy. It will be called DecodasCrossStrategy.
                Attached Files

                Comment


                  #9
                  Patrick,
                  That's awesome, thanks for going through the trouble of putting this together for me. The video explained everything well, I shouldn't have a difficult time tweaking things if need be. I appreciate
                  the help!
                  Thanks again

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Working...
                  X