EA N7S_AO_772012 - page 17

 

Found a mistake in the trawl call function.

It was inattentive.

Correction

void trl(){
      total= OrdersTotal(); spread = MarketInfo(Symbol(), MODE_SPREAD);
  for(  i = total - 1; i >= 0; i--) 
     { OrderSelect( i, SELECT_BY_POS, MODE_TRADES); MN=OrderMagicNumber();
       if(OrderSymbol() == Symbol() && MN>= 772012000 && MN<=772012199) 
         {  if ( MN==772012055) { sl = slx; tp = tpx* slx; mn= mnx1;}
            if ( MN==772012155) { sl = sly; tp = tpy* sly; mn= mny1;}
            if ( MN==772012011) { sl = slX; tp = tpX* slX; mn= mnX1;}
            if ( MN==772012111) { sl = slY; tp = tpY* slY; mn= mnY1;}
         
           int prevticket = OrderTicket();
if ( UseUdavkaTrail == false)
    {       if(OrderType() == OP_BUY) 
             {if(DayOfWeek( ) == 5 && Hour( ) >=22)  { OrderClose( prevticket,OrderLots( ) ,Bid,3,Black);} 
              if(Bid > (OrderStopLoss() + ( sl * 2  + spread) * Point)) 
                 { if( BTS()< 0) { OrderClose( prevticket,OrderLots( ) ,Bid,3,Black);} 
                   else { OrderModify(OrderTicket(), OrderOpenPrice(), Bid - sl * Point,0, 0, Blue);}}} 
           else {if(DayOfWeek( ) == 5 && Hour( ) >=22) { OrderClose( prevticket,OrderLots( ) ,Ask,3,Blue);} 
                  if(Ask < (OrderStopLoss() - ( sl * 2 + spread) * Point)) 
                     {if( BTS() > 0) 
                           { OrderClose( prevticket,OrderLots( ) ,Ask,3,Blue);} 
                     else{ OrderModify(OrderTicket(), OrderOpenPrice(), Ask + sl * Point, 0, 0, Blue);}}}
     }
     else 
     
    {       if(OrderType() == OP_BUY) 
             {if(DayOfWeek( ) == 5 && Hour( ) >=22)  { OrderClose( prevticket,OrderLots( ) ,Bid,3,Black);} 
              if(Bid > (OrderStopLoss() + ( sl * 2  + spread) * Point) || true) 
                 { if( BTS()< 0) { OrderClose( prevticket,OrderLots( ) ,Bid,3,Black);} 
                  else { TrailingUdavka(OrderTicket(), sl, sl+ spread, MathRound( sl/2), MathRound( sl+ sl/2), MathRound( sl/3));}}} 
           else {if(DayOfWeek( ) == 5 && Hour( ) >=22) { OrderClose( prevticket,OrderLots( ) ,Ask,3,Blue);} 
                  if(Ask < (OrderStopLoss() - ( sl * 2 + spread) * Point) || true) 
                     {if( BTS() > 0) 
                           { OrderClose( prevticket,OrderLots( ) ,Ask,3,Blue);} 
                     else{ TrailingUdavka(OrderTicket(), sl, sl+ spread, MathRound( sl/2), MathRound( sl+ sl/2), MathRound( sl/3));}}}
     }
          return(0);}}}
 
If it's not too much trouble, attach a file, I'm too lazy to fix it)
 
mpeugep >> :
If it is not difficult - attach a file, I am too lazy to fix it).

>> Please.

Although I don't really see anything difficult in fixing what you need by hand.

Files:
with_tral.mq4  16 kb
 

Hi!

I'm afraid that on 5-digit DTs the slip of 3 points is just an impossible parameter, I suggest to make it an external variable in the EA release :)

 

The third day is over.

Minus 500p on equity...

We'll bear it easily - it's not real after all. ;)

 
Casper >> :

You're welcome.

Although I don't really see what's so difficult about hand fixing what you need.

Yeah, I already did.

 

The current picture is as follows (trading 0.01 lots):

Not as happy as in the beginning, but still in the plus side...

 

Equity is still minus 500p.

Stabilised :)

 

I have the following picture at the moment:


 
mpeugep писал(а) >>

I have the following picture at the moment:

Good afternoon!

Can you please post the sets, period, currency pair and period for this chart....

Because I have no way to simulate even in the tester the charts that are present in this thread...

Either my hands are crooked or something else....

Alpari broker demo