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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X