Attachments forums

List of attachments posted on this forum.


All files on forums: 163291

Re: Moving Average indicators for MT4

hernandez, Tue Nov 15, 2022 2:31 am

kvak wrote: Thu Nov 03, 2022 11:31 am Yes, you are right, I forget something in code....Sorry for that, here is corrected version and tomorrow I correct previous versions...
Thank you. I have another question for you. I would like to read the value of this indicator in m5 (shift = 1), but using m1 chart, so I read the previous m5 close candle every m1 candle, nothing strange. I do this using the iCustom function and in backtest for some personal testing, specifically:

Code: Select all

   iCustom(Symbol(), PERIOD_M1, IndicatorName, PERIOD_M5, indicators parameters...., shift=1); 
however this seems to give me not the value of the indicator in m5 with shit = 1, but another value which I'm not able to understand where it comes from.

One thinkg that I may ask you is related to the calls that you do internally on the mt4 functions, like Time, Close etc. The proper format in order to get a functional code is from

Code: Select all

Close[shift] to iClose(NULL , PERIOD_M15 , shift )
for example.

I give you an example:

Example: Long when previous m5 center line is green and volumes are green or gray, Short when previous m5 center line is red and volumes are red or gray. Look at my prints and the hours.
I think that this happens because the iCustom function written in my way reads the indicator in m1 chart with m5 version

Thank you!
All files in topic