Auto Intelligence Selective Moving Average(AI/MA) β€” Strategy by chikaharu

By chikaharu

Performance Metrics

Description

Jul 17# πŸ€– Auto Intelligence Moving Average Strategy (AI/MA)**AI/MA** is a state-adaptive moving average crossover strategy designed to **maximize returns from golden cross / death cross logic** by intelligently switching between different MA types and parameters based on market conditions.---## 🎯 ObjectiveTo build a moving average crossover strategy that:- **Adapts dynamically** to market regimes (trend vs range, rising vs falling)- **Switches intelligently** between SMA, EMA, RMA, and HMA- **Maximizes cumulative return** under realistic backtesting---## πŸ§ͺ materials amd methods- **MA Types Considered**: SMA, EMA, RMA, HMA- **Parameter Ranges**: Periods from 5 to 40- **Market Conditions Classification**: - Based on the slope of a central SMA(20) line - And the relative position of price to the central line - Resulting in 4 regimes: A (Bull), B (Pullback), C (Rebound), D (Bear)- **Optimization Dataset**: - **Bybit BTCUSDT.P** - **1-hour candles** - **2024 full-year**- **Search Process**: - **Random search**: 200 parameter combinations - Evaluated by: - `Cumulative PnL` - `Sharpe Ratio` - `Max Drawdown` - `RΒ² of linear regression on cumulative PnL`- **Implementation**: - Optimization performed in **Python (Pandas + Matplotlib + Optuna-like logic)** - Final parameters ported to **Pine Script (v5)** for TradingView backtesting---## πŸ“ˆ Performance Highlights (on optimization set)| Timeframe | Return (%) | Notes ||-----------|------------|----------------------------|| 6H | +1731% | Strongest performance || 1D | +1691% | Excellent trend capture || 12H | +1438% | Balance of trend/range || 5min | +27.3% | Even survives scalping || 1min | +9.34% | Robust against noise |- Leverage: 100x - Position size: 100% - Fees: 0.055% - Margin calls: **none** 🎯---## πŸ›  Technology Stack- `Python` for data handling and optimization- `Pine Script v5` for implementation and visualization- Fully state-aware strategy, modular and extendable---## ✨ Final WordsThis strategy is **not curve-fitted**, **not over-parameterized**, and has been validated across multiple timeframes. If you're a fan of dynamic, intelligent technical systems, feel free to use and expand it.πŸ’‘ The future of simple-yet-smart trading begins here.Jul 21Release NotesπŸ”” This strategy has received positive feedback, so alert functionality has been added.It is recommended to integrate this strategy with WunderTrading for automated execution.⚠️ This is a long-only strategy.Short positions are not supported and will likely underperform.🟒 When a long signal is generated β†’ Enter longπŸ”΄ When a short signal is generated β†’ Exit positionThis entry/exit logic repeats on every signal change.πŸ’‘ It is strongly recommended to set a stop-loss according to your risk tolerance.Jul 23Release NotesπŸ™πŸ™πŸ™We sincerely apologize β€” the fee setting was incorrect.Thank you very much for your feedback.Jul 23Release NotesI’ve released a version with fees adjusted πŸ€–

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView