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 argusthome, Yesterday, 10:06 AM
            0 responses
            22 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            19 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            10 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            41 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X