I wanted to insert an alert whenever RSI crosses EMA but the the alert is triggered sometimes without a corresponding event on the chart. Could somebody please take a look at the modified source and try to figure out what is wrong?
Better not to use that indicator. There are quite a few errors in it (not yours)
Use this one from this post instead : https://www.mql5.com/en/forum/general
It works great on the chart as a stand alone indicator but when I run a EA backtest on a h1 chart and try to use the stoch as a 4H indicator it shows up as a 1H indicator on the backtest 1H chart. see attached
can you post the iCustom() line that you use for calling that indicator from the EA?
Post 7216 has the EA attached , line 251. I figured you would need to see the string or int setup in the input as well as the custom line.
Kmain240 = iCustom(Symbol(),Period(),"RK-ml-Color Stochastic-best + mtf","240",KPeriod,Slowing,DPeriod,MAMethod,PriceField,overBought,overSold,0,1);
I have changed the Period() & "240" several times to no avail.
sorry I seem to be having posting problems
I HAVE EVEN TRIED:
It works great on the chart as a stand alone indicator but when I run a EA backtest on a h1 chart and try to use the stoch as a 4H indicator it shows up as a 1H indicator on the backtest 1H chart.
Sorry for not being clear earlier, I guess a picture is worth a thousand words: Please see attached
The call must be like this :
It is not the same when you call the first bar of an indicator from another time frame (second parameter - time frame parameter set to 240) as if you call the first bar of an indicator that works in multi time frame mode already. In the first case the bar is closed. In the second case, except if it was just opened a new bar, it is reading the values of the current (still opened bar)
Or you would have to specify the bar number completely differently
As of why it displays tested time frame data instead of 4 hour data in case like yours - one more "present" from metaquites I guess - it is obvious thet it cleaned up the TimeFrame parameter (string parameter) before displaying that data
Thank you, I would have never even come close to figuring that one out.
Would you please make this MTF?
As always, thank you.
This is a multi time frame version of the double smoothed stochastic of advanced Kaufman AMA : dss_of_advanced_kaufman_ama_mtf_nmc.mq4
Adaptive atr channel & mtf from here: https://www.mql5.com/en/forum/general made new mt4 compatible.
Adaptive DayImplus from here: https://www.mql5.com/en/forum/general made new mt4 compatible.