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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        239 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        155 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        164 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        247 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        199 views
        0 likes
        Last Post CarlTrading  
        Working...
        X