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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        30 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        17 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        9 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        16 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        19 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X