Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies won't execute when using numerical values for indicators

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

    Strategies won't execute when using numerical values for indicators

    I have been backtesting multiple strategies. Most work just fine. However, any time I try to incorporate a number value into a strategy, when I backtest, no trades are executed.

    So, for example, if I create a strategy that relies on crossover or relative value between different indicators it works fine. But if I say, "Buy when RSI is less than 30," nothing happens, even though I can clearly see there are times when RSI was less than 30.

    I have found this problem with a few different strategies, and it's the same every time. I even created this simplest strategy I could think of to see if something else was interfering. I told the wizard to buy any time the CCI was less than -50, and sell any time it was greater than 50. Nothing happened.

    If I try to optimize these strategies, an error message says, "Error on running optimizer: Value cannot be null. Parameter name: value"
    Last edited by jasonbradh; 06-03-2016, 01:19 PM.

    #2
    Hello jasonbradh,

    Thank you for writing in and welcome to the NinjaTrader Support Forum!

    Let's make sure that the conditions you have specified are becoming true.

    To do this, what you can do is have your strategy draw a dot on the chart when the conditions are true.

    Following up with the simple strategy you have mentioned in your post, here is what I did for set 1:



    And set 2:



    I then backtested this strategy on an ES 06-16 chart. You'll see dots where the conditions I've specified are true and the orders being placed.

    Please let me know if your strategy is still not placing orders despite ensuring the conditions are being true.
    Attached Files
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thank you.

      Still not working. Even doing it super simple like that and asking it to draw a dot, no dot is drawn and no order executed. And the single condition is clearly becoming true, as you can see.
      Attached Files

      Comment


        #4
        Hello jasonbradh,

        In the screenshot you have provided, you are drawing your dot at a Y value of 0, or a price of 0.

        It won't show up on the chart even if your condition is true unless you scroll down to the price of 0.

        Please export your strategy so I may test it on my end.

        To export your script do the following:
        1. Click File -> Utilities -> Export NinjaScript
        2. Enter a unique name for the file in the value for 'File name:'
        3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
        4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


        Below is a link to the help guide on Exporting NinjaScripts.
        http://www.ninjatrader.com/support/h...nt7/export.htm
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Here it is.

          Thanks for your help.
          Attached Files

          Comment


            #6
            Hello jasonbradh,

            I see that you have named your User Defined Inputs as High and Low.

            Please note that this will conflict with the already existing High and Low collections.

            You will need to rename these variables to something other than High and Low or remove them as they are not being used in the strategy.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by junkone, Today, 11:37 AM
            0 responses
            1 view
            0 likes
            Last Post junkone
            by junkone
             
            Started by quantismo, 04-17-2024, 05:13 PM
            5 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by proptrade13, Today, 11:06 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            34 views
            0 likes
            Last Post love2code2trade  
            Started by cls71, Today, 04:45 AM
            2 responses
            10 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Working...
            X