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

Not calculating indicator for last bar painted

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

    Not calculating indicator for last bar painted

    I am using a simple crossover system, and have for example inside OBU:

    Code:
    if (CurrentBar<emalenlow)
                     return;
    
    emalow[0]= EMA(Low, emalenlow)[0];
    In the SetDefaults I am using:
    Code:
        AddPlot(Brushes.Red, "emalow");
    And in #region Properties, have:
    Code:
    [Browsable(false)]
            [XmlIgnore]
            public Series<double> emalow
            {
                get { return Values[0]; }
            }
    But on the chart there is no ema value on the last bar drawn, only up to the second last bar. Is there something I need to modify?

    #2
    Hello pel11,

    Thank you for the post.

    What is your CalculationMode currently set to? If you are using OnBarClose, the building bar is not included because it is not yet closed. Using OnEachTick or OnPriceChange would allow the Building bar to be used.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      RESOLVED - Thanks - I noticed that by changing the settings. Good to go. Thx

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sidlercom80, 10-28-2023, 08:49 AM
      167 responses
      2,260 views
      0 likes
      Last Post jeronymite  
      Started by warreng86, 11-10-2020, 02:04 PM
      7 responses
      1,361 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Perr0Grande, Today, 08:16 PM
      0 responses
      5 views
      0 likes
      Last Post Perr0Grande  
      Started by elderan, Today, 08:03 PM
      0 responses
      9 views
      0 likes
      Last Post elderan
      by elderan
       
      Started by algospoke, Today, 06:40 PM
      0 responses
      10 views
      0 likes
      Last Post algospoke  
      Working...
      X