Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Operand cannot be applied to indicator

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

    Operand cannot be applied to indicator

    I have the following:

    numStdDev * StdDev(Close, 20)

    However, it will not do the multiplication since StdDev is an indicator. How would I resolve this issue? Thank you.

    #2
    Hello cfree5119,
    Thanks for your post.

    To get the current value of StdDev use StdDev(Close, 20)[0]. To get the previous value of the StdDev you can use StdDev(Close, 20)[1] and so on.

    Thus you can modify your code simply as

    Code:
    numStdDev * StdDev(Close, 20)[B][0][/B]
    This will give you an double value.

    Please do let me know if I can be of any further assistance.

    Regards,
    Joydeep.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I suppose I should have been more thourough... I am trying to use this within add(). Looks like this.

      Code:
      Add(MIN(Low, lowExitBandLength)[0] + (numStdDev * StdDev(Close, lowExitBandLength)[0]));
      This is yielding errors cs1502 and cs 1503. My lowExitBandLength and numStdDev are variables I have predefined.

      Comment


        #4
        Hello cfree5119,
        Thanks for the clarification.

        In your code you are trying to calculate the lookback period of the MIN indicator, and thus the issue. The lookback period is an integer, and the overload for the Add method in this case should be an indicator. Plesae see this help guide for further reference http://www.ninjatrader.com/support/h...s/nt7/add2.htm and http://www.ninjatrader.com/support/f...ead.php?t=3228

        What I get from your limited input is its better you create another indicator, which plots/calculates the desired value you want, and then call that indicator via the Add function in the strategy.

        Please do let me know if I can be of any further assistance.

        Regards,
        Joydeep.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Is there another way to plot this line without using the add method?

          Comment


            #6
            Hello cfree5119,
            To draw a line (plot), you have to use an indicator. A strategy cannot draw a Plot. However, you can assign value to a indicator dataseries from a strategy. Please refer to this reference sample for further reference http://www.ninjatrader.com/support/f...ead.php?t=6651

            In your case just create a blank indicator with one dataseris and assign value from the strategy using the above example.

            Please do let me know if I can be of any further assistance.

            Regards,
            Joydeep.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X