[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 124

 

Good morning! Have a nice day everyone! Here's the most amazing phenomenon - when the EA is switched on, the platform disappears from view completely, along with the shortcut at the very bottom of the screen!!! When testing too! I actually didn't think that this can be achieved by MQL4!!!!! Nevertheless, it does happen. I don't know yet if it crashes or rather passes out, what amazes me is the phenomenon itself, it's amazing, inexplicable and mysterious as

I have a feedback loop on my platform and I can't get a response from it. I actually achieve this on my platform in a completely different way

//+------------------------------------------------------------------+
//|                                                          ІУЕ.mq4 |
//|                      Copyright © 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property copyright "Copyright © 2012, WWW.TRADING-GO.RU ."
#property link      "http://WWW.TRADING-GO.RU"
extern int     Correlyciya = 50   ;
extern int     TakeProfit = 300  ;
extern double  Lot        = 0.1;
extern double  Procent    =1.3 ;
extern bool    Martin     = true;
extern int     Slip=2;
extern int Magic=1;
extern int Orderov=6;
int X,dolivka;
int start () { 
//---------------------------------------------------------------------------------------------------

for(int i=OrdersTotal();i>0;i--){ // откроем цикл пирибора ордеров
 OrderSelect(i-1,SELECT_BY_POS );           
 //Alert ("OrderType( )", OrderType( ));
 if(OrderSymbol()==Symbol()&&OrderMagicNumber( )==Magic){   //если ордер на этом инструменте
if(OrderType( )==OP_SELL){X++;}
if(OrderType( )==OP_BUY){X++;}}}                          //сосчитаем сколько всего ордиров бай и селл
X=X-dolivka;  // Alert ("X+++", X," dolivka ",dolivka);
Comment("Orderov  ", X );

if (X<Orderov  ){//Alert ("Price", Price);  


//---------------------------------------------------------------------------------------------------

double opB=2000; double opS=0; double orderProfitbuy=0; double Sum_Profitbuy=0 ; double orderProfitsel;  double Sum_Profitsel ; int orderType ;
double LotB=Lot;
double LotS=Lot;
   int total=OrdersTotal();
   int b=0,s=0, n=0;
   for ( i=total-1; i>=0; i--)
   {if(OrderSelect(i, SELECT_BY_POS))
   {if(OrderSymbol()==Symbol()      )
   {n++;    
      if (OrderType()==OP_BUY &&OrderMagicNumber()==Magic)
      {b++; 
      LotB=OrderLots();      
      int tikketB=OrderTicket(); double ProfitB=OrderTakeProfit(); double openB=OrderOpenPrice();
      if (openB<opB)
      {opB=openB;}
      }
//---------------------------------      
      if (OrderType()==OP_SELL&&OrderMagicNumber()==Magic)
      {s++;  
      LotS=OrderLots(); 
      int tikketS=OrderTicket(); double ProfitS=OrderTakeProfit(); double openS=OrderOpenPrice();
      if (openS>opS)
      {opS=openS;}
      }
     }}}
double max = NormalizeDouble(iHigh(Symbol(),1440,0),Digits);
double min = NormalizeDouble(iLow (Symbol(),1440,0),Digits);
double opp  = NormalizeDouble(iOpen(Symbol(),1440,0),Digits);
double cl  = NormalizeDouble(iClose(Symbol(),1440,0),Digits);
//--------------
if (cl>min)
{
double x =NormalizeDouble( cl*100/min-100,2);
}
//--------------
if (cl<max)
{
double y = NormalizeDouble(cl*100/max-100,2);
}

Comment("====WWW.TRADING-GO.RU====");
double dis   =NormalizeDouble(TakeProfit*Point,Digits);
double spred =NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD)*Point,Digits);
double  CORR   =NormalizeDouble(Correlyciya      *        Point ,Digits)      ;
if (Martin == true)
{
if  (n>=1){for (int P=100; P>=0; P--){
if  (n==P&&n>=1) {LotB=LotB*P;}
if  (n==P&&n>=1) {LotS=LotS*P;}}}
}
if (Martin == false)
{
if  (b==1||s==1) {LotB=LotS*1;LotS=LotB*1;}
if  (b==2||s==2) {LotS=LotS*1;LotB=LotB*1;}
if  (b==3||s==3) {LotS=LotS*1;LotB=LotB*1;}
 
if  (b==4||s==4) {LotB=LotS*3;LotS=LotB*3;}
if  (b==5||s==5) {LotS=LotS*3;LotB=LotB*3;}
if  (b==6||s==6) {LotS=LotS*3;LotB=LotB*3;}
 
if  (b==7||s==7) {LotB=LotS*6;LotS=LotB*6;}
if  (b==8||s==8) {LotS=LotS*6;LotB=LotB*6;}
if  (b==9||s==9) {LotS=LotS*6;LotB=LotB*6;}
}
if ((b==0&&Procent*(-1)<=y&&s==0&&Close[1]>Open[1])||(Ask<opB-dis-spred&&b>=1&&s==0)) { OrderSend(Symbol(),OP_BUY ,LotB,Ask,Slip,0,0,"Советник БАЙ №2",Magic,0,Green); }
if ((s==0&&Procent     >=x&&b==0&&Close[1]<Open[1])||(Bid>opS+dis-spred&&s>=1&&b==0)) { OrderSend(Symbol(),OP_SELL,LotS,Bid,Slip,0,0,"Советник СЕЛ №2",Magic,0,Green); }
//---------------------------------//---------------------------------//---------------------------------//---------------------------------
double TPB= NormalizeDouble (openB+spred+TakeProfit*Point,Digits);
double TPS= NormalizeDouble (openS+spred-TakeProfit*Point,Digits);
if (ProfitB==0&&b>=1) { OrderModify(tikketB,openB,  OrderStopLoss(),TPB, 0,Blue); }
if (ProfitS==0&&s>=1) { OrderModify(tikketS,openS,  OrderStopLoss(),TPS, 0,Blue); }
//---------------------------------//---------------------------------//---------------------------------//---------------------------------
 
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
     double nn=0, bb=0;                                        
   for (int ui=total-1; ui>=0; ui--)                                 
   {
    if(OrderSelect(ui, SELECT_BY_POS))                          
    {
    if(OrderSymbol()==Symbol())                     
     {
      if (OrderType()==OP_BUY&&OrderMagicNumber()==Magic)
      {
     double op=OrderOpenPrice();
     double llot=OrderLots();
     double itog=op*llot;
      bb=bb+itog;
      nn=nn+llot;
      double factb = bb/nn;
      }
      }
      }
      }
     double nnn=0, bbb=0;                                        
   for (int usi=total-1; usi>=0; usi--)                                 
   {
    if(OrderSelect(usi, SELECT_BY_POS))                          
    {
    if(OrderSymbol()==Symbol())                          
     {
      if (OrderType()==OP_SELL&&OrderMagicNumber()==Magic)
      {
     double ops=OrderOpenPrice();
     double llots=OrderLots();
     double itogs=ops*llots;
      bbb=bbb+itogs;
      nnn=nnn+llots;
      double facts = bbb/nnn;
      }
      }
      }
      }
 
   for (int uui=total-1; uui>=0; uui--)                                 
   {
    if(OrderSelect(uui, SELECT_BY_POS))                          
    {
    if(OrderSymbol()==Symbol())                        
     {
     if (b>=2&&OrderType()==OP_BUY&&OrderMagicNumber()==Magic)
     {
     OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),factb+CORR,0,Blue);
     } 
     if (s>=2&&OrderType()==OP_SELL&&OrderMagicNumber()==Magic)
     {
     OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),facts-CORR,0,Blue);
     }
     }
     }
     }
     //---------------------------------------------------------------------------------------------------
     //---------------------------------------------------------------------------------------------------
     //---------------------------------------------------------------------------------------------------
 
 
//-----------------------------------------------------------------------------------------------------
double prib = 0;   int zzz=0;
   for (int uuui=total-1; uuui>=0; uuui--)                                 
   {if(OrderSelect(uuui, SELECT_BY_POS))                          
   {if(OrderSymbol()!=Symbol())continue;                          
   {double  pri=OrderProfit();
    prib=prib+pri;
    zzz++;}}}
Comment("Прибыль пары===",prib,"===Ордеров открыто===",zzz,"==============http://traders-union.ru/index.php?ref=25250",
"\n","ВОЗВРАТ 60% СПРЕДА, ЮРИДИЧЕСКАЯ ЗАЩИТА ОТ НЕЧЕСТНЫХ БРОКЕРОВ, ДОХОД ОТ ПАРТНЕРОВ",
"\n","                                             http://traders-union.ru/index.php?ref=25250"
 
 
 
 
 
);
 
 
 
 
 
 
 }
 
 
 
 
 
return(0);   }

by hiding it from my dad. I attach the code letter by letter.

 
If the terminal.exe process disappears from the task manager, then the terminal is definitely not "hidden" but rather crashed due to an EA glitch.
 
Well, of course, I just haven't looked there yet. I'll take a look. Thanks, really. Actually, it's surprising, when there are glitches, the software usually just doesn't respond temporarily.
 

Daddy forbids gambling?))) nunu))

It's hard to tell from the code what exactly causes the terminal to crash. At first glance I do not see anything criminal, except that multiple multiplication by 100 in the martin section may lead to an overflow. Try to comment out different parts of code, maybe you'll find out where the dog is buried.

 
Dimka-novitsek:

Good morning! Have a nice day everyone! Here's the most amazing phenomenon - when the EA is switched on, the platform disappears from view completely, along with the shortcut at the very bottom of the screen!!! When testing too! I actually did not think that this can be achieved by means of MQL4!!!!! Nevertheless, it does happen. I don't know yet if it crashes or rather passes out, what amazes me is the phenomenon itself, it's amazing, inexplicable and mysterious as

I have a feedback loop on my platform and I can't get a response from it. I actually achieve this on my platform in a completely different way

by hiding it from my dad. I attach the code letter by letter.


The terminal is collapsing with shame... because it can't stand that kind of spelling, no way. :)
 
Dimka-novitsek:
Well, of course, I just haven't looked there yet. I'll have a look. Thanks, really. Actually, surprisingly, when it glitches, it usually just doesn't respond temporarily.


I've got owls downloaded. But I removed the advertisement, no one reads it in the comments anyway :o).

And it would be a good idea to tidy up brackets, especially curly ones, in blocks, because it's not so easy to read code.

 
Hiding!!!! I'm shocked myself, I was almost 100% sure it was knocking out! I didn't get it myself, I'm going to look again, maybe I didn't get it! Micha is my brother.
 
So it looks like a similar program to TrayIT! is messing around, go into the settings and remove the terminal from the hidden ones ))))
 
evillive:
So a program like Send_to_Tray or similar is messing around, go into the settings and remove the terminal from the hidden ones ))))
not necessarily. sometimes the terminal crashes (the window disappears) but the process remains and you can only finish it off
 
At first glance I don't see anything criminal. That's exactly my point!!! My dad doesn't forbid gambling, I hide my income from him, and in general. And he's already playing on his own, I'm programming him, because I once spent a month explaining the concept of pirimen, and not very much..... It's his platform that gets chopped up!
Reason: