Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 -



    BertrandNinjaTrader Customer Service

    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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        53 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        5 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        19 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        6 views
        0 likes
        Last Post cre8able  
        Working...
        X