Errors, bugs, questions - page 2095

 

There is a new bug in the spread tester. It is present in the visual mode, as well as in the standard mode (the expert sees the inflated spreads).

You can check by running the MA expert from the standard examples, with default parameters.

For some dates the spread is widened from 2-5 to 200-500 for the whole day from 0:00 to 23:59. I have checked it on 2 brokerage companies, the problem is probably not in quotations but in the tester itself.

Here is an example for the date 16.10.2017. The test should be run from 16.10.2017. In the background is the terminal with the chart scrolled to that date - the spread there is in the normal range.

Another example on another one. ANOTHER EXAMPLE FROM ANOTHER BROKERAGE COMPANY

I set up an Expert Advisor that controls spreads and it is these 200 to 500 that it sees. As a result, it works the whole day without following the algorithm.

The other date found is 19.09.2017. Ran the test from September to today - about 20-30% of days with overpriced spread. Saw overprediction up to 2000.

Sending to SD.

PS. Responded. Will be fixed in the new build.
 
elibrarius:

...

Sending to SD.

Also waiting for an answer on this issue:

Open, Started: 2017.12.16 14:36, #1911211

 

OrderSend on MetaQuotes-Demo hangs - sometimes runs for a few seconds, sometimes the script cannot be removed (only by closing the terminal).

 
Several errors in TRADE_ACTION_CLOSE_BY
#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006

#define Bid SymbolInfoDouble(_Symbol, SYMBOL_BID)
#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnStart()
{
  MqlTradeRequest Request = {0};
  MqlTradeResult Result;      
      
  Request.action = TRADE_ACTION_CLOSE_BY;
  Request.position = OrderSend(_Symbol, OP_SELL, 0.01, Bid, 100, 0, 0);
  Request.position_by = OrderSend(_Symbol, OP_BUY, 1, Ask, 100, 0, 0);

  Request.symbol = _Symbol; // Если убрать эту строку, то сообщения в логе изменятся

  Print(OrderSend(Request, Result)); // false
}

Result

'7489613': instant sell 0.01 GBPUSD at 1.34334 (deviation: 100)
'7489613': accepted instant sell 0.01 GBPUSD at 1.34334 (deviation: 100)
'7489613': deal #176902665 sell 0.01 GBPUSD at 1.34334 done (based on order #193547458)
'7489613': order #193547458 sell 0.01 / 0.01 GBPUSD at 1.34334 done in 73.458 ms
'7489613': instant buy 1.00 GBPUSD at 1.34342 (deviation: 100)
'7489613': accepted instant buy 1.00 GBPUSD at 1.34342 (deviation: 100)
'7489613': deal #176902666 buy 1.00 GBPUSD at 1.34342 done (based on order #193547459)
'7489613': order #193547459 buy 1.00 / 1.00 GBPUSD at 1.34342 done in 76.044 ms
'7489613': failed close position #193547459 buy 0.99 GBPUSD by position #193547458 [Invalid request]


Everything actually overlaps perfectly, but only in the logs are erroneous messages, and the OrderSend return is negative. If you remove the highlighted line in the source, you can see a completely inadequate message in the logs.

 

ME Styler bug MT4/MT5

 #define  f(x) x   //пробел вначале строки и перед конечным выражением
#define  f(x) x    //стилизатор удалил пробел в начале строки. Пробел перед конечным выражением остался

 #define  f(x) (x)   //пробел вначале строки и перед конечным выражением, ЗАКЛЮЧЕННЫМ В СКОБКИ
#define  f(x)(x) //стилизатор удаляет не только пробел в начале строки, но и разделяющий пробел между аргументом и конечным выражением. 

//В итоге компилятор выдает ошибку во втором случае
//'(' - unexpected in macro definition

 

Real M1 ticks. When the spread is negative in the tester data window (vis. mode), the spread becomes incorrect. Your server, 2017.10.23 01:00 and 01:01 minutes

Made an Expert Advisor that checks the spread. When the spread is negative the Expert Advisor sees the wrong spread, - increased by 1. Screenshot shows -1 in EA, -2 on the chart. If the spread is positive, everything is correct in Expert Advisor.

Spread on real ticks may be very different from the opening price spread. Here is an example with a difference of 39 pts. 2017.10.23 00:53
On opening prices:


On
real ticks:

Something I thought should match in both modes...

 
elibrarius:

I have made an Expert Advisor that checks the spread. If the spread is negative, the Expert Advisor sees the wrong spread - increased by 1. The screenshot shows -1 in Expert Advisor, -2 on the chart. When the spread is positive, everything is correct in Expert Advisor.

I'm sure you made a mistake in the code when calculating the spread. If you can't find it, please show the code.

 

what happened to the Copy... functions? ? previously they used to return timeseries, but now they don't:


In principle it's not hard to expand array indexing by itself, but former code where I used functions that expand timeseries after Copy... probably won't work now
 
Konstantin:

What happened to the Copy... functions? ? They used to return the time-series, but now they don't:


Basically it's not hard to expand array indexing by yourself, but former code where I used functions which expand time-series after Copy... probably won't work now

This was originally the case and it's written in the help.


 
fxsaber:

I am sure you have made a mistake in the code when calculating the spread. If you can't find it, please show me the code.

Hm. Find it ))))

int OnInit()
  {
   return(INIT_SUCCEEDED);
}

void OnTick()
  {
  int s[];
  CopySpread(_Symbol,_Period,0,1,s);
  Print(s[0]);
  }

Reason: