Back

Upload h5 file other than dropbox

Can please advise if there is any alternative method to upload file other than from dropbox for more privacy reason as it must be make public in dropbox?

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.


Dear Yc Zong,

Unfortunately, in order for QuantConnect to read a file, it must be public. However, QuantConnect does have a file storing mechanism up to 5 MB through ObjectStore, which you can about read here. This means, after reading a public DropBox file once, that file can then be set again to private. Please note that the stored object will stay only in this algorithm. The following code combines file storing through ObjectStore and reading files with QuantConnect’s Custom Data Download.

import pandas as pd
from io import StringIO
class QuantumNadionFlange(QCAlgorithm):
DATA_OSK = "data_key"
FILE_URL = "https://www.dropbox.com/s/8v6z949n25hyk9o/custom_weather_data.csv?dl=1"
def Initialize(self):
self.SetStartDate(2019, 12, 11)
self.SetCash(100000)
if self.ObjectStore.ContainsKey(self.DATA_OSK):
json_data = self.ObjectStore.Read(self.DATA_OSK)
df = pd.read_json(json_data)
self.Debug(df.head())
# once ran once, set Dropbox file to private
else:
file = self.Download(self.FILE_URL)
df = pd.read_csv(StringIO(file))
self.ObjectStore.Save(self.DATA_OSK, df.to_json())
self.Quit(f'Object saved at {DATA_OSK}')

I have also attached a backtest for reference.

Best,
Shile Wen

1

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