- Array question about High[],Low[],Close[],Open[] etc.
- TP and SL ten times higher
- Can't find bug, please help
Returns the number of bars count in the history for a specified symbol and period.
So this has got nothing to do with the number of bars on the chart and so it will not be affected by you changing the chart dimensions.
Maybe you are referring to:
Gets total number of visible chart bars.
In any case if you are running an EA that uses for example a Moving Average of 100, then in order to calculate the value of this moving average, at least 100 bars have to be present, or the function will give a false reading.
If there are less then 100 bars in history, the correct value can not be calculated and if you are not using this filter it can result in unwanted or false entries.
samusmus1: why do people use this protection in their EA?
| They are following what some moron did 15 years ago and don't know any better. They aren't a complete idiot, some parts are missing. |
The question was: "Why..."
Bars>100 is a protection against this kind of problem I described.
I check as well MarketInfo(Symbol(),MODE_TICKVALUE)) in start() or OnTick() or OnCalculate() ..
It is the reason and the answer of "Why ..."
The question was: "Why..."
Bars>100 is a protection against this kind of problem I described.
I check as well MarketInfo(Symbol(),MODE_TICKVALUE)) in start() or OnTick() or OnCalculate() ..
It is the reason and the answer of "Why ..."
Sure, I know it's your answer ;-)
But what I don't see is how "Bars < 100" is a protection against "the quotes and other stuff (e.g. tickvalue) hasn't been available yet" ? I mean, if it's one, it's not a good one in my opinion.
Anyway, probably not important.
You agree to website policy and terms of use