PROTECTED SOURCE SCRIPT
自适应移动平均线通道策略

This strategy leverages the Fractal Adaptive Moving Average (FRAMA) to construct dynamic price channels, generating buy (long) and sell (short) signals based on price breakouts.
Signal Generation: Buy Signal: Triggered when price crosses above the upper band (▲).
Sell Signal: Triggered when price crosses below the lower band (▼).
Trading Logic: Long Entry: Opens a position when price breaks above the upper band.
Close Position: Closes long position on a short signal or when the 3% stop-loss is hit.
Visualization: FRAMA line displayed in green (bullish) or orange (bearish).
Candles colored based on trend (green for bullish, red for bearish).
Upper and lower bands plotted in semi-transparent green/orange.
Buy/sell signals marked with arrows (▲ for buy, ▼ for sell).
Use Cases Ideal for trending markets (e.g., stocks, futures, forex).
Applicable across timeframes (e.g., 1-minute, 1-hour, daily), with parameter tuning recommended.
Operating InstructionsAdding the Strategy Copy and paste the code into TradingView’s Pine Script editor and save.
Add to chart: Click “Add to Chart” to overlay the strategy on the price chart.
Parameter Settings Source: Select the price data type (e.g., “close,” “hl2,” default: “close”).
Average Length: Set the FRAMA calculation period (default: 50, adjust based on timeframe).
RAA Multiplier: Controls channel width (default: 1.15, higher values widen the channel).
Show Trend Signals: Enable to display buy/sell signals on the chart (default: enabled).
Color Candles Based on Trend: Enable to color candles by trend (default: enabled).
Bullish/Bearish Candle Color: Customize candle colors (default: green for bullish, red for bearish).
Chart Output FRAMA Line: Shows the adaptive average, green for bullish trends, orange for bearish.
Upper/Lower Bands: Semi-transparent green (upper) and orange (lower) bands indicate price range.
Signal Markers: Buy signals (green ▲ below bars) and sell signals (red ▼ above bars).
Candle Coloring: Bullish candles in green, bearish in red.
Trading Execution Automated Trading: Enable in TradingView’s Strategy Tester to execute trades based on signals.
Stop-Loss: Fixed at 3% below entry price for long positions.
Initial Capital: Default set to 100,000 (adjustable as needed).
Backtesting and Optimization Review performance metrics (win rate, profit factor, drawdown) in the Strategy Tester.
Optimize parameters based on market and timeframe: Short timeframes (e.g., 1-minute): Reduce length (e.g., 10–20).
High-volatility markets: Increase raa_mult (e.g., 1.5–2.0).
Signal Generation: Buy Signal: Triggered when price crosses above the upper band (▲).
Sell Signal: Triggered when price crosses below the lower band (▼).
Trading Logic: Long Entry: Opens a position when price breaks above the upper band.
Close Position: Closes long position on a short signal or when the 3% stop-loss is hit.
Visualization: FRAMA line displayed in green (bullish) or orange (bearish).
Candles colored based on trend (green for bullish, red for bearish).
Upper and lower bands plotted in semi-transparent green/orange.
Buy/sell signals marked with arrows (▲ for buy, ▼ for sell).
Use Cases Ideal for trending markets (e.g., stocks, futures, forex).
Applicable across timeframes (e.g., 1-minute, 1-hour, daily), with parameter tuning recommended.
Operating InstructionsAdding the Strategy Copy and paste the code into TradingView’s Pine Script editor and save.
Add to chart: Click “Add to Chart” to overlay the strategy on the price chart.
Parameter Settings Source: Select the price data type (e.g., “close,” “hl2,” default: “close”).
Average Length: Set the FRAMA calculation period (default: 50, adjust based on timeframe).
RAA Multiplier: Controls channel width (default: 1.15, higher values widen the channel).
Show Trend Signals: Enable to display buy/sell signals on the chart (default: enabled).
Color Candles Based on Trend: Enable to color candles by trend (default: enabled).
Bullish/Bearish Candle Color: Customize candle colors (default: green for bullish, red for bearish).
Chart Output FRAMA Line: Shows the adaptive average, green for bullish trends, orange for bearish.
Upper/Lower Bands: Semi-transparent green (upper) and orange (lower) bands indicate price range.
Signal Markers: Buy signals (green ▲ below bars) and sell signals (red ▼ above bars).
Candle Coloring: Bullish candles in green, bearish in red.
Trading Execution Automated Trading: Enable in TradingView’s Strategy Tester to execute trades based on signals.
Stop-Loss: Fixed at 3% below entry price for long positions.
Initial Capital: Default set to 100,000 (adjustable as needed).
Backtesting and Optimization Review performance metrics (win rate, profit factor, drawdown) in the Strategy Tester.
Optimize parameters based on market and timeframe: Short timeframes (e.g., 1-minute): Reduce length (e.g., 10–20).
High-volatility markets: Increase raa_mult (e.g., 1.5–2.0).
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。