Experiments with MetaTrader 5 at Discovery - page 16

 
Another question, what build is it? 803?
 

build 803. The account is real 10267.

I take it that since there are so many questions, I'm the only one with 'mnj?

As recently as 3-4 weeks ago the tester was a bit more correct in terms of spreads. But in terms of behaviour...

The problem was in the following: practically any candlestick was formed, say, within 20 ticks. And then 50-100 ticks or the price was 10 points up/down at the extremum or near the close. And this beat was easily found by a tester that optimized the scalper.

Generally speaking, the tester is not suitable for scalper/pipsewing strategies.

I understand the slowness of the tick tester. But for the exchange, in my opinion, you can not do without it.

 
dimeon:
How do I do this ?

Open the graph. Open the Data window. Scroll through the chart to the required point in time. Move the mouse on the chart and see the spread values in the Data window.

I have already looked at it. On a large number of bars - zero spread. That is, the data is incomplete. With a zero spread value, the last non-zero value is used.

Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
Документация по MQL5: Доступ к таймсериям и индикаторам / Bars
  • www.mql5.com
Доступ к таймсериям и индикаторам / Bars - Документация по MQL5
 
Well, the situation is different in the tester. The visualizer shows that in the first half of the day the spread is off the mark, in the afternoon it is 20-50 pips on average and in the evening session it is off the mark again
 

Let me explain with pictures what happens in the tester.

The tester downloads historical data for at least the previous year before testing starts and analyzes the spread. If testing starts with 2013.01.01, then the last non-zero spread in 2012 was recorded on 2012.12.10 at 10:09 a.m., and it was 2990 points


The next non-zero spread is recorded 2013.03.15 at 18:49 in the amount of 1190


Between these times the spread is 0. That is, from the first of January 2013 until the evening of March 15, the last known spread was 2990 (what I called "the last non-zero value"). Until that last non-zero value became 1190.

After that we have got zero spread again, that is why we have been using 1190. This was recorded until 2013.03.18 18:46.


after another 3 minutes.


Then there were far fewer zeros than at the start of the year. Nevertheless, the series of zeros remained.

This explains the series of identical spreads

The situation is unpleasant, we will solve it. The spreads in the tester will be adequate.

 

The spreads will be sorted out, we will set them correctly even if the broker has not imported detailed spreads into its history.

This will allow normal testing.

 
stringo:

Let me explain with pictures what happens in the tester.

The tester loads historical data for at least the previous year before testing starts and analyzes the spread. If testing starts from 2013.01.01, then the last non-zero spread in 2012 was recorded on 2012.12.10 at 10:09 a.m., and it was 2990 points


The next non-zero spread is recorded 2013.03.15 at 18:49 in the amount of 1190


Between these times the spread is 0. That is, from the first of January 2013 until the evening of March 15, the last known spread was 2990 (what I called "the last non-zero value"). Until that last non-zero value became 1190.

After that we have got zero spread values again, that is why we have been using 1190. This was recorded until 2013.03.18 18:46.


after another 3 minutes.


Then there were far fewer zeros than at the start of the year. Nevertheless, the series of zeros remained.

This explains the series of identical spreads.

The situation is unpleasant, we will solve it. The spreads in the tester will be adequate.

There is no point in testing the futures from the beginning of the year, because everyone has traded the March one.

It would be more reasonable to calculate the average spread with proper rounding.

Also please reduce the volumes for the tester. Most of the ticks come when the price doesn't move at all in reality. In the tester the price hits the extremum many-many times which is reflected in inadequate tests. And the time of optimization is reduced.

 

1. a) About glued futures... not really understood, but in my opinion the tester does not work with them (not a single trade, I tried to test standard EAs that are in the terminal).

b) In mt5 from bx there are already glued futures of major blue chips, keep up.

c) It would be great to be able to set spreads manually in the tester, it would be much easier to optimize strategies.

 

2. a) About the feed... it would not hurt to have it as a table of deals like in Quicksilver (as a pluggable and disconnectable tool of course), and also the ability to set filters in the table like in Quicksilver (for example I want to see only large deals with volume from 100 lots and how they passed, by bid or by ask)... I repeat - it would not hurt, but not so necessary.

b) But to add to obtained MqlTick structure (SymbolInfoTick(_Symbol,latest_price)) another parameter about how deal opened at Bid or Ask - I think it's necessary, or as a separate request for market information, this information is passed by exchange and it's required for many robots, including mine. To calculate whether a transaction was a buy or sell is not realistic... because there are over-the-counter transactions with large volumes that do not move the market directly and many other nuances... Adding this parameter to the structure, I think, will not be difficult for developers, and will bring a lot of benefits.

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен - Документация по MQL5
 

3. When trying to place pending orders, an EA comes up with error "Invalid order expiry date in request". For example, I made an EA which only places pending orders but does nothing else... In MT5 on forex, it places pending orders normally, but on FORTS, the error comes out. The order expiry date is adequate - I checked it by displaying it on the screen. Am I the only one with such a problem? What is the reason? Expert Advisor code below


#property copyright "Copyright 2013, MetaQuotes Software Corp."

#property link      "http://www.mql5.com"

#property version   "1.00"

input int tp=150;

input int Deviation=5;

MqlTradeRequest mrequest; 

MqlTradeResult mresult;   

int OnInit()

  {

   return(0);

  }

void OnDeinit(const int reason)

  {

  }


void OnTick()

  {

   Open_Pending_Order(1,SymbolInfoDouble(_Symbol,SYMBOL_BID)+NormalizeDouble(tp*_Point,_Digits), 1, 111);

   Sleep(500);

  return;

  }

//+------------------------------------------------------------------+

void Open_Pending_Order(int type, double prise, double lot, long magic)

  {

   ZeroMemory(mrequest);

   mrequest.action = TRADE_ACTION_PENDING;                               

   mrequest.magic = magic;                                              

   mrequest.symbol = _Symbol;                                            

   mrequest.type_filling = ORDER_FILLING_RETURN;                            

   mrequest.deviation=NormalizeDouble(Deviation*_Point,_Digits);                                                

   mrequest.type_time=ORDER_TIME_SPECIFIED;

   mrequest.expiration=TimeCurrent()+6000;                                    

   mrequest.volume = lot; 

   mrequest.sl = 0;  

   mrequest.tp = 0; 

   mrequest.price = prise;

   Print(" время экспирации ",mrequest.expiration," тип экспирации  ",mrequest.type_time," цена ",mrequest.price);

    if(type==1)

      {                                    

       mrequest.type = ORDER_TYPE_BUY_STOP;                              

       OrderSend(mrequest,mresult);

       // анализируем код возврата торгового сервера

       if(mresult.retcode==10009 || mresult.retcode==10008) Print("Ордер Buy по символу ",_Symbol, " с маджиком ",magic," успешно помещен, тикет ордера #:",mresult.order," !!");  

       else Print("Запрос на установку ордера Buy по символу ",_Symbol, " с маджиком ",magic," не выполнен - ответ сервера:" , mresult.retcode," код ошибки " ,GetLastError());

      }

    if(type==2)

      {                                    

       mrequest.type = ORDER_TYPE_SELL_LIMIT;     

       OrderSend(mrequest,mresult);

       // анализируем код возврата торгового сервера

       if(mresult.retcode==10009 || mresult.retcode==10008) Print("Ордер Sell по символу ",_Symbol, " с маджиком ",magic," успешно помещен, тикет ордера #:",mresult.order,"!!");

       else Print("Запрос на установку ордера Sell  по символу ",_Symbol, " с маджиком ",magic," не выполнен - код ошибки:" , mresult.retcode,"  " ,GetLastError());                         

      }

   return; 

  }

It says (I tried to change expiration time) :

2013.04.24 17:40:05 udalit (SBRF-6.13,M1) Request to place Buy order by SBRF-6.13 with magic number 111 failed - server reply: 10022 error code 4756

2013.04.24 17:40:05 udalit (SBRF-6.13,M1) Expiration Time 2013.04.25 17:00:00 Expiration Type 2 Price 10016.0

Reason: