Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add() and Add() .. what is is difference?

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

    Add() and Add() .. what is is difference?

    Hello,

    there are two kind of the samed called Add() methods available in the help documentation. But only one of them works for me. i tried the following:

    this works fine:
    Code:
    EMA(FastEMA).Plots[0].Pen.Color = Color.Red;
    this should also be working, but doesnt for me:
    Code:
    Add(new Plot(Color.Green, PlotStyle.Line, "POC"));
    I know the concept of overloading methods. This seems to be such an issue

    #2
    IceRage, the first adds the EMA indicator for display.

    The second call just defines a plot which is not displaying anything if you don't set a value for the underlying dataseries -



    Comment


      #3
      Ok, but i even couldnt complile. I got the following message:

      Code:
      Die beste Übereinstimmung für die überladene Methode NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader.Indicator.IndicatorBase) hat einige ungültige Argumente.;CS1502 - click for info;49;4;
      Das Argument 1 kann nicht von NinjaTrader.Gui.Chart.Plot in NinjaTrader.Indicator.IndicatorBase konvertiert werden.;CS1503 - click for info;49;8;
      Translated by my humble english knowledge, that means that the Signature of the method doesnt match, in a way that a Plot Objekt isnt allowed there.

      "Das Argument 1 kann nicht von NinjaTrader.Gui.Chart.Plot in NinjaTrader.Indicator.IndicatorBase konvertiert werden" means: The Argument 1 cant converted from NinjaTrader.Gui.Chart.Plot to NinjaTrader.Indicator.IndicatorBase.

      Comment


        #4
        I suppose your are trying to Add() an indicator in the .Initialize() method of an indicator (and NOT a strategy). If so, then this is not supported.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X