Is the advisor suitable for real life? - page 30

 
FOReignEXchange:

I will definitely move on when the time comes.

Good luck to you
 
dentraf:

Good luck to you!

Thank you!
 
FOReignEXchange:

The idea is to trade in a disorderly market with high volatility. All the major currency pairs are like that now. Volatility is high, logic and no systems work. It's chaos. ....
Come on. Everything works as it did before.
 

After today's volatility, I compared the tester results with the real results. Unfortunately significant discrepancies were revealed in such a market.

I took apart the terminal logs by the minute and saw a good thing. All the pips were set exactly at a point. The robot has collected all the profit it could on this sector. But all this profit was wasted, because there was a problem. The problem is solvable, but I cannot understand why this is a problem. That is, we cannot delete unnecessary orders. I think there are two reasons for this.

First: In the log it says this

22:23:30 '882613': delete pending order #26344474 buy stop 4.00 EURUSD at 1.3787 sl: 1.3773 tp: 1.3799
22:23:30 '882613': delete pending order #26344474 buy stop 4.00 EURUSD at 1.3787 sl: 1.3773 tp: 1.3799 failed [Invalid parameters]

22:37:27 '882613': delete pending order #26347980 sell stop 4.00 EURUSD at 1.3668 sl: 1.3682 tp: 1.3656
22:37:27 '882613': delete pending order #26347980 sell stop 4.00 EURUSD at 1.3668 sl: 1.3682 tp: 1.3656 failed [Invalid parameters]
22:37:27 '882613': delete pending order #26347980 sell stop 4.00 EURUSD at 1.3668 sl: 1.3682 tp: 1.3656
22:37:28 '882613': delete pending order #26347980 sell 4.00 EURUSD at 1.3668 sl: 1.3682 tp: 1.3656 failed [Invalid parameters]

These two orders did not get deleted and both of them caused losses. The second order tried to be deleted twice. I do not understand why they are not deleted. Everything is working fine all day long, but here it is not, even if you put RefreshRates() before the delete function.

And secondly:

I think it's a bug. It seems that the terminal doesn't have enough memory or brains. It forgets that we select an order. These are the pieces that do not work.

if (//Тут условие//)
   {
   if (OrderSelect(ticket_buy,SELECT_BY_TICKET)==true)
     {
     if (OrderType()==OP_BUYSTOP && Ask>(OrderOpenPrice()-4*Point)) 
        {
        i=0;
        while (i<10)
              {
              if (i>0) Sleep(500);      
              RefreshRates(); OrderDelete(ticket_buy); 
              err=GetLastError();
              if (err==0)
                 {
                 ticket_buy=0; return;
                 }
              i++;
              }
        }
     }
   }

All the conditions are satisfied, I checked them with comments. At the stage of checking the order type everything gets stuck. The function of deletion is not used any further. Although they should, since all the conditions are fulfilled and all the comments check them. This is not the first time I noticed that when we select an order and then enter any parameters of the selected order into the condition, we sometimes fail to correctly read this condition. The greater the number of order parameters in the condition, the more often the condition fails. In this case, we have OrderType() and OrderOpenPrice() parameters. I think many of us have noticed this strange thing. How can we get rid of it? Or maybe the problem lies in something else? I forgot to say, no errors in the log in this case, just that the condition is not fulfilled, although it should.

I think there may not be a problem in the other, because the condition is not fulfilled rarely, usually everything works fine in this part, but sometimes it does not work and brings losses.

Don't judge harshly for such illiterate code, I am self taught.

Why exactly the removal of orders occurs with such problems? My orders are placed exactly as needed and robot collects all profits. But everything is getting messed up because we cannot delete unnecessary orders! If you get rid of these problems, everything will work as it should!

 
FOReignEXchange:

Judging by the log, the code just didn't get there in time.

That is, the deletion was already in progress when the order was triggered.

 
TheXpert:

Judging by the log, the code just didn't get there in time.

That is, the deletion was already in progress when the order was triggered.


And the pending orders are set at exactly the same time and are not missed. Why is there a problem with deletion? Especially in the second case he tried to delete it twice.
 
FOReignEXchange:
And the pending orders are set at exactly the same time and are not missed. Why is there a problem with the deletion? The more so that in the second case he tried to delete it twice.

Look carefully -- this is the second time you are trying to delete an executed order, not a limit order.

And for the setting there are Stop Levels and for removal there are only Frees-Levels.

 
TheXpert:

Look carefully -- this is the second time you are trying to delete an executed order, not a limit order.

And there are stoplines to place an order, but only freesliders to delete, and that's if there are any.


Everything is clear with the first case. Thank you very much! Are you familiar with the second one? It is more important because it happens more often and causes more losses. Everything is OK in terms of conditions. And it's not the market speed and there is a lot of time to remove it. The condition is just not fulfilled, although it should be.
 
FOReignEXchange:

Are you familiar with the second one by any chance? The condition just doesn't work, although it should.

Perhaps this condition sometimes fails, namely its right-hand side

if (OrderType()==OP_BUYSTOP && Ask>(OrderOpenPrice()-4*Point))

Normalise Ask before comparing.

 
OnGoing:

Perhaps this condition sometimes fails

Normalise the Ask before comparing.


Like this?

NormalizeDouble(Ask,Digits)>(OrderOpenPrice()-4*Point))