SCRIPT EA MARTIL

Posted: May 15, 2011 in Expert Advisor

KHUSUS UNTUK YANG MARTIL LOVER
Yang suka dengan sistem EA martil boleh coba coding ini, rubah sistem nya sesuai dengan sistem anda..
Selamat berkreasi…

#property copyright “Andi Goen”
#property link “http://facebook.com/andi.goen”

//—- input parameters
extern double TakeProfit=20.0;
extern int StopLoss=0;
extern double Lots=0.01;
extern double TrailingStop=15.0;
extern string txComment=”Ordered By AutoTrade”;
extern int MagicNumber=12345;
extern int Slippage=5;
extern int MinBalance=50;
extern int TargetBalance=11000000;

//+——————————————————————+
//| expert initialization function |
//+——————————————————————+

int init()
{
//—-

//—-
return(0);
}
//+——————————————————————+
//| expert deinitialization function |
//+——————————————————————+
int deinit()
{
//—-

//—-
return(0);
}
//+——————————————————————+
//| expert start function |
//+——————————————————————+
int start()
{
double S = iMA(NULL, 0, 8, 0, MODE_SMA, PRICE_CLOSE, 0);
double F = iMA(NULL, 0, 2, 0, MODE_SMA, PRICE_CLOSE, 0);
int total=OrdersTotal(),cmd,i;
double lot=0.1;
double dlot=0.2;
Comment( “\n”, “Leverage: “, AccountLeverage(), “Account equity: “,AccountEquity(), “\n”, “Current Price: $”, NormalizeDouble( Bid, 4),” Account Balance: $”, AccountBalance(),”\n”, “Bid:”, Bid, ” Ask: “, Ask);

if ((AccountEquity()=TargetBalance))//if money not enough or target archive, no trade.
{
closebuy();
closesell();
return(0);
}

if (total(S<F)) OrderSend(Symbol(),OP_BUY,0.1,Ask,0,0,Ask+TakeProf it*Point,"Order Buy 1",11111,0,Blue);
if (AskF)) OrderSend(Symbol(),OP_SELL,0.1,Bid,0,0,Bid-TakeProfit*Point,”Order Sell 1″,11111,0,Red);
}

else //if there are op, check conditions.
{
OrderSelect(total-1, SELECT_BY_POS, MODE_TRADES);
if(OrderLots()>102.4)
{
return (0);
}

if (OrderType()==OP_BUY)
{
if ((Ask+1*Point <= (OrderOpenPrice()-TakeProfit*Point)) && (Ask-1*Point (S= (OrderOpenPrice()+TakeProfit*Point)) && (Ask-1*Point >= (OrderOpenPrice()+TakeProfit*Point)))
{
closebuy();
}
}

if (OrderType()==OP_SELL)
{
if ((Bid+1*Point >= (OrderOpenPrice()+TakeProfit*Point)) && (Bid-1*Point >= (OrderOpenPrice()+TakeProfit*Point)))
{
if (BidF))
{
OrderSend(Symbol(),OP_SELL,OrderLots()*2,Bid,Slipp age,0,Bid-TakeProfit*Point,”Double Lot Sell”,11111,0,Red);
}
else
{
OrderSend(Symbol(),OP_BUY,0.2,Ask,Slippage,0,Ask+T akeProfit*Point,”hedging”,11111,0,Blue);
OrderSend(Symbol(),OP_SELL,OrderLots()*2,Bid,Slipp age,0,Bid-TakeProfit*Point,”Double Lot Sell”,11111,0,Red);
}
}
else if ((Bid+1*Point <= (OrderOpenPrice()-TakeProfit*Point)) && (Bid-1*Point =0; i–)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType()==OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),Bid,5,CLR_NON E);
}
}
return(0);
}

void closesell()
{
int total=OrdersTotal(),i;
for(i=total-1; i>=0; i–)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType()==OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),Ask,5,CLR_NON E);
}
}
return(0);
}

Comments
  1. Suryo Retmawan W says:

    di TF brp om… jam brp bagusnya?
    sudah saya buka di metaquote editor dan di compile banyak yg error
    ada yng siap download?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s