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