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
I do not understand friend
JermyRec points you to a logical error made by you. It is necessary to check whether the order has been selected. The OrderSelect() function returns true if the order was selected and false if not selected. If you do not do this check, it is possible that the order with the specified ticket does not exist. Then you can get an unpredictable result of your entire function.
That's a work around, add 1 extra line
Please don't write ur - it's "you are" or "your" - MQL4 programming forum 2014.03.04
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
help me????????????????????????????
string cheekmoving()
{
if(iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,2)<iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,1)&&
iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,2)<iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,1))
if(iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,2)<iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,2)&&
iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,1)>iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,1))
return ("BUY");
if(iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,2)>iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,1)&&
iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,2)>iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,1))
if(iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,2)>iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,2)&&
iMA(NULL,0,MAs,0,MODE_SMA,PRICE_CLOSE,1)<iMA(NULL,0,MAl,0,MODE_SMA,PRICE_CLOSE,1))
return ("SELL");
else return ("NO");
}
Please edit your post and
use the code button (Alt+S) when pasting code
Hello,
Same problem here!
Can anyone help me, please?
Hello,
Same problem here!
Can anyone help me, please?
you need to post all of the code to be able to see your problem, it is not in the code you have posted so far
That's a work around, add 1 extra line