Download MetaTrader 5
To add comments, please log in or register
Do you wonder how to use widgets? Read the article!
JayRogers
7
JayRogers 2016.05.17 23:58 

Hello boys and girls! First post, so yay and stuff.

Yes.. yet another topic about custom MA's and arrays and stuff.. I have been searching a considerable time but can't seem to find any relevant info.

So what I am trying to do is create a custom SMA calc - that in itself seems pretty simple. The problem comes in that I can't seem to wrap my head around how to properly get all the values required for my calculation.

What I need to be able to do, is that, while looping through the usual o/h/l/c values of specific period, I also need to be getting the "correct" offset value from a previous higher period.

 

So if I'm looping through getting my combo of PERIOD_M5 o/h/l/c values, how could I also pull in the correct (for example)..

iOpen(NULL, PERIOD_H1, 2);

..offset from the current PERIOD_M5 in the loop?

 

This cannot simply be the lower period multiplied to the same value as the higher period - It must be the 'actual' higher period bar open value. Need to end up with something along the lines of..

for(i = amount; i >= 0; i--){ EndCalc[i] = LowPeriodValues[i] /* -- < calc with > -- */ iOpen(NULL, PERIOD_H1, ProperRelationalOffset) ; }

 ..any ideas or suggestions greatly appreciated - sorry I cannot provide any more code, and sorry for clogging the place up if this has a really simple solution lol.

 

Thanks! 

Fernando Carreiro
1437
Fernando Carreiro 2016.05.18 00:19  
Use iTime() and iBarShift() to synchronise your different time-frames!
JayRogers
7
JayRogers 2016.05.18 00:27  
FMIC:
Use iTime() and iBarShift() to synchronise your different time-frames!

Thankyou!

No idea how to go about it, but you've given me a starting point sir. Much appreciated. 

/
To add comments, please log in or register