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 terofs, Yesterday, 04:18 PM
        1 response
        21 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by RookieTrader, Today, 09:37 AM
        2 responses
        13 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X