- Why did you post your MT4 question in the Root / MT5 Indicators
section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. -
if(!iMA(0,15,6,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,15,18,0,MODE_EMA,PRICE_CLOSE,x)
That doesn't do what you think it does. True = non-zero and false = zero so you getif( 3 < 2 < 1 ) if( false < 1 ) if( 0 < 1 ) if( true )
if( 3 > 2 > 1 ) if( true > 1 ) if( 1 > 1 ) if( false )
- I'll help you with one.
//Are the MA's aligned { if(!iMA(0,15,6,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,15,18,0,MODE_EMA,PRICE_CLOSE,x) && !iMA(0,15,18,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,15,50,0,MODE_EMA,PRICE_CLOSE,x) && !iMA(0,15,50,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,15,200,0,MODE_SMA,PRICE_CLOSE,x) && !iMA(0,60,6,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,60,18,0,MODE_EMA,PRICE_CLOSE,x) && !iMA(0,60,18,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,60,50,0,MODE_EMA,PRICE_CLOSE,x) && !iMA(0,60,50,0,MODE_EMA,PRICE_CLOSE,x)>iMA(0,60,200,0,MODE_SMA,PRICE_CLOSE,x)) }
An if statement has the form if( … ) statement; - The rest are even more trivial. Learn to code. Read the manual.
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
Hi,
I am trying to write an indicator and have run into a problem with getting it to compile. I would really appreciate any help anyone can give. The indicator checks that :-
MA's on 2 timeframes are aligned
the last 3 closed candles are all higher or lower than the previous candle
At least 1 candle of the 3 is larger than the ATR(14)
At least 1 candle wick touches the 6EMA
None of the 3 candle wicks are touching the 18EMA
None of the 3 candles closes below the 6EMA (Short) or above the 6EMA(Long)
Here is the sql file