Download MetaTrader 5
To add comments, please log in or register
Do you know that MQL5 can create custom graphical tools?
sorasit
358
sorasit 2014.07.12 01:05 

How to choose or apply ?



Thank you

Alain Verleyen
Moderator
28518
Alain Verleyen 2014.07.12 07:48  

Bars : "Number of bars in the current chart."

IndicatorCounted : "The amount of bars not changed after the indicator had been launched last."

whroeder1
13590
whroeder1 2014.07.12 13:16  
sorasit46: How to choose or apply ?

Look at ANY indicator in the codebase
#define LOOKBACK ma_period // Largest used in loop
int counted = IndicatorCounted();
if(counted < LOOKBACK) counted = LOOKBACK;
for(int iPos = Bars - 1 - counted; iPos >= 0; iPos--){
   buffer[iPos] = iMA( ... ma_period ... iPos); // Lookback==ma_period
   buffer[iPos] = ...  iPos+1);                 // Lookback==1
You use BOTH
sorasit
358
sorasit 2014.07.14 02:42  
Thank you
/
To add comments, please log in or register