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

Adding additional indicators to basic strategy

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

    Adding additional indicators to basic strategy

    I am trying to set up a simple MA strategy and I want to set it up so that it only trades when the DM is above the 25 line. Does anyone know how to set this up? Thank you.

    Mark

    #2
    Hello Mark,

    Welcome to the NinjaTrader forums!

    You can make indicator to comparison values with the condition builder. Please see the help guide article for additional help with this:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank you Ryan. So if I already have conditions present, would I add the additional conditions to set 1 or would I add them to set 2?

      Sorry, I'm still trying to learn the basics in understanding programming.

      Comment


        #4
        Hi Mark,

        If you want to add this to your first conditions, then it would go in set 1.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I'm not sure this is working properly. Under set 1 I currently have when one EMA crosses above another EMA then go long and under set 2 it is the opposite; go short when one crosses below.

          I would like to add to both set 1 and set 2 a condition that says only go long or go short if ADX is greater than 30. I added this condition under both set 1 and set 2, but when I ran the backtesting it only showed 6 trades over 4 months.

          I'm sure there is something I'm not doing correctly. I appreciate your help.

          Comment


            #6
            Mark, perhaps you can add a screenshot how you've set it up so we can directly take a look? You may want to try a lower ADX level if the market does not trend to the extremes, as this would give you more trades then.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              I went through the trades it was making on the chart and it wasn't working properly. I am not able to capture a screen shot because I'm using virtual box on mac to trade NT. Here is what I have on set one:

              When the following conditions are true:
              CrossAbove(SMA(Fast), SMA(Slow), 1)
              ADX(14[0]>30

              Do the following:
              EnterLong(1,"Long 1")

              Set 2
              When the follwoing conditions are true:
              CrossBelow(SMA(Fast), SMA(Slow), 1)
              ADX(14)[0]>30

              Do the following:
              EnterShort(1, "Short 1")

              What I want to have done is for the program to trade when the SMAs cross above AND the ADX is above 30. I would like to also add a trailing stop to this and a stop loss. I wasn't able to get that working properly either. I would also like to go short when the SMAs cross below. Looking back through the charts, these conditions take place multiple times per day, so there should be plenty of trades to track.

              Sorry to be a pain, but I'm just not understanding how to utilize the strategy analyzer yet. I appreciate your help.

              Mark

              Comment


                #8
                Mark, what you've setup is ok - if you add multiple conditions like you did, they are linked by the boolean AND operator so both have to be true to trigger the 'actions'. I suggest you add a drawing to visually check off your conditions on the chart.



                You can add a trailing stop in the stops and targets section via the SetTrailStop commend, unfortunately you can't do a static stop loss and trailing stop together on the same position in the wizard (only possible by custom coding).
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  So do I need to set up an additional user defined input? Currently I only have 2 user defined inputs, one is for my Fast MA and the other is for my Slow MA and both are set to type integer. Do I need to change these to Bool and add an additional one.

                  If it were you, how many drawing tools would you add?

                  Are you available to talk with on the phone?

                  Thank you again for all your help.

                  Mark

                  Comment


                    #10
                    You want to keep the integer inputs you have for the MA lengths, you can add another one to set the ADX level as needed.

                    Just add for example a dot above / below the bar when your conditions trigger, this way you get a visual headsup that the system prepares to trade on the next bar.



                    If you contact us at support at ninjatrader dot com we can schedule a call with you.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by judysamnt7, 03-13-2023, 09:11 AM
                    4 responses
                    57 views
                    0 likes
                    Last Post DynamicTest  
                    Started by ScottWalsh, Today, 06:52 PM
                    4 responses
                    36 views
                    0 likes
                    Last Post ScottWalsh  
                    Started by olisav57, Today, 07:39 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post olisav57  
                    Started by trilliantrader, Today, 03:01 PM
                    2 responses
                    20 views
                    0 likes
                    Last Post helpwanted  
                    Started by cre8able, Today, 07:24 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post cre8able  
                    Working...
                    X