I am trying to program a strategy in MQL5 that requires the following history data:
By history I mean a few bars previous to the current bar.
If anyone knows of a code which can get that information, and is willing to share it, I would be most grateful.
- 2010.04.23
- Denis Zyatkevich
- www.mql5.com
Thanks Malacarne, I will look again at that article more closely.
I am trying to program a strategy in MQL5 that requires the following history data:
Bid bar history data required: Open High Low Close Volume
Ask bar history data required: Open High Low Close Volume
By history I mean a few bars previous to the current bar.
If anyone knows of a code which can get that information, and is willing to share it, I would be most grateful.
For the ask bar you will have "build" your own bar, using the ask tick prices.
Volume information is a bit diffcult, as the volume is just exchanged where the seller gets the bid price and the buyer pays the ask price
(and the difference between bid and ask, the spread, is for the "work" of the broker(-s) ).
So in my opinion from a single trade you have no way to say if it is a sell or buy volume, in other words the volume is just exchanged and the amount is identical for both sides.
Which of both parties has entered or left the market one cannot determine from the tick data feed.
So one has to look at the volumes in the context of price and time, and here I would split the volume between the ask and bid price.
Thanks
For the ask bar you will have "build" your own bar, using the ask tick prices.
Volume information is a bit diffcult, as the volume is just exchanged where the seller gets the bid price and the buyer pays the ask price
(and the difference between bid and ask, the spread, is for the "work" of the broker(-s) ).
So in my opinion from a single trade you have no way to say if it is a sell or buy volume, in other words the volume is just exchanged and the amount is identical for both sides.
Which of both parties has entered or left the market one cannot determine from the tick data feed.
So one has to look at the volumes in the context of price and time, and here I would split the volume between the ask and bid price.
Thanks, I think you are right about building my own ask bars.
Regarding volume, if the broker is also the market maker, then it is possible for the broker to know whether the deal was initiated by a buyer or a seller. In which case Bid Volume and Ask Volume can be meaningfully reported. Check out the link in this post https://www.mql5.com/en/forum/1678#comment_147023
MetaQuotes should seriously consider adding Ask Bar Charts to MT5.
Thanks, I think you are right about building my own ask bars.
Regarding volume, if the broker is also the market maker, then it is possible for the broker to know whether the deal was initiated by a buyer or a seller. In which case Bid Volume and Ask Volume can be meaningfully reported. Check out the link in this post https://www.mql5.com/en/forum/1678#comment_147023
I think MetaQuotes should seriously consider adding Ask Bar Charts to MT5.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to program a strategy in MQL5 that requires the following history data:
Bid bar history data required: Open High Low Close Volume
Ask bar history data required: Open High Low Close Volume
By history I mean a few bars previous to the current bar.
If anyone knows of a code which can get that information, and is willing to share it, I would be most grateful.