Ch. 20Strategy #685

Strategy #685

Machine Learning Signal Trade

Entry Logic

  • Long entry is triggered when a trained machine learning model (e.g., a gradient boosting model) predicts a positive return for the next period.
  • Short entry is triggered when the model predicts a negative return.
  • Confirmation requires the model's prediction probability to be above a certain threshold (e.g., 70%).
  • Timeframe is determined by the model's training data (e.g., daily, hourly).
  • Location context is not explicitly used, as the model incorporates various features.
  • Market condition is factored into the model through relevant features.

Exit Logic

  • Profit target is a fixed percentage gain (e.g., 5%) or when the model generates an exit signal.
  • Scaling out can be done at multiple profit targets.
  • Trailing stop can be used, such as a percentage-based trail.
  • Exit on signal failure if the model's prediction is wrong and the price moves against the position.
  • Exit on opposite signal when the model generates a signal in the opposite direction.
  • Exit on time expiration after a predetermined holding period.
  • Exit on momentum loss if the price stalls or reverses.

Stop Loss Structure

  • Hard stop is a fixed percentage loss (e.g., 2%).
  • Soft stop is not used.
  • Maximum dollar loss is defined per trade.
  • Maximum percent loss is a set percentage of the account.
  • Structural stop is not typically used.

Risk Management Framework

  • Risk per trade is a fixed percentage of the account.
  • Maximum daily loss limit is enforced.
  • Maximum weekly loss limit is in place.
  • Maximum drawdown is monitored and controlled.
  • Risk-reward ratio is evaluated based on the model's historical performance.

Position Sizing Model

  • Sizing can be fixed fractional or based on the model's confidence in the prediction.
  • Volatility adjustment can be incorporated into the sizing model.
  • Conviction sizing is based on the model's prediction probability.
  • Scaling in can be done if the model's confidence increases.
  • Scaling out is performed at predefined profit levels.

Trade Filtering

  • The model itself acts as a filter, only generating signals when specific conditions are met.
  • Avoid trading during highly uncertain market conditions that the model was not trained on.
  • Instrument requirements are based on the model's training data.
  • Time of day restrictions can be incorporated as features in the model.
  • News avoidance can be implemented by pausing trading around major announcements.

Context Framework

  • The model learns the context from the features it is trained on.
  • Features can include trend, VWAP, moving averages, and other contextual information.
  • The model determines the importance of each contextual factor.
  • Higher timeframe alignment can be included as a feature.

Trade Management Rules

  • Stop loss can be moved to breakeven after a certain profit is achieved.
  • Scaling out is done at predefined levels.
  • Adding to a position can be done if the model's signal strengthens.
  • The model can be designed to handle both fast and slow market movements.

Time Rules

  • Optimal trading window is determined by the model's historical performance.
  • Times to avoid are those where the model has shown poor performance.
  • Session-specific notes can be incorporated as features.

Setup Classification

  • A+ setup: High probability prediction from the model with confirming technical analysis.
  • A setup: High probability prediction from the model.
  • B setup: Moderate probability prediction.
  • C setup: Low probability prediction (avoid).

Market Selection Criteria

  • Instruments are those that the model has been trained and tested on.
  • Liquidity and volume are important considerations.
  • The model's performance can vary across different market conditions.

Statistical Edge Metrics

  • Expected win rate is based on the model's backtested performance.
  • Average win and loss are derived from backtesting.
  • Profit factor and expectancy are calculated from the backtest results.

Failure Conditions

  • The model can fail if the market regime changes and the model has not been trained on the new conditions (concept drift).
  • Overfitting is a major risk, where the model performs well on historical data but poorly in live trading.
  • Data quality issues can lead to poor model performance.

Psychological Rules

  • Must trust the model and avoid overriding its signals based on emotion.
  • Continuously monitor the model's performance and be prepared to retrain or disable it if necessary.
  • Understand that the model is a tool and not a crystal ball.

Advanced Components

  • Feature engineering is a critical component of building a successful machine learning model.
  • Regularization techniques are used to prevent overfitting.
  • Ensemble methods, such as random forests and gradient boosting, can improve performance.
  • The model's performance should be validated on out-of-sample data.

Location

  • The strategy's strength depends on the quality of the model and the data it is trained on.
  • It can be applied to any market, as long as sufficient data is available.
  • The model's performance may be location-dependent (e.g., perform better in certain market conditions).