Errors, bugs, questions - page 2224

 
fxsaber:

The updated modification time has no effect on the result. EA

Yes. Thank you. Found what the problem was.

There will be a fix in the near future. However, the files used from the common folder still can't be controlled. Only the files specified in #property tester_file

 

Switching the tester back on in visualisation mode after a pass, I realise I've got the wrong settings and the tester hangs for a couple of minutes.

2018.07.11 17:03:05.992 Core 8  disconnected
2018.07.11 17:03:05.992 Core 8  connection closed
2018.07.11 17:03:09.241 Core 8  connecting to 127.0.0.1:3000
2018.07.11 17:03:18.308 Tester  stopped by user
2018.07.11 17:03:19.241 Core 8  tester agent authorization error
 
//Определение экстремума
for(int i=NBars;i<=NumBars;i++)
     {
      xMinL=ArrayMinimum(MinBuffer,0,i);
      xMinLD=ArrayMinimum(MinBuffer,0,i+NBars);
      if((MinBuffer[xMinL]<=MinBuffer[xMinLD])&&(xMinL>=NBars))
        {
         Minimum=MinBuffer[xMinL];
         break;}}

//Проверка если ордера с такой же ценой не существует         
   for (int r=0; r<=OrdersTotal(); r++)
   {if (OrderSelect(OrderGetTicket(r)))
    {if (StringToDouble(OrderGetString(ORDER_COMMENT))==NormalizeDouble(Minimum,_Digits))    
       {x2=1;
        break;}
     else x2=0;}}

//Проверка если Позиции с такой же ценой не существует     
   for (int l=0; l<=PositionsTotal(); l++)
   {if (PositionSelectByTicket(PositionGetTicket(l)))
    {if (StringToDouble(PositionGetString(POSITION_COMMENT))==NormalizeDouble(Minimum,_Digits))     
       {y2=1;
        break;}
     else y2=0;}}

//Если проверка отрицательная, открываем ордер        
   if ((x2==0)&&(y2==0))
   m_trade.SellStop(Volume,NormalizeDouble(Minimum,_Digits),_Symbol,NormalizeDouble(Minimum+(SL_ATR*ATR2),_Digits),NormalizeDouble(Minimum-(TP_ATR*ATR2),_Digits),ORDER_TIME_GTC,0,DoubleToString(Minimum,_Digits));
Hello dear forum users. This is an excerpt of code that detects extrema and places pending orders on them. It seems to work, but sometimes it starts to set endless pauses at one extremum, as if it does not see the stop criterion. I have already racked my brains.
 
Dmitri Custurov:
Hello dear forum users. This is an excerpt of code that identifies extrema and places pending orders on them. It seems to work, but sometimes it starts to set endless pauses at one extremum, as if it does not see the stop criterion. I have already racked my brains.

So, is it correct to compare?

if (StringToDouble(PositionGetString(POSITION_COMMENT))==NormalizeDouble(Minimum,_Digits)){.....}
 

In the indicator

Printing in visual strategy tester mode, as my brain has already boiled over - couldn't find the error in the logic:

Print(iHigh(Symbol(),PERIOD_CURRENT,i+1), "  ",sqh_buffer[i+1]);

Start date 01.01.2018 minutes

2018.07.11 17:19:07.770 2018.01.01 00:00:00   58148.0  0.0
2018.07.11 17:19:07.770 2018.01.01 00:00:00   58149.0  0.0
2018.07.11 17:19:07.770 2018.01.01 00:00:00   58146.0  0.0
2018.07.11 17:19:07.770 2018.01.01 00:00:00   58140.0  0.0
2018.07.11 17:19:07.770 2018.01.01 00:00:00   58139.0  0.0
2018.07.11 17:19:07.863 2018.01.03 10:00:00   58139.0  58391.79995461365
2018.07.11 17:19:07.863 2018.01.03 10:00:00   58135.0  58391.71051866656
2018.07.11 17:19:07.906 2018.01.03 10:00:20   58135.0  58463.08874123808

Of course, there are no real quotes on this date, people have a holiday, then what are these magic numbers, and in general how do I get information for the first date???

 

Question:

How do I know that the timer is on and what is its frequency?

Am I not reading the help very well or is it not possible?

 
Nikolai Semko:

Question:

How do I know that the timer is on and what is its frequency?

Or am I not reading the help very well, or is it not possible?

Judging by the silence, there really must be no such possibility. :((

But how come - it's a very simple and useful feature!

For example, I create a class that uses timer. And inside the class I can turn timer on and off, change periodicity of it. But for conflict-free work with the rest of the program the class must know whether the timer is on or off and what its periodicity is.

 
Nikolai Semko:

Judging by the silence, there really probably isn't such a possibility. :((

But how come - after all it's a very simple and useful feature!

For example, I create a class that uses a timer. And inside the class I can turn timer on and off, change periodicity of it. But the class must know whether the timer is on or off and what its periodicity is in order to ensure conflict-free cooperation with the rest of the program.

So, you're welcome, or rather, the class.

 
Sergey Dzyublik:

Flag on the playground, or rather the classroom.

It won't help. Especially if the timer is already on before being enabled in the class, e.g. at intervals of a few hours or days. Then such a class will ruin the entire logic of the program.

 
Sergey Dzyublik:

So is the comparison correct?

I've tried both feng shui and this - the result is the same. The thing is that everything works 99% of the time, and I need 100%. At the moment, the main thing for me is to get the logic right, and I'll be able to do the beauty later.

I forgot to add only that the error mentioned above appears in the tester. When I open it on a chart, I don't see it or I just need to wait for the required extremum where this error will occur again.
Reason: