Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add(MAX(High,CalcDistanceL)[1]) does not work

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

    Add(MAX(High,CalcDistanceL)[1]) does not work

    Hello

    I want to plot MAX(High,CalcDistanceL)[1] on the chart, but I get an error.
    This works:
    Add(MAX(High,CalcDistanceL))

    This does not work
    Add(MAX(High,CalcDistanceL)[1])
    Error:
    1-Argument: cannot converted from "double" in "NinjaTrader.Indicator.IndicatorBase"
    and
    The best match for the overloaded NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader. Indicator.IndicatorBase)-Methode has several invalid arguments

    How can I plot the MAX as above?

    thanks

    #2
    Beauregard, you can only add complete indicators for plotting / visualization by your strategy - so in order to plot the max, create an indicator that would return this plot and then add it.

    Comment


      #3
      I am not sure, whether I understand correct.
      Plotting the Max works, as I have written:
      Add(MAX(High,CalcDistanceL))

      What does not work is MAX until the previous day

      Comment


        #4
        You access a double value then and not a full series, this would not be possible, as you can only add a full indicator and not visualize a single value / plot.

        Comment


          #5
          OK, all clear, thanks

          Comment


            #6
            Originally posted by Beauregard View Post
            Hello

            I want to plot MAX(High,CalcDistanceL)[1] on the chart, but I get an error.
            This works:
            Add(MAX(High,CalcDistanceL))

            This does not work
            Add(MAX(High,CalcDistanceL)[1])
            Error:
            1-Argument: cannot converted from "double" in "NinjaTrader.Indicator.IndicatorBase"
            and
            The best match for the overloaded NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader. Indicator.IndicatorBase)-Methode has several invalid arguments

            How can I plot the MAX as above?

            thanks
            MAX(High,CalcDistanceL)[1] is a double. If you want to plot it, then assign it to the Plot, using a Set statement.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            67 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            36 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            60 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            62 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X