Errors, bugs, questions - page 942

 

stap:

As the question concerns testing, the following must be taken into account. Tick sequences are generated during testing . Tick sequences are generated based on historical bid values of the 4 check points (Open, High, Low and Close). Accordingly, in the tester, the Expert Advisor processes ticks generated on the basis of bid values.

The second point. At present, the historical data do not store price values. Just look at the table in the"MQL5 Reference- Access to timeseries and indicators" section. Among the functions like CopyClose() or CopyLow() you can not find the function CopyLast(). Accordingly, even if desired, it's impossible to generate a tick queue based on the price values.

Try also to read articles Fundamentals of Testing in MetaTrader 5 and Tick Generation Algorithm in MetaTrader 5 Strategy Tester.

 
Yedelkin:

Since the question is about testing...


Firstly, thank you for your prompt reply. Your information turned out to be useful to understand.

I have checked it and it is true that stop orders are triggered before the price shown in the order as an execution price (there is a fact of making a real deal) because of the ask and bid prices equal to order's execution price.

So, it turns out that the terminal controls the pending order execution not by the price of performed deals but by the price of incoming ask or bid quotes. At least, it does so in the EA testing mode. Please correct me if I'm wrong.

In addition, I decided to conduct a small experiment. The task is to find out historical ask and bid values available and used for testing of Expert Advisors. Inputs: Exchange - FORTS, server - one of the brokers, instrument - RIH3, period from 17.12.12 to 12.03.13, Expert Advisor with code was tested in the Strategy Tester in order to get historical Ask and Bid values (testing was performed in OHLC mode on M1)

MqlTick last_tick;

if(SymbolInfoTick(Symbol(),last_tick))
     {
      Print(last_tick.time,": Bid = ",last_tick.bid,
            " Ask = ",last_tick.ask,"  Last = ",last_tick.last);
     }
   else Print("SymbolInfoTick() failed, error = ",GetLastError());

The result was interesting. Ask and Bid spread values turned out to be constant and equal from 10 to 340 pips at different time intervals. For example, from 10:00:00 20.02.13 till 18:49:59 25.02.13 spread on every tick was 140 points, and from 19:00:00 25.02.13 till 18:44:59 26.02.13 spread was 30 points, further from 19:00:00 26.02.13 till 18:49:59 in every tick it was 270 points, etc. Of course I am not a stock market mammoth, but spreads of 140, 270 and more pips in a liquid RTS futures are a rarity.

So my only conclusion is that, for testing Expert Advisors in the Strategy Tester, the MT5 terminal/broker/stock exchange (I do not know who else) surely does not offer historical Ask and Bid prices.

Hence two questions arise:

1. How to reliably test an EA (=trading strategy) if pending orders will be executed in testing mode using ask and bid prices that do not correspond to their real values. If I work on forex in the terminal Quik, I have a firm belief that the pending orders must not work at ask and bid prices (=the prices at which no deals were done. For instance, for a low-liquid instrument I can send to the put price with a huge spread), but only if the real deal is done on the exchange at the price mentioned in the order as the execution price.

2. If the ask and bid prices in the testing mode are not historically reliable, then at what prices would the execution of pending orders in the real trade mode be monitored - also at ask and bid prices? Are they real and reliable, i.e. coming from the exchange? If it is stated in the terminal manual that "The execution of all order types in symbols with the "Exchange execution" mode is performed by Last price (price of a last trade executed)", then why does the testing mode of symbols with the exchange execution mode show that the pending orders are executed at bid and ask prices in their properties? Or is it only in testing mode and in real trading it will be as described in the manual, i.e. pending orders will be controlled/executed at prices of deals that actually took place?

I apologize for writing too much, I thought I would share my thoughts, maybe someone will find it useful for history...




 
stap: So, it seems that the terminal controls the pending order execution not by the price of executed trades but by the price of incoming Buy or Sell quotes. At least in the EA testing mode. Please, correct me if I am wrong.

You know, due to the lack of a platform version for the Russian stock market, I have not yet tracked the operation of the terminal in the exchange execution mode. But I can immediately propose to divide the questions about the operation of the terminal in the exchange execution mode and the operation of the tester in the exchange execution mode.

To check the correctness of the statement about "all order types working at Last price" when the terminal is working in the exchange execution mode, try (I cannot think of anything better yet) to place several pending orders above and below the current quotes and also run your code described above. And try to visually track at which prices (bid, ask or last) the orders are executed.

The task is to find out the historical ask and bid values that are available and used for testing EAs.

It is not quite correct to talk about "historical ask values". I wrote yesterday that a tick series is generated based on certain saved bid values. The ask values, on the other hand, are most likely modelled based on bid and spread values. For example, as you tested in OHLC mode on M1, here it is simply ask==bid+spread.

I don't know the nature of RTS futures, that's why I can't comment on the "pips" spread. But in EURUSD for example a point is 0.00001.

Hence there are two questions:

Do you make it simpler. The developers know the correct answers for your situation. So find the "Service Desk" section in your profile and ask them to introduce the possibility to process pending orders in exchange execution mode at last prices (according to the MT5 manual). Describe your situation a bit and see the response. Maybe everything has already been thought out before us :)

 
Yedelkin: You know, due to the lack of a version of the platform for the Russian stock market...


Thanks for the insightful comments and advice!

Brokers BCS and Otkritie already offer the possibility to make trades on the Russian stock exchange (so far only FORTS futures and options market) via MT5 terminal.

 
stap: Brokers BCS and Otkritie are already offering the ability to execute trades on the Russian exchange (so far only the FORTS futures and options market) via the MT5 terminal.
The statement was: "due to the lack of a platform version for the Russianstock market". In other words: for the Russian stock market.
 
How can I find out my investor password if the registration letter from the broker is lost? I can't find my password.
 
foton: How can I find out my investor password if the registration letter from the broker is lost? Thank you.
Have you tried contacting your broker?
 
How do I put a block in a private message?
MQL5.community - Памятка пользователя
MQL5.community - Памятка пользователя
  • 2010.02.23
  • MetaQuotes Software Corp.
  • www.mql5.com
Вы недавно зарегистрировались и у вас возникли вопросы: Как вставить картинку в сообщение на форуме, как красиво оформить исходный код MQL5, где находятся ваши Личные сообщения? В этой статье мы подготовили для вас несколько практических советов, которые помогут быстрее освоиться на сайте MQL5.community и позволят в полной мере воспользоваться доступными функциональными возможностями.
 
Zeleniy:
How do I put a block in a private message?
From yourself? ))
 
tol64:
From yourself? ))

From you, not to turn on the computer at the signal and see the lickers again.

Reason: