OPEN-SOURCE SCRIPT
A-Share Broad-Based ETF Dual-Core Timing System

1. Strategy Overview
The "A-Share Broad-Based ETF Dual-Core Timing System" is a quantitative trading strategy tailored for the Chinese A-share market (specifically for broad-based ETFs like CSI 300, CSI 500, STAR 50). Recognizing the market's characteristic of "short bulls, long bears, and sharp bottoms," this strategy employs a "Left-Side Latency + Right-Side Full Position" dual-core driver. It aims to safely bottom-fish during the late stages of a bear market and maximize profits during the main ascending waves of a bull market.
2. Core Logic
A. Left-Side Latency (Rebound/Bottom Fishing)
Capital Allocation: Defaults to 50% position.
Philosophy: "Buy when others fear." Seeks opportunities in extreme panic or momentum divergence.
Entry Signals (Triggered by any of the following):
Extreme Panic: RSI Oversold (<30) + Price below Bollinger Lower Band + Bullish Candle Close (Avoid catching falling knives).
Oversold Bias: Price deviates more than 15% from the 60-day MA (Life Line), betting on mean reversion.
MACD Bullish Divergence: Price makes a new low while MACD histogram does not, accompanied by strengthening momentum.
B. Right-Side Full Position (Trend Following)
Capital Allocation: Aggressively scales up to Full Position (~99%) upon signal trigger.
Philosophy: "Follow the trend." Strike heavily once the trend is confirmed.
Entry Signals (All must be met):
Upward Trend: MACD Golden Cross + Price above 20-day MA.
Breakout Confirmation: CCI indicator breaks above 100, confirming a main ascending wave.
Volume Support: Volume MACD Golden Cross, ensuring price increase is backed by volume.
C. Smart Risk Control
Bear Market Exhaustion Exit: In a bearish trend (MA20 < MA60), the strategy does not "hold and hope." It immediately liquidates left-side positions upon signs of rebound exhaustion (breaking below MA20, touching MA60 resistance, or RSI failure).
ATR Trailing Stop: Uses Average True Range (ATR) to calculate a dynamic stop-profit line that rises with the price to lock in profits.
Hard Stop Loss: Forces a stop-loss if the left-side bottom fishing fails and losses exceed a set ATR multiple, preventing deep drawdowns.
3. Recommendations
Target Assets: High liquidity broad-based ETFs such as CSI 300 ETF (510300), CSI 500 ETF (510500), ChiNext ETF (159915), STAR 50 ETF (588000).
Timeframe: Daily Chart.
The "A-Share Broad-Based ETF Dual-Core Timing System" is a quantitative trading strategy tailored for the Chinese A-share market (specifically for broad-based ETFs like CSI 300, CSI 500, STAR 50). Recognizing the market's characteristic of "short bulls, long bears, and sharp bottoms," this strategy employs a "Left-Side Latency + Right-Side Full Position" dual-core driver. It aims to safely bottom-fish during the late stages of a bear market and maximize profits during the main ascending waves of a bull market.
2. Core Logic
A. Left-Side Latency (Rebound/Bottom Fishing)
Capital Allocation: Defaults to 50% position.
Philosophy: "Buy when others fear." Seeks opportunities in extreme panic or momentum divergence.
Entry Signals (Triggered by any of the following):
Extreme Panic: RSI Oversold (<30) + Price below Bollinger Lower Band + Bullish Candle Close (Avoid catching falling knives).
Oversold Bias: Price deviates more than 15% from the 60-day MA (Life Line), betting on mean reversion.
MACD Bullish Divergence: Price makes a new low while MACD histogram does not, accompanied by strengthening momentum.
B. Right-Side Full Position (Trend Following)
Capital Allocation: Aggressively scales up to Full Position (~99%) upon signal trigger.
Philosophy: "Follow the trend." Strike heavily once the trend is confirmed.
Entry Signals (All must be met):
Upward Trend: MACD Golden Cross + Price above 20-day MA.
Breakout Confirmation: CCI indicator breaks above 100, confirming a main ascending wave.
Volume Support: Volume MACD Golden Cross, ensuring price increase is backed by volume.
C. Smart Risk Control
Bear Market Exhaustion Exit: In a bearish trend (MA20 < MA60), the strategy does not "hold and hope." It immediately liquidates left-side positions upon signs of rebound exhaustion (breaking below MA20, touching MA60 resistance, or RSI failure).
ATR Trailing Stop: Uses Average True Range (ATR) to calculate a dynamic stop-profit line that rises with the price to lock in profits.
Hard Stop Loss: Forces a stop-loss if the left-side bottom fishing fails and losses exceed a set ATR multiple, preventing deep drawdowns.
3. Recommendations
Target Assets: High liquidity broad-based ETFs such as CSI 300 ETF (510300), CSI 500 ETF (510500), ChiNext ETF (159915), STAR 50 ETF (588000).
Timeframe: Daily Chart.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.