Script MQL4 Fungsi Trailing Stop:
void TraillingStopp()
{
for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if(OrderSymbol()!=Symbol()
|| OrderMagicNumber()!=Magic)
continue;
if(OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if((OrderStopLoss()<Bid-Point*TrailingStop)
|| (OrderStopLoss()==0))
{
int ticket = OrderModify(OrderTicket(),OrderOpenPrice(),
Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return;
}
}
}
if(OrderType()==OP_SELL)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if(OrderStopLoss()>(Ask+Point*TrailingStop)
|| (OrderStopLoss()==0))
{
int ticket = OrderModify(OrderTicket(),OrderOpenPrice(),
Ask+Point*TrailingStop,OrderTakeProfit(),0,Yellow);
return;
}
}
}
}
}
Demikian Tutorial Coding MQL4 Fungsi Trailing Stop Untuk Membuat EA Trailing Stop Yang Dapat Kami Bagikan Kepada Anda, Ada pertanyaan? tulis dikolom komentar atau silahkan Anda menghubungi ke kontak kami! Semoga Bermanfaat.
0 comments:
Posting Komentar