Use buffer 3 only
PS: that indicator is not my indicator (ie: someone made some changes to it). Use the original
thanx for your reply
I finally replaced these lines:
iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,0,1) == 1 && iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,1,0) == 1 iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,1,1) == 1 && iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,0,0) == 1
by
iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,3,cnt) == -1 iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,3,cnt) == 1
and it's now behaving the way i wanted to.
for some unknown reasons this syntax doesn't work with this indicator:
iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,3,cnt) == 1 && iCustom(NULL,0,"SuperTrend nrp new mtf 2 histo",10,PRICE_CLOSE,4.0,60,3,cnt+1) == -1
It's kind of problematic since i have no way to find out the previous bar state.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I'm trying to write a very simple rule into my EA where when Supertrend Indicator turns bearish on H1 Timeframe it closes the opened buy order
and when it turns bullish on H1 Timeframe it closes the opened sell order, but for some (probably obvious reasons for you coders) it doesn't work.
So i'm trying to figure out why is it working with iMA rules (see commented condition in the code) but when trying with iCustom it simply doesn't.
I also tried to include it into a custom indicator i coded myself and i get the same problem so i don't think it is EA related.
i also tried with buffer 3
but same result.
in the MT4 data window there are only 2 buffers showing value [trend up first buffer =1.0000 second buffer empty] and [trend down second buffer = 1.0000 first buffer empty]
I tried many combinason lite >1 <1 ==EMPTY_VALUE !=1 !=0 !=EMPTY_VALUE etc... but the problem remain the same.
here is the code section in the EA:
here is the code of the Supertrend Indicator:
any explanation welcome..
thanx