here's my code :
magicalNumber = 98765;
if( Moyenne1 == Moyenne2 )
ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"SELL",magicalNumber,0,Red);
The problem is, it never takes order !
thanks in advance
And even if it is equal it may not be ;-) Can price != price ?
Does it try and take orders and fail ? What are Function return values ? How do I use them ?
Doubles rarely compare equal.
Working with Doubles in MQL4 - MQL4 ArticlesCan price != price ? - MQL4 forumBid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
how could it never been equal ?
look at this :
Read this and you will find out: Can price != price ?
Also if the cross is just before or just after a Bar the values at the Bar will not be equal.
The MAs are only calculated for each bar, not between bars . . .
These 2 MAs have crossed between Bars 1 & 2 but the values are not equal at any of the Bars.