How to Use AI to Analyze a Trading Algorithm for Results
- Capstone Trading
- Jun 17
- 4 min read
We export a trade list from NinjaTrader 8 to analyze the results of the Proteus V6 Gold setup using artificial intelligence to give us feedback and some ideas to improve the strategy. This is an example of how this process could be used. Additional coding and backtesting is the next step in this process.
This was only 3 weeks worth of trades on the Proteus V6 Gold trading algorithm
Some of the ideas that are presented by artificial intelligences are ideas that I have tested many times.
For example, micro-managing exits can deteriorate the average trade profit. In order to overcome slippage and commission, you need higher average trade profit and give the strategy some room.
Profit factors will go lower the higher your frequency of trading. For a strategy that trades as frequently as Proteus, chasing a 1.5 profit factor would require over optimization. Reducing frequency could improve the profit factor.
This is the summary from Chat GPT using the ChatGPB o4-mini-high model with a Plus subscription.
I’ve summarized the key performance metrics of your V6 Gold trades above. Here are the highlights:
Number of Trades: 159
Total Net Profit: $25,790
Average Trade Profit: $162
Median Trade Profit: $1,000
Win Rate: 57.9%
Profit Factor: (interactive table)
Max Drawdown: (interactive table)
Average Drawdown: (interactive table)
Observations & Suggestions
High Median vs. Low Mean• Your median profit ($1,000) is well above the mean ($162), indicating that a small number of large losses are dragging down average trade performance.• Action: Tighten your stop-losses on low-probability setups—consider an ATR-based stop that adapts to current volatility to cut back-breakers faster.
Profit Factor & Loss Clustering• A profit factor below 1.5 (see table) suggests that losing trades erode gains disproportionately.• Action: Add a trend filter (e.g., only take long signals when the daily (or 4-hr) SMA is rising) to avoid trading against the prevailing market momentum.
Drawdown Control• A sizeable max drawdown indicates vulnerability to extended losing streaks.• Action: Implement a drawdown “circuit breaker”—pause new entries if the equity curve falls X% below its prior peak, then only resume once it recovers.
Exit Management• Large swings in MAE vs MFE (see raw data) imply that many winners give back profits.• Action: Introduce a multi-tier exit: lock in partial profits at a first target and move the stop to breakeven, then let the remainder run with a trailing stop.
Entry Signal Refinement• About 42% of trades lose money. There’s room to filter out low-expectancy setups.• Action: Backtest adding a volatility filter (e.g., only enter when ATR(14) is above its 30-period moving average) or require two correlated signals (e.g., volume spike + order-flow imbalance).
Position Sizing & Scaling• Flat sizing on all trades doesn’t account for differing edge.• Action: Use a fixed-fractional sizing method (e.g., risk 1–2% of equity per trade) or scale into positions: start with half size and add on confirmed moves.
Time-of-Day and Session Filters• Some hours may produce lower expectancy.• Action: Analyze performance by hour or session—consider disabling entries in periods of low liquidity or high news noise.
Walk-Forward & Out-of-Sample Testing• To ensure robustness, perform walk-forward optimization on key parameters (stop, target, filters) and validate out-of-sample before committing to live trading.
By cleaning up your stop logic, refining entries with regime filters, and adding structured exits/trailing stops, you should see both higher average trade profits and a reduction in large drawdowns. Let me know if you’d like to dive deeper into any of these optimizations!
Here is another Chat GPT Prompt:
What is the best StartTime and FinishTime for long and short trades.
ChatGPT said:
Thought for 10 seconds
Raw Data Preview
Trade number | Instrument | Account | Strategy |
1 | GC AUG25 | Playback101 | CAPSTONEProteusV6 |
2 | GC AUG25 | Playback101 | CAPSTONEProteusV6 |
3 | GC AUG25 | Playback101 | CAPSTONEProteusV6 |
4 | GC AUG25 | Playback101 | CAPSTONEProteusV6 |
Thought for 24 seconds
Optimal Time Windows by Direction
direction | Start Time | End Time | count |
Long | 11:00 | 19:00 | 22 |
Long | 04:30 | 09:30 | 19 |
Short | 09:30 | 12:30 | 17 |
Short | 09:30 | 12:30 | 17 |
I ran a 30-minute–resolution scan across your full trading session to find which entry windows deliver the highest profit factor (PF) and the highest average trade profit (Avg) for longs versus shorts, subject to a minimum of 20% of your directional trades (or at least 10 trades) in each window. Here’s what emerged:
Direction | Metric | Start Time | End Time | Profit Factor | Avg Trade Profit | |
Long | Highest PF | 11:00 | 19:00 | 22 | 2.36 | $316.82 |
Long | Highest Avg | 04:30 | 09:30 | 19 | 2.17 | $368.42 |
Short | Highest PF | 09:30 | 12:30 | 17 | 4.71 | $585.29 |
Short | Highest Avg | 09:30 | 12:30 | 17 | 4.71 | $585.29 |
Long Trades:
If you target max profit factor, trade longs between 11:00 – 19:00 (11 am–7 pm CT).
If you want the absolute highest average per‐trade profit, shift your longs into the 04:30 – 09:30 window (4:30 am–9:30 am CT), though with slightly lower PF.
Short Trades:
Both PF and average profit peak running shorts from 09:30 – 12:30 (9:30 am–12:30 pm CT).
Recommendations
Segment Your Day
Longs: Consider two regimes—an early‐morning run for maximal per‐trade gains (4:30–9:30) and a late‐session regime for consistency (11:00–19:00).
Shorts: Concentrate short entries in the 9:30–12:30 window when the market has the sharpest, most favorable pullbacks.
Combine with Other Filters
Use your regime filters (e.g. trend on daily chart) alongside these times to further boost edge.
During slower windows outside these windows, either stop trading or down‐size position.
Revalidate Periodically
Rerun this scan quarterly (or after significant volatility regime shifts) to confirm these windows still hold their edge.
Adjust your StartTime/FinishTime inputs as follows:
Long StartTime/FinishTime:• Option 1 (Max PF): 1100–1900• Option 2 (Max Avg): 0430–0930
Short StartTime/FinishTime:• 0930–1230
Let me know if you’d like any help automating these window switches or further slicing by sub‐session!
Comments