Professional Documents
Culture Documents
Martingale mq4
Martingale mq4
001;
input int takeProfit = 77;
input int stopLoss = 20;
input double martingaleMultiplier = 2.2;
return 0;
}
if (tradeType == OP_SELL) {
stopLossLevel = iClose(Symbol(), PERIOD_D1, 0) + stopLoss * Point;
takeProfitLevel = iClose(Symbol(), PERIOD_D1, 0) - takeProfit * Point;
} else if (tradeType == OP_BUY) {
stopLossLevel = iClose(Symbol(), PERIOD_D1, 0) - stopLoss * Point;
takeProfitLevel = iClose(Symbol(), PERIOD_D1, 0) + takeProfit * Point;
}
// Buka posisi
int ticket = OrderSend(Symbol(), tradeType, tradeLotSize, iClose(Symbol(),
PERIOD_D1, 0), 3, stopLossLevel, takeProfitLevel, "Trading EA", 0, 0, Green);
if (consecutiveLosses > 1) {
lotSize *= martingaleMultiplier;
} else {
lotSize = initialLotSize;
}