Or this one I try, none of it working , please advice.
void OnTick() { if (OrdersTotal()>0) closeaboveMA() } double ma; { ma=iMA(NULL,1440,5,0,MODE_SMA,PRICE_CLOSE,0); } double closeaboveMA; { if(OrderType()==OP_BUY) { if(Open[1]>ma) if(Bid > OrderOpenPrice() + 1*Point) OrderClose(OrderTicket(),OrderLots(),Bid,3,White); break; } if(OrderType()==OP_SELL) { if(Open[1]<ma) if(Ask > OrderOpenPrice() + 1*Point) OrderClose(OrderTicket(),OrderLots(),Ask,3,White); break; } }
Kret_kret:
Or this one I try, none of it working , please advice.
Or this one I try, none of it working , please advice.
Hello friend,
Time frame
double ma; { ma=iMA(NULL,1440,5,0,MODE_SMA,PRICE_CLOSE,0); }
You could do this
double ma; { ma=iMA(NULL,0,5,0,MODE_SMA,PRICE_CLOSE,0); }also scripts only execute once and then they exit.

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 guys,
I got this original script somewhere here, I modify it so it would become cloing above or below MA. The problem is I lack in skill in mq4 and still learning. Need advice please. How to make it run correctly. Thanks.