Back

Equity vs. Crypto and using .History()

Equity returns DataFrame as expected but Crypto doesn't.

What am I missing?

Thanks,

Tony

Update Backtest







0

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.


So, I got this to work

history = qb.History(qb.Securities.Keys, 60, Resolution.Hour)

but if I change Resolution to Minute, I get the same output as above. Is there an issue pulling crypto minute History()?

0

Hi Tony.

Thank you for sharing! You can retrieve 60 minute data history for a crypto currency pair such as BTC/USD by using timedelta(60) instead of 60 in History():

# Import timedelta
from datetime import timedelta

# Add the security
qb.AddCrypto('BTCUSD', Resolution.Minute)

# Retrieve minute data history for BTC/USD
history = qb.History(['BTCUSD'], timedelta(60))

I've attached a notebook where I retrieve 60 minute data history to a DataFrame for AMZN and also the crypto currency pair BTC/USD.

 

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed