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 bmartz, 03-12-2024, 06:12 AM
        4 responses
        31 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X