This is an example of a trading strategy that utilizes a neural network to predict price movements in the S&P 500 stocks
The strategy can be executed in an online environment using Jupiter or JupiterLab on the Quantiacs personal dashboard. To do this, clone the template in your personal account.
To run the strategy locally, you need to install the Quantiacs Toolbox.
-Universe: S&P 500 stocks
-Trading Logic: A neural network predicts the probability of price movements for selected stocks. The strategy takes positions based on these predictions, with exits defined for take profit, stop loss, and holding period limits.
-Indicators Used: Average True Range (ATR), Relative Strength Index (RSI) and candlestick pattern.
-State Management: Utilizes the Quantiacs state management system to maintain and update strategy state across different days.
This strategy uses a stateful approach to manage positions with exits. It operates on S&P 500 stocks, dynamically selects the 15 least volatile and uses feedforward neural network to predict whether the price will rise and create entry trading signals based on predictions. For exit take profit, stop loss, and holding period limits are used.
- Data Loading and Preparation: Load stock data using qndata.stocks.load_spx_data
- Strategy Function: Define the strategy function which computes the weights based on entry and exit signals.
- State Management: Use state to manage positions, model and exits dynamically. Due to the state requirement, this strategy and the exits only work with the multipass
- Backtesting: Use the backtest_ml to evaluate the strategy .