[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 50

 
artmedia70:
You are wrong in not wanting to study the example above

Sorry, I was writing a reply without seeing yours. Thank you, already studying it.
 
first_may:

Sorry, I wrote back without seeing yours. Thank you, I'm already looking into it.
OK. Hint - you always open on the zero bar. Check the difference between the two.
 
artmedia70:
OK. Tip - always open on the zero bar. Check the difference between the two.

Got what I wanted. Thank you very much :).
 

I wonder if I'm using the Else inappropriately.

GA=MathRound((((price-Q)/Point)-50)/20);if (GA>0) {C=0;A=1;Alert("GA=",GA); }else{GA=0;}  
  
  DA=MathRound((((W-price)/Point)-50)/20);if (DA>0) {C=0;A=1;Alert("DA=",DA); }else{DA=0;}  } }
   

Here, the result seems to be 0 in all cases

 
Roman.:

Was the cleanup successful?


It wasn't much, the C drive was less than % clogged. I have a C drive, my brother has a D drive, and he gave me 5 toys, too.

I have 24.5 GB free out of 297.5 GB on my drive and 19 out of 400 on his D drive.

 
I'm watching it with a program now.

TreeSize Free

So you don't have to click on one property folder at a time, this tray-zee arranges them in ascending order, very convenient.

I'm surprised the games are so big.

 
Dimka-novitsek:

Tell me, I seem to be using the Else wrong somehow.

Here, it seems that the result is 0 in all cases

What prevents me from checking everywhere?

GA=MathRound((((price-Q)/Point)-50)/20);
Alert("Сразу после расчёта GA = ",GA);
if (GA>0) {
   C=0;
   A=1;
   Alert("Больше ли ноля GA = ",GA); 
   }
else {
   GA=0;
   Alert("Оператор else: GA = ",GA);
   } 
  
DA=MathRound((((W-price)/Point)-50)/20);
Alert("Сразу после расчёта DA = ",DA);
if (DA>0) {
   C=0;
   A=1;
   Alert("Больше ли ноля DA = ",DA); 
   }
else {
   DA=0;
   Alert("Оператор else: DA = ",DA);
   } 
Like this...
 
THANK YOU!!!
 

Can you tell me why the design does not work?

      if((_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL >= 0.01) _Lot = 0.01;
 

it's actually like this

//----- удаление локов ----------------------------------------------
   if(_Lot_SELL < _Lot_BUY+_Lot_BUYSTOP && _Lot_BUYSTOP != 0) {
       double _dif = (_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL;
      if((_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL >= 0.01) _Lot = 0.01;
      if((_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL >=  0.1) _Lot =  0.1; 
      if((_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL >=    1) _Lot =    1;   
      if((_Lot_BUY+_Lot_BUYSTOP) - _Lot_SELL >=   10) _Lot =   10; 

Print(_dif +" удаление1 _Lot = "+_Lot+ "_Lot_BUY = "+_Lot_BUY+ "_Lot_BUYSTOP = "+_Lot_BUYSTOP+ "_Lot_SELL = "+_Lot_SELL+ "_Lot_SELLSTOP = "+_Lot_SELLSTOP);
      
      for(_i=OrdersTotal()-1; _i>=0; _i--){  
         OrderSelect(_i, SELECT_BY_POS, MODE_TRADES);
         if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic
         && OrderType() == OP_BUYSTOP && OrderLots() == _Lot){
            close_for_ticket(OrderTicket());
            break;
         }
      }
   }
the print shows _dif = 0.01, but_Lot = 0 ;