double MA= iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0);
if( OrdersTotal() == 0 )
{
if( Ask > iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_BUY, lot );
if( Bid < iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_SELL, lot );
}
if( OrdersTotal() == 0 )
{
if( Ask > iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_BUY, lot );
if( Bid < iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_SELL, lot );
}
-
Play videoPlease edit your post.
For large amounts of code, attach it. - Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum
- where is my error in this code?"Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
hello friends, I am not very good, but I try
where is my error in this code?
double iMA = iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0);-
if( OrdersTotal() == 0 )
{
if( Ask > iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_BUY, lot );
if( Bid < iMA(NULL,0,1,2,MODE_SMA,PRICE_OPEN,0) Open_Order( OP_SELL, lot );
}
thank you