• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

Question Jumlah Lot Multiplier Bertahap

unmetered.co.id

New Member
Credits
0
Salam profit untuk semua...
Saya mempunyai EA dengan menu multiplier, namun format pengambilan lot memang secara berurutan :
0.01, 0.02, 0.04, 0.08, 0.16, dst....

Pertanyaan saya :
Bagaimana kita modifikasi agar pengambilan lot bisa secara bertahap, misalnya :

Sesi Pertama :
0.01, 0.01, 0.01, 0.01,

Sesi Kedua :
0.02, 0.02, 0.02, 0.02,

Sesi Ketiga :
0.04, 0.04, 0.04, 0.04,

Sesi Ke empat :
0.04, 0.08, 0.016, dst......

Adapun kode robot EA sebelumnya :

General Parameter :
double Lot_Awal,MinLots,MaxLots;
double OpenOrders,OpenOrdersbuy,OpenOrderssell,hrgOP_BUY,hrgOP_SELL,LotOP_Last,LOT_OPsell,LOT_OPbuy;


Lot_Awal = NormalizeDouble (Lots,DigitLot);

TAKE PROFIT
if(TakeProfitDollar!=0 && ProfitTotal() >= TakeProfitDollar )
{
CloseMultyple();
quikclose();
quik_close();
lot_marti_Buy=Lot_Awal;
lot_marti_Sell=Lot_Awal;
}
stopMoney=-LossProfitDollar;


if(LossProfitDollar !=0 && ProfitInMoneyBuy() <= stopMoney ){

quikclose();
quik_close();
lot_marti_Buy=Lot_Awal;
lot_marti_Sell=Lot_Awal;
}



Open Order :

openord();
if(OpenOrdersbuy == 0 && timeOPBuy != iTime(Symbol(),0,0) && op_buy == 1 )
{
if(ProfitInMoneySell() > 0 && OpenOrdersbuy == 0){
quikclose_SELL();
quikcloseSELL();
}
lot_marti_Buy=NormalizeDouble((Lot_Awal),DigitLot);
OpenBuy(MagicNumber);
timeOPBuy = iTime(Symbol(),0,0);
timeOPBuy_Marting = iTime(Symbol(),0,0);
}
openord();
if(OpenOrderssell == 0 && timeOPSell != iTime(Symbol(),0,0) && op_sell == 1)
{
if(ProfitInMoneyBuy() > 0 && OpenOrderssell == 0){
quikclose_BUY();
quikcloseBUY();
}
lot_marti_Sell=NormalizeDouble((Lot_Awal),DigitLot);
OpenSell(MagicNumber);
timeOPSell = iTime(Symbol(),0,0);
timeOPSell_Marting = iTime(Symbol(),0,0);
}
openord();
if(OpenOrdersbuy > 0 && timeOPBuy != iTime(Symbol(),0,0) && op_buy == 1 )
{
if(ProfitInMoneySell() > 0 && OpenOrdersbuy == 0){
quikclose_SELL();
quikcloseSELL();
}
lot_marti_Buy=NormalizeDouble((Lot_Awal*MultiLot),DigitLot);
OpenBuy(MagicNumber);
timeOPBuy = iTime(Symbol(),0,0);
timeOPBuy_Marting = iTime(Symbol(),0,0);
}
openord();
if(OpenOrderssell > 0 && timeOPSell != iTime(Symbol(),0,0) && op_sell == 1)
{
if(ProfitInMoneyBuy() > 0 && OpenOrderssell == 0){
quikclose_BUY();
quikcloseBUY();
}
lot_marti_Sell=NormalizeDouble((LotOP_Last*MultiLot),DigitLot);
OpenSell(MagicNumber);
timeOPSell = iTime(Symbol(),0,0);
timeOPSell_Marting = iTime(Symbol(),0,0);
}

Bagaimana saya harus menambah kode nya dan di letakkan dimana ??
Terima kasih....
 
Kalau ane mah gak paham untuk merubah ea dan cara kerjanya
yang ahli membuat code ea ini yang bisa merubah setingan lot
 
Klo lot 0,01, 0,02, 0,04, 0,08, 0,16 dst. Berarti multipplier lot nya = 2 (disitu kata2 codenya = lot_marti_Buy=Normalize double.........dst. berarti lotnya dobel berganda = x 2)
Cb aja minta tolong tmn2 coder biar bisa qt input manual multiplier lotnya. Klo bro unmetered.co.id pgn lot segitu trs mgkn agak susah (yang bs tmn2 coder) kebanyakan disini cukup oprek input settingan EA ganti angka multiplier lotnya saja. Ini sy buatkan hitung2an lot dg bbrp aangka multiplier
d361e02dc9299058c86f166d05f928a0.jpg


Sent from SoeHoe.ID mobile apps
 
Cb tny moderator nya bro... atau bro autoprofit yg pinter coder. Biar dibuatin n depannya diberi extern, biar bisa tampil diinputan n bisa kita rubah2 sendiri multipliernya...

Sent from SoeHoe.ID mobile apps
 
Klo lot 0,01, 0,02, 0,04, 0,08, 0,16 dst. Berarti multipplier lot nya = 2 (disitu kata2 codenya = lot_marti_Buy=Normalize double.........dst. berarti lotnya dobel berganda = x 2)
Cb aja minta tolong tmn2 coder biar bisa qt input manual multiplier lotnya. Klo bro unmetered.co.id pgn lot segitu trs mgkn agak susah (yang bs tmn2 coder) kebanyakan disini cukup oprek input settingan EA ganti angka multiplier lotnya saja. Ini sy buatkan hitung2an lot dg bbrp aangka multiplier
d361e02dc9299058c86f166d05f928a0.jpg


Sent from SoeHoe.ID mobile apps
Untuk multiplier kalau saya isi 1.2, Lot yang muncul mulai Lot Pertama sampai seterusnya tetap saja masih 0.01.
Jadi minimal multiplier yang bisa saya isi 1.5 baru ada perubahan, 0.01, 0,01, 0,02, 0.04, 0.08 ( Lot 0.01 jadi 2 kali, baik Sel / Buy )

Dalam Kode EA kami cuma bisa 2 tingkat saja, jika kami lihat dari bentuk kodenya
Yang Pertama:
Lot_Pertama=NormalizeDouble((Lot_Awal),Digit); // Lot Awal : 0.01
Yang Kedua :
Lot_Kedua/Marti=NormalizeDouble((LotOP_Last*Multiplier),Digit); // Lot Terakhir di kali Multiplier

Kemudian saya tambahkan kode yang sama dibawah kode Kedua, agar jadi 3 tingkat :

Yang Pertama:

Lot_Pertama=NormalizeDouble((Lot_Awal),Digit); // Lot Awal : 0.01
Yang Kedua :
Lot_Kedua=NormalizeDouble((Lot_Awal*Multiplier),Digit); //Lot Awal di kali Multiplier 1

Yang Ketiga :
Lot_Ketiga=NormalizeDouble((LotOP_Last*Multiplier),Digit); // Lot Terakhir di kali Multiplier 2


Namun untuk kode Yang Ketiga kok tidak dibaca robot EA ya..., robot hanya membaca "Yang Pertama" dan "Yang Kedua".
Cuma itu saja problem saya


 
Coba kirim pesan ke bro AutoProfit he is a good coder

Sent from SoeHoe.ID mobile apps
Thanks sdh tag saya :)

NormalizeDouble bukan utk double kan lot, tetapi adalah fungsi mql utk melakukan pembulatan (normalisasi) bilangan dengan type double.
untuk besar lot multiplier, tergantung besarnya multiplier factor.
contoh multiplier factor 1.5, bearti setiap kelipatan lot akan dinaikan sebesar 1.5x lipat.
kalo multiplier factor 2.0, berarti setiap kelipatan lot sebesar 2x lipat dari lot sebelumnya.

Supaya EA bisa atua membagi menjadi 4 sesi,
bisa gunakan fungsi MathFloor();
saya kasi contoh code lah...

Code:
double getMultiplier(double MultiplierFaxtor, int tOrders){
   double vol = 0.0;
   
   tOrders -= 12;
   vol   = 0.04 * MathPow(MultiplierFaxtor, tOrders);
   vol   = NormalizeDouble(vol, 2);
   
   return vol;
}

double GetLotSize(int i){
   //--- buat fungsi utk cari total order ya, ini saya contoh total diambil dari nilai variabel i.
   double totalOrders= i;  //cari total order nya ya.....
   
   double   MultiplierFaxtor = 2.0;
   double   lot   = 0.0;
   int sesi = MathFloor(totalOrders/4);
   switch (sesi){
      case 0: lot = 0.01; break;
      case 1: lot = 0.02; break;
      case 2: lot = 0.04; break;
      case 3: lot = getMultiplier(MultiplierFaxtor, totalOrders); break;
   }
   
   return lot;
}


int OnInit()
{
   
   double lot = 0.0;
   string str = "";
   for (int i = 0; i<16; i++){
      str += ("Order #"+ i+ " : Lot: "+ GetLotSize(i)+ "\n");
   }
   Comment(str);

}
 
Untuk multiplier kalau saya isi 1.2, Lot yang muncul mulai Lot Pertama sampai seterusnya tetap saja masih 0.01.
Jadi minimal multiplier yang bisa saya isi 1.5 baru ada perubahan, 0.01, 0,01, 0,02, 0.04, 0.08 ( Lot 0.01 jadi 2 kali, baik Sel / Buy )

Dalam Kode EA kami cuma bisa 2 tingkat saja, jika kami lihat dari bentuk kodenya
Yang Pertama:
Lot_Pertama=NormalizeDouble((Lot_Awal),Digit); // Lot Awal : 0.01
Yang Kedua :
Lot_Kedua/Marti=NormalizeDouble((LotOP_Last*Multiplier),Digit); // Lot Terakhir di kali Multiplier

Kemudian saya tambahkan kode yang sama dibawah kode Kedua, agar jadi 3 tingkat :

Yang Pertama:

Lot_Pertama=NormalizeDouble((Lot_Awal),Digit); // Lot Awal : 0.01
Yang Kedua :
Lot_Kedua=NormalizeDouble((Lot_Awal*Multiplier),Digit); //Lot Awal di kali Multiplier 1

Yang Ketiga :
Lot_Ketiga=NormalizeDouble((LotOP_Last*Multiplier),Digit); // Lot Terakhir di kali Multiplier 2


Namun untuk kode Yang Ketiga kok tidak dibaca robot EA ya..., robot hanya membaca "Yang Pertama" dan "Yang Kedua".
Cuma itu saja problem saya


Mau yg bisa multiplenya 1.2 ya? Tapi maaf jangan lewat private nessage ya...
 
Ini function agar multiple bisa 1.2
Code:
double MultipleLot(int magic,double multiple,int type=-1){
  double r=0;
  int c=OrdersTotal();
  for(int i=0;i<=c;i++){
     if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){continue;}
     if(OrderSymbol()!=symbol){continue;}
     if(OrderMagicNumber()!=magic){continue;}
     if(OrderType()!=OP_BUY && OrderType()!=OP_SELL){continue;}
     if(type!=-1){
       if(type!=OrderType()){continue;}}
     if(r==0){r=OrderLots();}
     r*=multiple;}
  return(r);}
 
Ini function agar multiple bisa 1.2
Code:
double MultipleLot(int magic,double multiple,int type=-1){
  double r=0;
  int c=OrdersTotal();
  for(int i=0;i<=c;i++){
     if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){continue;}
     if(OrderSymbol()!=symbol){continue;}
     if(OrderMagicNumber()!=magic){continue;}
     if(OrderType()!=OP_BUY && OrderType()!=OP_SELL){continue;}
     if(type!=-1){
       if(type!=OrderType()){continue;}}
     if(r==0){r=OrderLots();}
     r*=multiple;}
  return(r);}

Mohon mohon pencerhn ny, contoh peletkn script di ea sepert apa ya mas boleh minta contoh nya biar lebih jelas ny...
 
Ini function agar multiple bisa 1.2
Code:
double MultipleLot(int magic,double multiple,int type=-1){
  double r=0;
  int c=OrdersTotal();
  for(int i=0;i<=c;i++){
     if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){continue;}
     if(OrderSymbol()!=symbol){continue;}
     if(OrderMagicNumber()!=magic){continue;}
     if(OrderType()!=OP_BUY && OrderType()!=OP_SELL){continue;}
     if(type!=-1){
       if(type!=OrderType()){continue;}}
     if(r==0){r=OrderLots();}
     r*=multiple;}
  return(r);}

simple,
ganti aja

MultiplierFaxtor = 1.2;

AutoProfit keren bangat code nya..
 
Klo lot 0,01, 0,02, 0,04, 0,08, 0,16 dst. Berarti multipplier lot nya = 2 (disitu kata2 codenya = lot_marti_Buy=Normalize double.........dst. berarti lotnya dobel berganda = x 2)
Cb aja minta tolong tmn2 coder biar bisa qt input manual multiplier lotnya. Klo bro unmetered.co.id pgn lot segitu trs mgkn agak susah (yang bs tmn2 coder) kebanyakan disini cukup oprek input settingan EA ganti angka multiplier lotnya saja. Ini sy buatkan hitung2an lot dg bbrp aangka multiplier
d361e02dc9299058c86f166d05f928a0.jpg


Sent from SoeHoe.ID mobile apps

mba bisa minta rumus excel nya ? terima kasih
 
Back
Top