In research workbook, we are able to read h5 files from dropbox using 'open' function; but not in project environment; Can advise how to read h5 files from dropbox? Thanks.
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
How to read h5 files from Dropbox in QuantConnect project environment?
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
How to read h5 files from dropbox?
Zc Yong | June 2020
In research workbook, we are able to read h5 files from dropbox using 'open' function; but not in project environment; Can advise how to read h5 files from dropbox? Thanks.
QuantConnect™ 2025. All Rights Reserved
Zc Yong
str123 = qb.Download("https://www.dropbox.com/s/g3cmezpq077butj/my_h5_model_new.h5?dl=1")
data_new = base64.b64decode(str123)
with open('newnew.h5', "wb") as g:
g.write(data_new)
data_new2 = h5py.File('newnew.h5')
list(data_new2)
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.
Shile Wen
Hi Zc,
We currently do not support the use of h5 files.
Best,
Shile Wen
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.
CAPOCAPITAL
Hello,
I am unable to open() h5 files from dropbox in the research notebook. I am getting the following error - OSError: [Errno 36] File name too long
I am trying to do this in order to run a model using pre-trained weights. The following code does not work for me:
qb = QuantBook()
h5model = qb.Download("https://www.dropbox.com/s/g3cmezpq077butj/my_h5_model_new.h5?dl=1")
open(h5model)
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.
Shile Wen
Hi Capocapital,
We currently do not support the use of h5 files in QuantConnect, however, we will work on a feature that will enable uploading trained models ASAP.
Best,
Shile Wen
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.
Lars Klawitter
To Yuri's earlier point of there being a difference between backtests and live trading as to when the stop orders are placed:
I've been running the strategy (using a larger universe and shorter opening range as per my previous post) on IBKR paper trading (i.e. on an actual IBKR account, not via QC paper trading) and as Yuri suggested, the stop orders are at times placed within the same minute. Mostly 20-40 seconds after the entry:
in one case the stop order was placed the same instance as the entry:
I tried second resolution, but that seems impractical given the large universe size.
So this is my attempt at an artificially delayed stop order placement:
I'm not a C# coder, so I definitely don't know what I'm doing. Backtests with this code produce by and large comparable results with the original code, so I'll try paper trading next.
Would the above code change make sense to you?
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.
Yuri Lopukhov
So far I can see two issues:
I can't fix the first issue in C#, so I guess I will switch to Python version unless somebody else fixes the C# version and share it. Not sure if fixing it will improve results as well.
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.
Jack Pizza
define: “does really well with 1 minute” ….. 2000-2002 still utterly collapses fail to see well really well fits in….
or does really well when overfitting super hard?
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.
Quant Stratege
These backtests are not representative of live performance. When adding slippage, it can be significant at the open due to volatility, small-cap stocks, and using stop orders, making the results much less appealing.
Just add this line when adding securities:
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.
Lars Klawitter
You're right. I had previously only simulated very small constant slippages, but MarketImpactSlippage has quite a savage effect…
If it looks too good to be true…
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.
AleNoc
I noticed a difference between the backtest and the selection with live data (data provider QuantConnect). What data provider do you use for live trading?
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.
Evan lightner
I don't know where to start, I'll have to write a whole post and how I'm planning to implement this strategy. But first of all thank you @derek for sharing this (and of course for everything you've done with QC -its been a game changer for me).
But first of all, I just want to comment with one simple non-coding question….
Why are a good amount of people HATING on this strategy? I understand the backtest cherry pick , but for a bare bones boiler plate ( i messed around with some variables like holdings and percent risk and still got good results) , this is the best algo I've seen in a while, especially for being shared so freely - not to mention brand new piece of research in the community.
Is there just some sort of deep skepticism in the quant community at large I guess, inherently? I suppose that fits!
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.
Kevin Patterson
Does anyone else end up with very different symbols when running the exact same algo in backtesting vs live (IBKR paper trading)? For example when it is set to choose 20 symbols, I'll see maybe only half overlap –- and of course the ones going positive for the day in the backtest are the ones not picked up live 😅. Seems the relative volume calculations aren't exactly the same and it doesn't take much to move the symbols you get. This is my first foray in to large universe algo's, is this type discrepancy common with large universe backtests or is there settings to help make it line up better with live? S
Some folks were asking about sized nodes: after trying the python version on IBKR (with a few mods) an L1-2 node will make it through one day (it crashes after close though, so likely you need the next level up if you dont want to restart daily)
Thanks for all the python related posts, even if I don't end up trading it, the algo has been super helpful for learning more about the QC code and had some good recipes in it that I think would be helpful for any algorithm.
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!