Hello everyone,
I would like to import custom data using AWS Lambda and API Gateway. Here is an example of a request: https://v78wgv6s66.execute-api.us-east-2.amazonaws.com/test/get_data_from_investing?cid=986914&ticker=VMVL&start_date=12/01/2020&end_date=12/31/2020&resolution=Daily
However, when I try to implement it as in
https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/CustomDataBitcoinAlgorithm.pymy algorithm does not trade or even show values. Does anyone know what I am doing wrong? Thank you very much in advance.
Derek Melchin
Hi Gabriel,
The data retrieved from the AWS call is in decreasing order by date.
Dec 30, 2020;29.19;29.33;29.33;29.17;0.41K;0.05% Dec 29, 2020;29.17;29.39;29.39;29.15;0.53K;-0.35% Dec 28, 2020;29.27;29.18;29.37;29.15;0.93K;0.30%
Since the custom data reader reads from the top of the file, it assumes the data starts at the end of December. If we extend the backtest end date, we can see the first data point be passed to OnData. See the attached backtest for reference. Notice the GetSource method has been simplified to isolate the issue.
To resolve the issue, flip the data ordering.
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.
Gabriel Fenger
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!