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

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 Brevo, Today, 01:45 AM
        0 responses
        4 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        241 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        6 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Working...
        X