Hey gang,
Writing a follow up to my first cry for help where we figured out how to reshape the input tensors into the correct shapes and accept multiple features. Thank you Adam W !
I have made some more progress in the research environment. The model now accepts multiple features!
The inputs are the day-to-day pct_change of open, high, low, and close. The output is the day-to-day pct_change of close at N+1.
However, I am running into an issue where the model only predicts pct_change values near zero. What can I do to mitigate this issue and improve the model's predictive power?
Top graph is actual vs predicted close price. Bottom graph is actual vs predicted day-over-day pct_change.
Solutions I have attempted from scouring stackexchange:
- added dropout layer
- increased hidden_size (chose 128 arbitrarily. not sure what the rule of thumb is)
- reduced num_layer (chose 2 b/c 3+ produced completely flat predictions)
- changed loss function to nn.L1Loss (didn't seem to change the results much)
Ideas I haven't tried yet:
- standardize features instead of using MinMaxScaler
- “put an L1-Regularization term into your Dense Layers” (don't know what that means)
Eric Kao
As a side-question: how would an LSTM work on a non-continuous time-series? i.e. I only want to add a last-10 days sequence to the input if the latest closing price is 2 std away from the historic mean (breaches Bollinger Band). Or also if I wanted to add data from other stocks.
Adam W
Nice progress - figured you would run into this issue soon as it's one of the nuances with financial data and what makes algorithmic trading challenging 😊
Couple of suggestions:
Eric Kao
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!