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
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.