Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I can't get this line to plot. What am I missing?

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

    I can't get this line to plot. What am I missing?

    I can get values but I can't plot this line. Code is below:-

    Code:
    
    protectedoverridevoid Initialize()
    {
    Add(new Plot(Color.Magenta, PlotStyle.Line, "PlotA"));
    CalculateOnBarClose = true;
    Overlay = true;
    PriceTypeSupported = false;
    myDataSeries = new DataSeries(this);
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    if (CurrentBar < 3) return;
     
    myDataSeries.Set(Math.Min(Low[1],Close[2]));
    Print("true low is" + myDataSeries.ToString());
     
     
    }
    

    #2
    Kay, you never plot this series - does it give you any prints?

    Try for example - PlotA.Set(Math.Min(Low[1],Close[2]));

    or

    Value.Set(Math.Min(Low[1],Close[2]));
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      I get an error message "The name 'PlotA' does not exist in the current context but when i use Value.Set it works!

      Why is that the case?
      Last edited by kaywai; 06-01-2010, 08:28 AM. Reason: adding more information

      Comment


        #4
        Great, then please check how you named your public DataSeries to be associated with your Plot in the Properties section of the code and adjust my snippet then as needed.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          sorry betrand. what am i suppose to put in the properties section?

          Comment


            #6
            You would need to expand the properties section of your code and see how the public DataSeries associated with your Plot is named, as then reflect this properly in your snippet code. As an example check into our BollingerBands indicator and see how Upper, Lower and Middle work codewise.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              issue resolved. thx for the pointers bertrand!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by pilotfo, Today, 12:50 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by DTSSTS, Today, 11:35 AM
              2 responses
              10 views
              0 likes
              Last Post DTSSTS
              by DTSSTS
               
              Started by sinpeople, Today, 07:20 AM
              2 responses
              6 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Frank1000, Today, 03:05 AM
              5 responses
              15 views
              0 likes
              Last Post Frank1000  
              Started by fscabrera03, Yesterday, 01:18 PM
              2 responses
              25 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X