Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator is not drawing anything on the chart

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

    Indicator is not drawing anything on the chart

    public class KamaSUM : Indicator
    {
    #region Variables
    // Wizard generated variables
    // User defined variables (add any user defined variables below)
    private int KAMA_sum = 0;
    private DataSeries kamasumseries;
    #endregion

    /// <summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    /// </summary>
    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Kamasum"));
    Overlay = false;
    kamasumseries= new DataSeries(this);
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    KAMA_sum =0;

    for( int i=0; i<20;i++)
    {
    if(Close[i] > KAMA(2,100,30)[i])
    {
    KAMA_sum++;
    }
    }

    kamasumseries.Set(KAMA_sum);

    Kamasum.Set(kamasumseries[0]);
    }

    #2
    found the solution...

    Comment


      #3
      Hi Sgeesala,

      Thank you for posting.

      Glad to hear you found a solution.

      Out of curiosity, what was the solution?
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        i didn't take care of the minimum number of bars to be completed before accessing the them

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X