Selamat pagi teman2 soehoe sekalian
saya mau tanya ttg code yang saya buat
apakah sudah tepat fungsi lot exponent yang saya buat?
saya mau tanya ttg code yang saya buat
apakah sudah tepat fungsi lot exponent yang saya buat?
Code:
double LotSize() {
int nDig;
double lotSize, minLot, maxLot;
// mengambil data lot sebelumnya
if (OrdersTotal()>0) {
for (int i = 0; i < OrdersTotal(); i++) {
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicNum) {
if (tgl < OrderOpenTime()) {
startingLot = OrderLots();
tgl = OrderOpenTime();
}
}
}
} else {
lotMultiplier = 1;
}
// menentukan lot sekarang
minLot = MarketInfo(Symbol(), MODE_MINLOT);
maxLot = MarketInfo(Symbol(), MODE_MAXLOT);
if (minLot == 0.01) nDig = 2;
if (minLot == 0.1) nDig = 1;
lotSize = NormalizeDouble(lotMultiplier*startingLot, nDig);
if (lotSize < minLot) lotSize = minLot;
if (lotSize > maxLot) lotSize = maxLot;
return(lotSize);
}