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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      662 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      376 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X