Categories
MQL4 Trailing Stop

Coding Fungsi Trailing Stop

Coding Fungsi Trailing Stop, Belajar Bahasa Pemrograman MetaQuotes Language Editor, MQL4 Trailing Stop. Kegunaannya Untuk Mengunci & Menggeser Profit.

Coding Fungsi Trailing Stop

Besarkan Gambar MQL4 Trailing Stop!

SCRIPT CODING MQL4 FUNGSI TRAILING STOP:

void TrailingStops()
{int mode=0;
for(int i=0; i<OrdersTotal(); i++)
{
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(OrderSymbol()!=Symbol() || OrderMagicNumber()!=MagicNumber ) continue;
if(OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>Piips*TrailingStop)
{
if((OrderStopLoss()<Bid-Piips*TrailingStop) || (OrderStopLoss()==0))
{
mode= OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Piips*TrailingStop,OrderTakeProfit(),0,Aqua);
}
}
}
if(OrderType()==OP_SELL)
{
if((OrderOpenPrice()-Ask)>(Piips*TrailingStop))
{
if(OrderStopLoss()>(Ask+Piips*TrailingStop) || (OrderStopLoss()==0))
{
mode=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Piips*TrailingStop,OrderTakeProfit(),0,Yellow);
}
}
}
}
}

Info: Kursus Membuat Robot Forex!

Ada Pertanyaan Terkait Coding Fungsi Trailing Stop? tulisakan dikolom comment atau silahkan Anda langsung menghubungi ke kontak kami!