Topic: FirstBar in indicators
In some indicators iFirstBar=4 (in mqh file) and iFirstBar = 3 (in css file).
Is this correct?
Create and Test Forex Strategies
You are not logged in. Please login or register.
Forex Software → Technical Indicators → FirstBar in indicators
In some indicators iFirstBar=4 (in mqh file) and iFirstBar = 3 (in css file).
Is this correct?
No, they have to be equal. Post the indi names, which have that discrepancy.
Footon,
why in indicator "Pin Bar M" you use: int iFirstBar = 3;
but "for" cycle begins with 1?
for (int iBar = 1; iBar < Bars; iBar++)
I can't find now indicators with different iFirstBar in mqh and css (maybe all was fixed earlier).
I think 3 is the absolute minimum, better to have at least 3.
And calculation defines whether it is suitable to start main calc from the firstbar value or before. The idea is to have reasonable indi stats on the chart.
The iFirstBar (or firstBar) initial value depends on the indicator. For some indicators it is a fixed value, however, for others, it may depend on the period, shift or another indicator parameter.
It is safe to use iFirstBar = 3 as a minimum because it guarantees that there will be enough bars to calculate the indicator's logical condition.
For example, in MA the iFristBar = period + shift + usePreviousBar + 2.
Forex Software → Technical Indicators → FirstBar in indicators
Powered by PunBB, supported by Informer Technologies, Inc.