Is there a possibility of including Tick Volume in Quote Bars for resolutions other than Tick? The QuantConnect database already has a total count of all of the ticks and can add on a field to Quote Bars for the number of ticks per Quote Bar, which is a generally-recognized approximation for volume in the Forex market.
Perhaps the next time the entire data set is processed and aggregated into the larger resolutions it can be added in.
There is an immense performance penalty incurred by manually calculating the Tick Volume, and it is even more egregious if Hourly or Daily data can be used in the algorithm instead of Second or Minute.
I am currently subscribing to Tick data and then processing each tick (counting them as well as using a Consolidator to create larger bars), but the only use I have for tick resolution is to calculate Tick Volume. If the Quote Bars included a Count/Tick Volume field, then I could subscribe to Minute (or even Hourly) data instead for my algorithm. While doing it this way is working, it is dramatically slower than just using Minute Quote Bars.
My algorithm is similar to the one presented here: https://www.quantconnect.com/forum/discussion/7573/trying-to-build-a-forex-volume-estimate-indicator-using-tick-data-as-a-proxy/p1 , although I tried to make it simpler for the purposes of attaching a concise backtest here.
I have attached a backtests running with Tick Resolution, and one line can be changed to switch to Minute or other Resolution. Obviously the Minute test processes far fewer data points, but it still shows the huge penalty just trying to extract Tick Volume.
For 1 year (2020) and 1 pair (EURUSD):
Tick test: completed in 560.96 seconds at 47k data points per second. Processing total of 26,318,609 data points.
Minute test: completed in 8.83 seconds at 43k data points per second. Processing total of 376,063 data points.
Hour test: completed in 0.51 seconds at 16k data points per second. Processing total of 8,021 data points.
If Tick Volume were included in Quote Bars like the OHLC Bid Ask data, then conceivably the algorithm could run at the much faster speed of Minute or longer Resolution and still have access to the Tick Volume. Just because multiplication is fun, including Tick Volume in Quote Bars would be 63 times faster than using Tick Resolution (and Hourly would be 1,158 times faster!). While 9 minutes or so isn't bad for the Tick test, it becomes much worse when a longer timeframe or more pairs are added.
There have been other mentions of Tick Volume on the forum in the past, but those have involved offline or custom data access.
This is more of a feature request than algorithm help, but I am certainly open for any tips on how to make the tick counting more efficient.
In my actual algorithm, I run the tick data through a Minute Quote Bar Consolidator (Warmup and also subscribed to the data) and then whenever the Consolidator fires I take that bar and combine it with the accumulated ticks thus far so that I have a hybrid Minute Quote Bar with Tick Volume stored in a Rolling Window that then has other calculations run on it.
Derek Melchin
Hi Trifone,
Volume is not available for forex. When using other asset classes, we have an open GitHub Issue to add a consolidator that can produce volume bars. Subscribe to our progress here.
Best,
Derek Melchin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
LE
I support this feature request as well. It would be great if we could include “Tick Volume” information instead of having to process it ourselves, and perhaps some sort of “Market/Volume Profile” indicator. Such volume profile indicators are available on TradingView, even on Forex, as they use “Tick Volume”. Quantconnect appears to already have all the necessary data for this to work.
https://www.tradingview.com/support/solutions/43000480324-how-is-volume-profile-calculated/
https://www.tradingview.com/support/solutions/43000502040-volume-profile/
Louis Szeto
Hi LE
There is a reason why only tick volume and quote bar are available for forex in most brokers. Forex trading is decentralized, meaning it doesn't have a clearing agency. So, unlike equities that are centralized to a primary exchange publishing all data, there is no possible way to fully acquire all volume or trade data in the public market. Exchanges can only calculate the lump sum traded within their own exchange but not information from all exchanges. Easier thinking would be exchanging money to travel aboard, would the bank/local exchange shops chart your volume in an exchange? They won't, but this would still have a tiny effect on the liquid volume of that currencies in the market, so as its rate.
That is why you're only receiving tick volume since only this volume is accurate. Summing up them will only account for all volume traded in that particular exchange market, causing bias. Note that by summing, you'll only be able to receive the ticks from your selected exchange (e.g. OANDA), but not the ticks from all markets.
Best,
Louis Szeto
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
LE
Hi Louis,
Thank you for taking the time to explain! I understand the limits of the decentralized forex market, but Tick Volume as the OP suggested may still be a helpful avenue for traders to approximate what's going on, another resource of information, despite it's limitations.
Cheers, LE
Louis Szeto
Hi LE
Unfortunately, although LEAN is capable of capturing tick volume (in other asset classes), our forex data provider, Onada, does not provide this information.
Best
Louis Szeto
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Kayne Eccles
Hi Louis,
Has there been any update on this subject?
I would definitely support the aggregation of tick volume; as others have mentioned, it approximates what's happening in the larger market. Most traders looking for this feature for their forex trading algorithms will understand that, given the decentralized nature of the forex market, the volume we receive on our OANDA data only represents trades executed through the OANDA broker.
Lastly, OANDA does indeed provide the information with their time-sampled bars, so why can't QC include this information?
It's a big drawback that we cannot use price/volume analysis or that we need to slow down our algorithm runtimes by manually computing volume through the individual ticks.
Trifone Whitmer
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!