Trading spreads on currencies. Spreader 2 - page 14

 
Reshetov >>:


...Если поставить малый размер входному параметру profit, то депо будет слито очень быстро.



Can you tell me how to determine the optimum size of the profit parameter?

Maybe depending on the size of the deposit? But how exactly?

 
By the way, in less than 24 hours on the demo +10% of the deposit.
 

there is an error in the code.

We need to correct a piece of it:

   double secondlots = 0;

   for (int i = 0; i < total; i++) {
      OrderSelect( i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         currentticket = OrderTicket();
         currentprofit = currentprofit + OrderProfit();
         currenttype = OrderType();
      }
      if (OrderSymbol() == seconds_instrument) {
         secondticket = OrderTicket();
         secondtype = OrderType();
         currentprofit = currentprofit + OrderProfit();
         secondlots = OrderLots();
      }
   }


   if (( secondticket < 0) && ( currentticket >= 0)) {
      Comment("Try close positon for " + Symbol());
      if ( currenttype == OP_BUY) {
         if (OrderClose( currentticket, lots, Bid, 2, Blue)) {
            openbarspriceonly = true;
         }
         return(0);
      } else {
         if (OrderClose( currentticket, lots, Ask, 2, Red)) {
            openbarspriceonly = true;
         }
         return(0);
      }
   }

to

   double currentlots = 0;
   double secondlots = 0;

   for (int i = 0; i < total; i++) {
      OrderSelect( i, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol()) {
         currentticket = OrderTicket();
         currentprofit = currentprofit + OrderProfit();
         currenttype = OrderType();
         currentlots = OrderLots();
      }
      if (OrderSymbol() == seconds_instrument) {
         secondticket = OrderTicket();
         secondtype = OrderType();
         currentprofit = currentprofit + OrderProfit();
         secondlots = OrderLots();
      }
   }


   if (( secondticket < 0) && ( currentticket >= 0)) {
      Comment("Try close positon for " + Symbol());
      if ( currenttype == OP_BUY) {
         if (OrderClose( currentticket, currentlots, Bid, 2, Blue)) {
            openbarspriceonly = true;
         }
         return(0);
      } else {
         if (OrderClose( currentticket, currentlots, Ask, 2, Red)) {
            openbarspriceonly = true;
         }
         return(0);
      }
   }
 
vis_inet >>:
Кстати, меньше чем за сутки на демо +10% от депо.

List of trades in studio!

I've had -20% Depo for 2 days, I'm testing version 3 today, so far in minus.

 
David177 >>:

Список сделок в студию!

У меня за 2 суток -20%депо, сегодня тестирую 3-ю версию, пока в общем минуса.

Here, the balance was 1054 roughly before testing started:

Settings: lot 0.1, profit 25.

 

Yuri, please make the second version to open the lot sizes specified in the variables for both pairs - equal. Thank you.

 
and that... ahem... And add magik to the third version.
 
The third one is really losing it.
 
dimasik >>:

Юрий, сделайте пожалуйста во второй версии чтобы открывал размеры лота, заданные в переменных для обеих пар - равнозначные. Спасибо.


Or that the lot size for the second pair can be specified in the settings.