BTC USD 82,904.9 Gold USD 4,118.34
Time now: Jun 1, 12:00 AM

Expert Advisor (Entry post)

zulhashim

Fun Poster
Messages
174
Joined
Apr 23, 2010
Messages
174
Reaction score
7
Points
15
Ada tak sesiapa codes EA yang boleh buatkan EA tuk kawan.. byr pun takpe :"> . spec dia simple jer:-


* EA tu cuma perlu entry buy atau sell sahaja tanpa mengunakan sebarang indi, so bila aku close dia open semula.

* Mesti dalam 1 pair cuma 1 open shj, dia tk open jika pair tu dah ada entry..



p/s: Aku close dia bukak, aku close dia bukak , aku close dia bukak lagi sampailah margin tk bagi bukak baru dia tk bukak :)):)):))
 
pakai la vps test...byk mt4leh try.....:)paid:)paid:)paid
 
ye la..elok guna skript...berlayer2 boleh OP...
 
Code:
//--- input parameters
extern bool      Long=false;
extern bool      Short=false;
extern double    Lots=0.1;
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   int countBuy=0;
   int countSell=0;
   for (int i=0; i<OrdersTotal(); i++)
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol()) continue;
      if (OrderType() == OP_BUY) countBuy++;
      if (OrderType() == OP_SELL) countSell++;
   }
   
   if (Long == true && countBuy == 0)
      OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"Buy order",0,0,Green);
   if (Short == true && [COLOR="Red"]countSell [/COLOR]== 0)
      OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"Sell order",0,0,Crimson);
   
//----
   return(0);
  }

Never been tested. Use it at your own risk.
 
Last edited:
Code:
//--- input parameters
extern bool      Long=false;
extern bool      Short=false;
extern double    Lots=0.1;
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   int countBuy=0;
   int countSell=0;
   for (int i=0; i<OrdersTotal(); i++)
   {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol()) continue;
      if (OrderType() == OP_BUY) countBuy++;
      if (OrderType() == OP_SELL) countSell++;
   }
   
   if (Long == true && countBuy == 0)
      OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"Buy order",0,0,Green);
   if (Short == true && countBuy == 0)
      OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"Sell order",0,0,Crimson);
   
//----
   return(0);
  }



Terima kasih yang tak terhingga kepada bro aiman, thank you very very very very much... popit i sharing sama you :)cgrock:)cgrock:)cgrock
 

Latest Posts

Live Forex Chart

Currency
Rates
EUR / USD
1.13647
USD / JPY
157.143
GBP / USD
1.32507
USD / CHF
0.83171
USD / CAD
1.41664
EUR / JPY
179.049
AUD / USD
0.70194
Back
Top
Log in Register