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 GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,271 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        2 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        403 views
        1 like
        Last Post beobast
        by beobast
         
        Working...
        X