Script EA Forex Hedging Buy Sell

Download Script EA Forex Hedging Buy Sell DISINI!

Jika Anda Ingin Untuk Melihat Dulu Scriptnya Dibawah Ini:

//+——————————————————————+
//| EA FOREX HEDGING BUY SELL.mq4 |
//| KFM |
//| http://kursusforexmadiun.site |
//+——————————————————————+

#property copyright “Copyright © KFM”
#property link “http://kursusforexmadiun.site”

extern double Lots_OpSell = 0.01;
extern double Lots_OpBuy = 0.01;

double PipValue=1;
bool Terminated = false;
string LF = “\n”;
int NDigits = 4;
int ObjCount = 0;
int current = 0;
int varylots[101];
int Counter = 0;

//+——————————————————————+
//| Expert initialization function |
//+——————————————————————+

int init()
{
NDigits = Digits;

if (false) ObjectsDeleteAll();

Comment(“”);
return (0);
}

//+——————————————————————+
//| Expert deinitialization function |
//+——————————————————————+

int deinit()
{
if (false) ObjectsDeleteAll();

return (0);
}

//+——————————————————————+
//| Expert tick function |
//+——————————————————————+

void OnTick()
{
if (Bars < 10)
{
Comment(“”);
return;
}
if (Terminated == true)
{
Comment(“”);
return;
}

HargaMataUangForexBergerak();
return;
}

void HargaMataUangForexBergerak()
{
PipValue = 1;
if (NDigits == 3 || NDigits == 5) PipValue = 10;

TidakAdaTransaksiYangAktif();
InfoAkun();

}

void TidakAdaTransaksiYangAktif()
{
bool exists = false;
for (int i=OrdersTotal()-1; i >= 0; i–)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol())
{
exists = true;
}
}
else
{
Print(“OrderSelect() error – “, ErrorDescription(GetLastError()));
}

if (exists == false)
{

EAMelakukanTransaksiJual();
EAMelakukanTransaksiBeli();

}

}

void EAMelakukanTransaksiJual()
{
double SL = Bid + 0*PipValue*Point;
if (0 == 0) SL = 0;
double TP = Bid – 0*PipValue*Point;
if (0 == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_SELL, Lots_OpSell, Bid, 4, 0, 0, “EA Op Jual”, 2, 0, Red);
else
ticket = OrderSend(Symbol(), OP_SELL, Lots_OpSell, Bid, 4, SL, TP, “EA Op Jual”, 2, 0, Red);
if (ticket > -1)
{
if (true)
{
bool sel = OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Red);
if (ret == false)
Print(“OrderModify() error – “, ErrorDescription(GetLastError()));
}

}
else
{
Print(“OrderSend() error – “, ErrorDescription(GetLastError()));
}
}

void EAMelakukanTransaksiBeli()
{
double SL = Ask – 0*PipValue*Point;
if (0 == 0) SL = 0;
double TP = Ask + 0*PipValue*Point;
if (0 == 0) TP = 0;
int ticket = -1;
if (true)
ticket = OrderSend(Symbol(), OP_BUY, Lots_OpBuy, Ask, 4, 0, 0, “EA Op Beli”, 1, 0, Blue);
else
ticket = OrderSend(Symbol(), OP_BUY, Lots_OpBuy, Ask, 4, SL, TP, “EA Op Beli”, 1, 0, Blue);
if (ticket > -1)
{
if (true)
{
bool sel = OrderSelect(ticket, SELECT_BY_TICKET);
bool ret = OrderModify(OrderTicket(), OrderOpenPrice(), SL, TP, 0, Blue);
if (ret == false)
Print(“OrderModify() error – “, ErrorDescription(GetLastError()));
}

}
else
{
Print(“OrderSend() error – “, ErrorDescription(GetLastError()));
}
}

void InfoAkun()
{
string temp = “EA FOREX HEDGING BUY SELL\nExecuted : ” + Counter + “\n”
+ “Spread: ” + DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD)/PipValue, 2)+ “\n”
+ “————————————————\n”
+ “ACCOUNT INFORMATION:\n”
+ “\n”
+ “Account Name: ” + AccountName()+ “\n”
+ “Account Leverage: ” + DoubleToStr(AccountLeverage(), 0)+ “\n”
+ “Account Balance: ” + DoubleToStr(AccountBalance(), 2)+ “\n”
+ “Account Equity: ” + DoubleToStr(AccountEquity(), 2)+ “\n”
+ “Free Margin: ” + DoubleToStr(AccountFreeMargin(), 2)+ “\n”
+ “Used Margin: ” + DoubleToStr(AccountMargin(), 2)+ “\n”
+ “————————————————\n”;
Comment(temp);
Counter++;

}

//#include <stdlib.mqh>
//#include <WinUser32.mqh>