My dissatisfaction to the strategy tester. to the MQL developers - page 2

 
Alexey Volchanskiy:

Renat, I'll take this opportunity to ask, since you're here. Will there be services in the new build or is it postponed for now?

Later.

In the meantime, you can write datafeeds for synthetic instruments without them.

 
Renat Fatkhullin:

Later.

In the meantime, I can write datafeeds for synthetic tools without them.


I want multithreading, I was hoping that somehow it could be done with services. I personally do not need datafeeds yet.

 

Good day to you all.

No, this post isn't bullshit like someone else wrote.

I'm on full serge.

I understand what programmers write and say works, but I'm sorry.

If we all work with erroneous data on the broker, I get the idea right away, my results are not erroneous.

The thing is that I may have ironically studied at university to be a statistical engineer.

So for me erroneous data is in general false data accordingly to say 99% that what I see works I as a man of statistics say I do not know the same say you and all who this post read.

The solution is what I wrote above.

Collecting ticks everyone can do with simple robot/algorithm.

The fact is that neither in 5 nor in 4 MQL we have the market data, that should be used for strategy testing.

For long term strategies, I do not think a robot is needed.

For me it is ticks for ticks and I have interesting ideas for studying asc and bid by tick.

Sorry for the long reply and time, I've been really busy.

Sincerely Ivan S.

 
Alexey Volchanskiy:

I wrote once, I'll find it.

For fivehttps://www.mql5.com/ru/code/18046

For fourhttps://www.mql5.com/ru/code/18047

For a six,https://www.mql5.com/ru/code/.


You'd be surprised, but it's the same for 5 and 4.

I can speak for 4 and 5 at the same time!


I have not read the full code of your algorithm but basically this part of the code is for saving but now I need to reproduce this Ask and have the Strategy Tester output it.

If there are any programmers who can do this I am listening very carefully!

 
Renat Fatkhullin:
If I'm not mistaken, in mt5 the tester is on real ticks where bid/ask is real?

Renat checked that mql5 works the same way as in 4 mql.

 
Ivan Stepanenko:

Renat checked that mql5 works the same way as with 4 mql.


the issue has been solved long time ago.

1. The question has already been solved. For MQL5 the testing on real ticks has been available for about a year. If only you had studied the terminal...

2. For MQL4, you can use your own tick .fxt files. The easiest way is using TickStory Lite, it downloads real ticks from Ducas

 
Ivan Stepanenko:

renat checked that mql5 works the same way it sets a fixed spread. as in 4 mql.


a lie

We take my Expert Advisor for ticks saving SaveTicks, the link to CodeBase I gave above, and run it in the tester in mode"Every tick based on real ticks". Let's see what's in the output file, in my case \Tester\Agent-127.0.0.1-3000\MQL5\Files\EURUSD_SaveTicks.csv

2017.11.28 09:11:16,1.1895,1.18952

2017.11.28 09:11:16,1.1895,1.18952

spread 2

2017.11.28 09:11:26,1.18947,1.18951

2017.11.28 09:11:26,1.18947,1.18951

spread 4
 

Look at the character browser, and there are ticks for any characters.

These are the actual ticks used in the tester.

 
Ivan Stepanenko:

Good day to you all.

No, this post isn't bullshit like someone else wrote.

I'm on full serge.

I understand what programmers write and say works, but I'm sorry.

If we all work with erroneous data on the broker, I get the idea right away, my results are not erroneous.

The thing is that I may have ironically studied at university to be a statistical engineer.

So for me erroneous data is in general false data accordingly to say 99% that what I see works I as a man of statistics say I do not know the same say you and all who this post read.

The solution is what I wrote above.

Collecting ticks everyone can do with simple robot/algorithm.

The fact is that neither in 5 nor in 4 MQL we have the market data, that should be used for strategy testing.

For long term strategies, I do not think that a robot is needed.

For me it is ticks for ticks and I have interesting ideas for studying asc and bid by tick.

Sorry for the long reply and time, I've been really busy.

Sincerely Ivan S.

What about your grammar? //Just saying...

If everything is so serious, the solution to your question is as follows:

Gather statistics, quote history and work, Alexey Volchansky has already found everything for you and gave links above.

On the Ask - you can download the history with Ask and Bids from DucasCopy (google it).

Good luck!
 

Here are some interesting articles:


In addition, in yesterday's beta of MetaTrader 5, to which you can upgrade from MetaQuotes-Demo, there is a full-fledged formula system of creation of custom symbols.

You can now create synthetic financial instruments - instruments based on one or more existing ones. You just need to specify the formula for calculating the quotes, and the platform will generate the ticks of the synthetic instrument in the real-time mode and create its minute history.

How it works

  • You create a synthetic symbol and set a formula for it.
  • The platform will calculate its ticks at a rate of 10 times per second (and only if the price of at least one instrument included in the formula has changed).
  • The platform will calculate the history of the minute bars (for the last two months) based on the minute bars of the instruments included in its formula. All new bars (current and subsequent) will be built in real time based on the generated ticks of the synthetic instrument.
For example, you can create a tool, which will show the dollar index (USDX). Its formula will look as follows:
50.14348112 * pow(ask(EURUSD),-0.576) * pow(USDJPY,0.136) * pow(ask(GBPUSD),-0.119) * pow(USDCAD,0.091) * pow(USDSEK,0.042) * pow(USDCHF,0.036)
Note: the original dollar index formula uses USDEUR and USDGBP pairs. As the platform only has inverse currency pairs, the synthetic tool formula uses negative degree for them and the Ask price instead of Bid.

In real time, the platform will calculate the price of the new instrument based on the quotations of the six other instruments provided by your broker. In the Market Watch and on the chart, you will see how its price is changing:



Create a new custom instrument, open its specification and specify the formula:




For convenience, the formula editor shows a list of possible options as you enter instrument and function names.

The calculation of ticks and minute bars of the synthetic instrument will start when it is added to "Market Watch". All symbols necessary for its calculation will be automatically added to the "Market Watch" immediately. A record of the start of the calculation will be added to the platform's log: Synthetic Symbol USDX: processing started.
  • The calculation of the synthetic instrument stops when it is hidden from Market Watch.
  • Symbols that are currently used to calculate synthetic instruments cannot be hidden from the Market Watch.

Calculating quotes in real time
Every 100 ms (ten times per second) we check if the price of at least one instrument involved in the formula has changed. If so, the synthetic instrument price is calculated and a tick is generated. The calculation is performed in parallel in three streams for Bid, Ask and Last prices. For example, if EURUSD*GBPUSD is specified in the formula, the synthetic instrument price calculation will be as follows:

  • Bid - bid(EURUSD)*bid(GBPUSD)
  • Ask - ask(EURUSD)*ask(GBPUSD)
  • Last - last(EURUSD)*last(GBPUSD)

The presence of changes is checked for each price separately. For example, if in the next calculation only the Bid price of the initial instrument has changed, then only the price, where there were changes, will be calculated for the tick of the synthetic instrument.

Building the history of minute bars
In addition to collecting ticks in real time, the platform also creates a minute history of a synthetic instrument. Thus, a trader can view its charts as if they were regular instruments and perform technical analysis on them using objects and indicators.

As soon as the trader adds a synthetic instrument to the Market Watch, the platform checks whether there is a minute history calculated for it. If not, it will be created for the last 60 days, which is about 50,000 bars. If the max bars in the window in the platform settings have a lower value, this is the limit that will be used.

If some of the bars in this period are already built, the platform will create new ones. A deeper history is created only when trying to view the corresponding timeframe on the chart (if you scroll back or request the history from the MQL5 program).

The history of the minute bars of a synthetic instrument is calculated based on the minute bars (not ticks) of the instruments included in its formula. For example, to calculate the price of the Open minute bar of a synthetic instrument, the platform takes the prices of the Open instruments included in its formula. The prices of High, Low and Close are calculated in the same way.

If you do not have a minute bar in the formula for a symbol, the platform will calculate the Close price of the previous bar. For example, you can use three symbols: EURUSD, USDJPY and GBPUSD. If USDJPY does not have a minute bar corresponding to 12:00, the following prices will be used for the calculation:

  • For Open - EURUSD Open 12:00, USDJPY Close 11:59, GBPUSD Open 12:00
  • For High - EURUSD High 12:00, USDJPY Close 11:59, GBPUSD High 12:00
  • For Low - EURUSD Low 12:00, USDJPY Close 11:59, GBPUSD Low 12:00
  • For Close - EURUSD Close 12:00, USDJPY Close 11:59, GBPUSD Close 12:00

If all symbols in the formula do not have a minute bar, the corresponding synthetic minute bar will not be calculated.

Construction of new mini bars
All new bars (current and next) in the synthetic tool are created based on the ticks generated. The price at which the bars are built depends on the "Chart construction" parameter in the specification:





What operations can be used in the tool formula
You can use price data as well as some properties of the available symbols (provided by your broker) in your formula. To do this, specify:

  • Symbol name - depending on a synthetic symbol price, the formula will use the Bid, Ask or Last price of the specified symbol. For example, if you specify EURUSD*GBPUSD, then Bid price will be calculated as Bid(EURUSD)*bid(GBPUSD), and Ask price - as Ask(EURUSD)*ask(GBPUSD).
  • Bid(symbol name) - to calculate the Bid price of a synthetic symbol, the Bid price of the specified symbol will be forcedly used. Actually, this variant corresponds to the previous one (without specifying of a price type).
  • Ask(symbol name) - the Ask price of the specified symbol will be forcedly used for calculation of the Bid price of the synthetic instrument. For calculating Ask price, on the contrary, Bid price of the specified symbol will be used. For calculating the Last price, the Last price of the specified symbol will be used. For example, if you specify Ask(EURUSD)*GBPUSD, the calculation will be as follows:
    • Bid = ask(EURUSD)*bid(GBPUSD)
    • Ask = bid(EURUSD)*ask(GBPUSD)
    • Last = last(EURUSD)*last(GBPUSD)
  • last(symbol name) - the Last price of the specified symbol will be used to calculate all of the synthetic symbol prices (Bid, Ask and Last). For example, if you specify last(EURUSD)*GBPUSD, the calculation will be as follows:
    • Bid = last(EURUSD)*bid(GBPUSD)
    • Ask = last(EURUSD)*ask(GBPUSD)
    • Last = last(EURUSD)*last(GBPUSD)
  • volume(Symbol name) - the formula will use the volume of the tick for the specified symbol. Please ensure that volume information is translated for the specified instrument.
  • point(symbol name) - the size of minimal price change of a specified instrument will be used in the formula.
  • digits(symbol name) - the number of decimal places in the price of the specified symbol will be substituted in the formula.

If a symbol has a complex name (contains hyphens, dots, etc.) it must be enclosed in inverted commas. For example, "RTS-6.17".
Arithmetic operations can be used in the formula: addition (+), subtraction (-), multiplication (*), division (/) and remainder of division (%). For example, EURUSD+GBPUSD means that the price is calculated as the sum of EURUSD and GBPUSD. You can also use a unary minus in the formula to change the sign, for example: -10*EURUSD.

There is a priority for arithmetic operations:

  • Operations of multiplication, division and remainder are performed first, then operations of addition and subtraction are performed.
  • The operations are carried out from left to right. If several operations are used in a formula, which have the same priority (for example, multiplication and division), the operation on the left will be executed first.
  • Brackets ( and ) can be used to change the priority of operations. Expressions in brackets have the highest priority in the calculation. The principle of left to right also applies to them: expressions in brackets to the left in a formula are calculated first.

Constants can also be used in the formula:

  • Numeric (integer and real with a dot). For example, EURUSD*2+GBPUSD*0.7.
  • The _Digits and _Point symbol properties. They substitute the properties of the custom symbol from the specification into the formula. _Digits - number of decimal places in symbol price, _Point - size of minimal change of symbol price.

Also all mathematical functions supported in MQL5 can be used in the formula, except MathSrand, MathRand and MathIsValidNuber. Only short names are used for all functions: fabs(), acos(), asin(), etc.