OPEN-SOURCE SCRIPT
Pro SMA Trend Strategy

Title: Pro SMA Trend Strategy (with Dynamic Leverage & Direction Control)
Overview
The Pro SMA Trend Strategy is a clean, highly customizable, and visually intuitive trend-following system designed specifically for Bitcoin (BTC) on the Daily timeframe, though it can be adapted to any asset. By utilizing a Simple Moving Average (SMA) crossover system, this strategy captures major macro trends while keeping your charts looking professional and uncluttered.
How It Works
The core logic is simple but powerful:
Long Condition: A Buy signal is triggered when the daily candle closes above the chosen SMA.
Short Condition: A Short signal is triggered when the daily candle closes below the chosen SMA.
Key Features
Asymmetric Dynamic Leverage: Not all trends are created equal. This script allows you to set independent leverage profiles for your trades. By default, it is set to 2x for Longs and 1x for Shorts, allowing you to capitalize heavier on upward momentum while playing defensive on the way down.
Trade Direction Toggles: Easily switch between trading environments. You can set the script to trade "Both" ways, "Long Only" (closes longs if the trend flips, but won't short), or "Short Only".
Fully Customizable SMA: The length of the Simple Moving Average is 100% adjustable in the settings. You can quickly switch between popular institutional lengths or custom inputs like 11, 37, 44, 58, or 125.
Professional UI & Visuals: No messy charts. The indicator includes:
A dynamically colored SMA line (Teal for Bullish, Red for Bearish).
Clean, highly visible "BUY" and "SHORT" chart labels precisely where execution happens.
Subtle background shading to instantly identify the current macro-trend zone.
Settings Guide
Once applied to your chart, click the Gear Icon (⚙️) to access the following inputs:
Trade Direction: Choose between Both, Long Only, or Short Only.
Long Leverage: Adjust your long multiplier (e.g., 2.0 = 2x your total equity).
Short Leverage: Adjust your short multiplier (e.g., 1.0 = 1x your total equity).
SMA Length: Input your preferred moving average period.
Best Practices
Designed for the Daily (1D) chart on BTC. Since this is a trend-following system, it thrives in directional markets. Slippage and commissions are deliberately left out of the code so you can test the raw, pure mathematical edge of the strategy before applying exchange-specific fees.
Overview
The Pro SMA Trend Strategy is a clean, highly customizable, and visually intuitive trend-following system designed specifically for Bitcoin (BTC) on the Daily timeframe, though it can be adapted to any asset. By utilizing a Simple Moving Average (SMA) crossover system, this strategy captures major macro trends while keeping your charts looking professional and uncluttered.
How It Works
The core logic is simple but powerful:
Long Condition: A Buy signal is triggered when the daily candle closes above the chosen SMA.
Short Condition: A Short signal is triggered when the daily candle closes below the chosen SMA.
Key Features
Asymmetric Dynamic Leverage: Not all trends are created equal. This script allows you to set independent leverage profiles for your trades. By default, it is set to 2x for Longs and 1x for Shorts, allowing you to capitalize heavier on upward momentum while playing defensive on the way down.
Trade Direction Toggles: Easily switch between trading environments. You can set the script to trade "Both" ways, "Long Only" (closes longs if the trend flips, but won't short), or "Short Only".
Fully Customizable SMA: The length of the Simple Moving Average is 100% adjustable in the settings. You can quickly switch between popular institutional lengths or custom inputs like 11, 37, 44, 58, or 125.
Professional UI & Visuals: No messy charts. The indicator includes:
A dynamically colored SMA line (Teal for Bullish, Red for Bearish).
Clean, highly visible "BUY" and "SHORT" chart labels precisely where execution happens.
Subtle background shading to instantly identify the current macro-trend zone.
Settings Guide
Once applied to your chart, click the Gear Icon (⚙️) to access the following inputs:
Trade Direction: Choose between Both, Long Only, or Short Only.
Long Leverage: Adjust your long multiplier (e.g., 2.0 = 2x your total equity).
Short Leverage: Adjust your short multiplier (e.g., 1.0 = 1x your total equity).
SMA Length: Input your preferred moving average period.
Best Practices
Designed for the Daily (1D) chart on BTC. Since this is a trend-following system, it thrives in directional markets. Slippage and commissions are deliberately left out of the code so you can test the raw, pure mathematical edge of the strategy before applying exchange-specific fees.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.