Download MetaTrader 5
To add comments, please log in or register
Follow the news. View our company's official channel!
boscomanilow128
19
boscomanilow128 2014.04.17 19:34 

hello guys,

   I have been thinking over days already, it seems that for all indicators, any counter with i = prev_calculated could do more than fine as it points towards the previous candle which is already a calculated figure. why bother to do i = prev_calculated - 1 at all?

  actually it seems to me that if prev_calculated really mean previously calculated, then we should even set i = prev_calculated + 1 for our calculation in OnCalculate()... Why not?

Bosco 

Alain Verleyen
Moderator
28658
Alain Verleyen 2014.04.17 21:13  
boscomanilow128:

hello guys,

   I have been thinking over days already, it seems that for all indicators, any counter with i = prev_calculated could do more than fine as it points towards the previous candle which is already a calculated figure. why bother to do i = prev_calculated - 1 at all?

  actually it seems to me that if prev_calculated really mean previously calculated, then we should even set i = prev_calculated + 1 for our calculation in OnCalculate()... Why not?

Bosco 

Can you post at least one example of code.
enbo lu
Moderator
1894
enbo lu 2014.04.18 08:17  

this article mightbe helpful: Creation of Custom Indicators

Creation of Custom Indicators - Simple Programs in MQL4 - MQL4 Tutorial
  • book.mql4.com
Creation of Custom Indicators - Simple Programs in MQL4 - MQL4 Tutorial
/
To add comments, please log in or register