Hi,
I can't input the volume correctly in my code.
I already posted this question in the community a while ago. But the answers are always in Python and Python is not my programming code. When trying to convert I always getting some errors.
And I cant open the question anymore because too long ago.
https://www.quantconnect.com/forum/discussion/12223/indicator-for-volume-of-last-24-hour/p1
I just want the 24 hours USD volume of the symbols (those are BTC pairs).
So the bot can only trade a symbol with a 24hours volume of 1 000 000$.
It is about this part.
//Volume Calculation
//_volume = data["ETHBTC"].Volume;
//_volume = data.Bars[symbol].Volume;
_volume =History("ETHBTC", 24, Resolution.Hour).volume.sum;
Thanks in advance.David
Louis Szeto
Hi David
Varad had suggested to use TradeBar Slice in OnData in the other thread. Then you could set up a RollingWindow instead of repeated History calls for efficiency. Please refer to the attached backtest as an example. You could subscibe to Hourly resolution if you only wish to check every hour. Or if you want to check in every minute, you could subscibe a Minute resolution data and make the RollingWindow size of 60*24.
Best
Louis
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.
Vronghel
Hi Louis,
This helped me a lot and I could implement the volume in my code.
Thanks!!!
Vronghel
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!