OPEN-SOURCE SCRIPT
Supertrend By GemScope

Supertrend by GemScope – Strategy Summary
This is an **automated trading strategy (Pine Script v5)** based on the **Supertrend indicator**, enhanced with **EMA filtering**, **percentage-based stop loss**, and **visual trade analytics**.
---
### 🔹 Core Strategy Logic
* Uses **Supertrend (ATR-based)** to detect market trend direction
* Trades **trend reversals and confirmations**
* Works on **both long and short positions**, or restricted to one side
---
### 🔹 Trade Direction Options
* **Both Long & Short**
* **Long Only**
* **Short Only**
---
### 🔹 Entry Conditions
#### 🟢 Long Entry
* Supertrend flips to **bullish**
* OR price crosses **above EMA 200**
* Long trades are allowed by settings
* If enabled: **price must be above EMA 200**
* Supertrend must confirm **uptrend**
#### 🔴 Short Entry
* Supertrend flips to **bearish**
* Short trades are allowed by settings
---
### 🔹 Position Sizing
* Trade size is defined in **USD**
* Quantity is calculated automatically based on market price
* Quantity rounding is user-configurable
---
### 🔹 Stop Loss (Risk Management)
* **Fixed percentage stop loss**
* Automatically placed after entry
* Works for both long and short positions
* No take-profit levels (trend-based exits instead)
---
### 🔹 Exit Logic
* **Short positions close** when:
* Supertrend turns bullish
* Price moves above EMA 200
* **Long positions close** when:
* Supertrend gives a short signal
---
### 🔹 Trend Protection
* Optional protection to **avoid closing shorts prematurely below EMA 200**
* EMA 200 acts as a **trend filter and support/resistance**
---
### 🔹 Visual Features
* **EMA 200** plotted on chart
* **Supertrend line** with color-coded direction
* Real-time **entry & P&L labels** displayed on the right side
* Indicator dashboard (RSI, MACD, ADX, ATR) shown in a table
---
### 🔹 Indicator Table Purpose
* Shows **market strength and bias**
* Helps identify whether **long or short positions are favored**
* Uses:
* RSI (momentum)
* MACD (trend direction)
* ADX (trend strength)
* ATR (volatility)
---
### 🔹 Overall Objective
This strategy is designed to:
* Trade **strong trends**
* Filter false signals using EMA 200
* Control risk with **strict percentage stop loss**
* Provide **clear visual feedback** for decision-making
This is an **automated trading strategy (Pine Script v5)** based on the **Supertrend indicator**, enhanced with **EMA filtering**, **percentage-based stop loss**, and **visual trade analytics**.
---
### 🔹 Core Strategy Logic
* Uses **Supertrend (ATR-based)** to detect market trend direction
* Trades **trend reversals and confirmations**
* Works on **both long and short positions**, or restricted to one side
---
### 🔹 Trade Direction Options
* **Both Long & Short**
* **Long Only**
* **Short Only**
---
### 🔹 Entry Conditions
#### 🟢 Long Entry
* Supertrend flips to **bullish**
* OR price crosses **above EMA 200**
* Long trades are allowed by settings
* If enabled: **price must be above EMA 200**
* Supertrend must confirm **uptrend**
#### 🔴 Short Entry
* Supertrend flips to **bearish**
* Short trades are allowed by settings
---
### 🔹 Position Sizing
* Trade size is defined in **USD**
* Quantity is calculated automatically based on market price
* Quantity rounding is user-configurable
---
### 🔹 Stop Loss (Risk Management)
* **Fixed percentage stop loss**
* Automatically placed after entry
* Works for both long and short positions
* No take-profit levels (trend-based exits instead)
---
### 🔹 Exit Logic
* **Short positions close** when:
* Supertrend turns bullish
* Price moves above EMA 200
* **Long positions close** when:
* Supertrend gives a short signal
---
### 🔹 Trend Protection
* Optional protection to **avoid closing shorts prematurely below EMA 200**
* EMA 200 acts as a **trend filter and support/resistance**
---
### 🔹 Visual Features
* **EMA 200** plotted on chart
* **Supertrend line** with color-coded direction
* Real-time **entry & P&L labels** displayed on the right side
* Indicator dashboard (RSI, MACD, ADX, ATR) shown in a table
---
### 🔹 Indicator Table Purpose
* Shows **market strength and bias**
* Helps identify whether **long or short positions are favored**
* Uses:
* RSI (momentum)
* MACD (trend direction)
* ADX (trend strength)
* ATR (volatility)
---
### 🔹 Overall Objective
This strategy is designed to:
* Trade **strong trends**
* Filter false signals using EMA 200
* Control risk with **strict percentage stop loss**
* Provide **clear visual feedback** for decision-making
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.