I would like to know how I can use the Ref() function of metastock in MQL4.
Ref() in metastock is used to take the previous values of the given data array.
for example:
iClose(_Symbol,PERIOD_D1,1) for close. In Mql4 0 means the current candle, and increases to the left, so -1 in your case becomes 1; this is true when accessing candle data. For regular arrays, e.g., obtained by CopyBuffer or looping, array indexes are 0 to ArraySize()-1
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more