Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator start in strategy

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

    Indicator start in strategy

    I Add() an EMA in my strategy to the chart and want the indicator to start at the first bar of the historical data.

    This does not work:
    Code:
    EMA(10).BarsRequired = 0;
    Add(EMA(10));
    Also my strategy has BarsRequired = 0;

    How can it be done?
    Last edited by symphys; 05-13-2010, 07:55 PM.

    #2
    This can't be done, because the EMA(10) needs 10 bars to calculate before it produces a value.
    The value of the EMA(10) is the average of the previous 10 bars; at the start of your historical data there are no previous 10 bars, so it will wait for the first 10 bars to appear until it produces a value (and hence becomes visible on the chart)


    Marco

    Comment


      #3
      Yeah, right. Stupid me was so late yesterday. Thanks for the reminder...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X