Interesting topic for many: what's new in MetaTrader 4 and MQL4 - big changes on the way - page 49

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Don't bullshit, go on PR the kitchen ;)
Jacket, don't soil your image here among the "nubs and PR people" according to your classification. Go to your QQ.
P.S. For traders there is literacy, where they can replenish their knowledge of the realities of the FOREX market and its various features from their usual exchanges. Broaden your horizons!
Jacket, don't soil your image here among the "nubs and PR people" according to your classification. Go to your QQ.
MetaQuotes, of course, overdid (underdid) with the format of stored history (MqlRates). It is understandable. When the format was developed in the forex market, fixed spreads prevailed, market (floating) spreads were still an exotic thing.Although it was clear that even the fixed spreads in fact floated, because the brokerage companies "do not guarantee their fixity at the moments of news and rapid market changes" (the inverted commas represent here a quotation from a typical offer of almost any brokerage company of that period).
But times have changed and we have what we have - spreads are floating on every tick, and that's OK. Only the historical quotes don't reflect it. Unfortunately.
Only one value of spread for each bar is stored in history. And it is not enough now. And it leads to distortions when testing on history, because there is no coincidence of the actual trading history and trading in the tester, even if a broker supplies absolutely honest (corresponding to the actual tick-feed translation) history base. The reason is insufficient descriptive power of MqlRates format.
This structure assumes the invariability of the spread within a bar, which does not correspond to the current trading realities.
Further we discuss what the "complete" format could be, I've called it "Mql_6_Rates" conditionally to make it clear that it's currently not supported.
Below are two variants. The first is a packed structure (for disk) without compression by special algorithms. It could be compressed many times smaller (2-3, presumably) to reduce transfer traffic. The compressed format is not discussed here.
The "packed" format is supposed to be optimal when stored on the trader's disk. When loaded from disk into memory, it can be decompressed on the fly, the decompression functions are "attached" to the structure.
The unpacked history (for access from MQL) could be, say, this:
It is larger than it is now, but spread is calculated at all fixed points of the bar. I.e., if we have to write information in minute bars according to the traditional scheme {Open+High+Low+Close}, then we should write it "in full".
In my opinion, this information is redundant and it tends to create maximal illusions at the Open point. The moments of bars opening for different symbols do not coincide, while exactly at the moment of the minute start (astronomical) the bid-ask prices on the symbols correspond to the last traded bids, i.e. closing prices. Therefore, the most suitable format for testing the minutes (the most healthy compromise between tradition and common sense) could be as follows
// The corresponding saving in packed disk format would be another 7 bytes, i.e. SizeOf(Mql_6_PackedRates) would be reduced to 31 bytes.
For the ecological (most reasonable) testing "by opening prices", the astronomical start time of a minute should be taken, i.e. the Close price of the previous bar. In this case, an exact multi-currency synchronism of prices would be achieved. This synchronism is vital for debugging multicurrency EAs trading market orders. For limit and stop order trading, the information on extrema on each bar is vital. It is also fully available in the format we are discussing.
--
In fact, I'm developing these formats right now for my own purposes. Publishing them here is just a by-product of my development. Maybe someone may find them useful.
In an environmentally friendly (most sensible) "opening prices" test, the astronomical start time of the minute should be taken, i.e. the Close price of the previous bar.
ignoring the gap will be critical in some cases
p.s. if you need savings in traffic, you can store offsets instead of absolute price values, for which double is very much
MetaQuotes, of course, overdid (underdid) the format of stored history (MqlRates). It is understandable. When the format was being developed in the forex market, fixed spreads prevailed, market (floating) spreads were still exotic.Although it was clear that even fixed spreads were in fact floating, because the brokerage companies "do not guarantee their fixedness in times of news and rapid changes in the market" (the inverted commas here represent a quotation from a typical offer of almost any brokerage company of that period).
MT5 was originally positioned as an exchange terminal. And on the exchanges ECN-laws of price formation are VERY long ago. So, the excuse of deficiency is untenable. Well there was not (and is not) in their team a strong algotrader, who could be listened to. Apparently, only "the number of years of successful platform development" rules than sound logic.
I wasn't trying to make excuses. To make excuses, you have to accuse first. I don't really have time for that.... :)
Then it is an indulgence (one should be wary of such a thing - it is worse than naked criticism):
When the format of stored history (MqlRates) was developed, MetaQuotes, of course, overdid (underdid). It is understandable. When the format was developed in the forex market, fixed spreads prevailed, market (floating) spreads were still exotic.Although it was clear that even fixed spreads were in fact floating, because the brokerage companies "do not guarantee their fixedness in times of news and rapid changes in the market" (the inverted commas here represent a quotation from a typical offer of almost any brokerage company of that period).
ignoring the gap will be critical in some cases
Then it's condescension (beware of such things - worse than naked criticism):
:-)
It's a little late for me to drink borjomi or to make amends. A place in hell has long been reserved for me.
I don't think that trying to understand without judgment is the gravest of my sins. ;)
There is such a letter. However, the gap (discontinuous jump of quote) can happen at any moment, not only at the beginning of bar. So, any "thinned" format is not without sin, by definition. Full feed only in ticks. And it could be even more full in the history of the cup. I am trying to make a minute format for myself, so far I found this compromise.I may leave it as described above (without Open, only {Hi-Lo-Close}), I understand all drawbacks, it's only one version of my coding for my tester. I'll use raw ticks or artificially cut them down by any methods (with saved ticks format {bid-ask-time}).