Wyszukaj w skryptach "entry"
ENTRY CONFIRMATION V2An indicator from candle man. Helps determine whether supply and demand zone are truly supply or demand.
Entry Percent: EssamThis Pine Script code is designed to perform the task of computing and showcasing the profit percentage, profit value, and the duration for which a specific asset is held, all in real-time. The script effectively leverages the built-in resources to provide a seamless and robust experience, as it presents the calculated figures in an easily readable format on the chart, without causing any lag or disruptions to the chart.
MA_Script- Entry Point : base on MA20, MA50, MA100, MA200.
- Exit Point : base on stop loss, MA and trailing stop.
sa-strategy with HTF-TSLEntry- based on HA close above HMA confirmation done with ST and HTF ATR
Exit- based on close below ATR which works as trailing SL
[MV] %B with SMA + Volume Based Colored Bars
Entry Signal when %B Crosses with SMA and this is more meaningful if it supports colored bars.
Black Bar when prices go down and volume is bigger than 150% of its average, that indicates us price action is supported by a strong bearish volume
Blue Bar when prices go up and volume bigger than 150% of its average, that indicates us price action is supported by a strong bullish volume
VBC author @KIVANCfr3762
FX Sniper: T3-CCI Strategy - With 100 IndicatorsEntry signal when moving above -100, sell signal when going below 100
Amazing Crossover SystemEntry Rules
BUY when the 5 EMA crosses above the 10 EMA from underneath and the RSI crosses above the 50.0 mark from the bottom.
SELL when the 5 EMA crosses below the 10 EMA from the top and the RSI crosses below the 50.0 mark from the top.
Make sure that the RSI did cross 50.0 from the top or bottom and not just ranging tightly around the level.
How to setup Alert:
1) Add the Amazing Crossover System to your chart via Indicators
2) Find your currency pair
3) Set the timeframe on the chart to 1 hour
4) Press 'Alt + A' (create alert shortcut)
5) Set the following criteria for the alert:
Condition = 'Amazing Crossover System', Plot, ' BUY Signal'
The rest of the alert can be customized to your preferences
5) Repeat steps 1 - 4, but set the Condition = 'Amazing Crossover System', Plot, ' SELL Signal'
CRT + SMC MY//@version=5
indicator("CRT + SMC MultiTF (Fixed Requests)", overlay=true, max_labels_count=500, max_boxes_count=200)
// ---------------- INPUTS ----------------
htfTF = input.string("60", title="HTF timeframe (60=1H, 240=4H)")
midTF = input.string("5", title="Mid timeframe (5 or 15)")
execTF = input.string("1", title="Exec timeframe (1 for sniper)")
useMAfilter = input.bool(true, "Require HTF MA filter")
htf_ma_len = input.int(50, "HTF MA length")
showOB = input.bool(true, "Show Order Blocks (midTF)")
showFVG = input.bool(true, "Show Fair Value Gaps (execTF)")
showEntries = input.bool(true, "Show Entry arrows & SL/TP")
slBuffer = input.int(3, "SL buffer (ticks)")
rrTarget = input.float(4.0, "Default R:R target")
useKillzone = input.bool(false, "Use London/NY Killzone (approx NY-5 timezone)")
// ---------------- REQUESTS (ALL at top-level) ----------------
// HTF series
htf_open = request.security(syminfo.tickerid, htfTF, open)
htf_high = request.security(syminfo.tickerid, htfTF, high)
htf_low = request.security(syminfo.tickerid, htfTF, low)
htf_close = request.security(syminfo.tickerid, htfTF, close)
htf_ma = request.security(syminfo.tickerid, htfTF, ta.sma(close, htf_ma_len))
htf_prev_high = request.security(syminfo.tickerid, htfTF, high )
htf_prev_low = request.security(syminfo.tickerid, htfTF, low )
// midTF series for OB detection
mid_open = request.security(syminfo.tickerid, midTF, open)
mid_high = request.security(syminfo.tickerid, midTF, high)
mid_low = request.security(syminfo.tickerid, midTF, low)
mid_close = request.security(syminfo.tickerid, midTF, close)
mid_median_body = request.security(syminfo.tickerid, midTF, ta.median(math.abs(close - open), 8))
// execTF series for FVG and micro structure
exec_high = request.security(syminfo.tickerid, execTF, high)
exec_low = request.security(syminfo.tickerid, execTF, low)
exec_open = request.security(syminfo.tickerid, execTF, open)
exec_close = request.security(syminfo.tickerid, execTF, close)
// Also get shifted values needed for heuristics (all top-level)
exec_high_1 = request.security(syminfo.tickerid, execTF, high )
exec_high_2 = request.security(syminfo.tickerid, execTF, high )
exec_low_1 = request.security(syminfo.tickerid, execTF, low )
exec_low_2 = request.security(syminfo.tickerid, execTF, low )
mid_low_1 = request.security(syminfo.tickerid, midTF, low )
mid_high_1 = request.security(syminfo.tickerid, midTF, high )
// ---------------- HTF logic ----------------
htf_ma_bias_long = htf_close > htf_ma
htf_ma_bias_short = htf_close < htf_ma
htf_sweep_high = (htf_high > htf_prev_high) and (htf_close < htf_prev_high)
htf_sweep_low = (htf_low < htf_prev_low) and (htf_close > htf_prev_low)
htf_final_long = htf_sweep_low and (not useMAfilter or htf_ma_bias_long)
htf_final_short = htf_sweep_high and (not useMAfilter or htf_ma_bias_short)
// HTF label (single label updated)
var label htf_label = na
if barstate.islast
label.delete(htf_label)
if htf_final_long
htf_label := label.new(bar_index, high, "HTF BIAS: LONG", style=label.style_label_left, color=color.green, textcolor=color.white)
else if htf_final_short
htf_label := label.new(bar_index, low, "HTF BIAS: SHORT", style=label.style_label_left, color=color.red, textcolor=color.white)
// ---------------- midTF OB detection (heuristic) ----------------
mid_body = math.abs(mid_close - mid_open)
is_bear_mid = (mid_open > mid_close) and (mid_body >= mid_median_body)
is_bull_mid = (mid_open < mid_close) and (mid_body >= mid_median_body)
mid_bear_disp = is_bear_mid and (mid_low < mid_low_1)
mid_bull_disp = is_bull_mid and (mid_high > mid_high_1)
// Store last OB values (safe top-level assignments)
var float last_bear_ob_top = na
var float last_bear_ob_bot = na
var int last_bear_ob_time = na
var float last_bull_ob_top = na
var float last_bull_ob_bot = na
var int last_bull_ob_time = na
if mid_bear_disp
last_bear_ob_top := mid_open
last_bear_ob_bot := mid_close
last_bear_ob_time := timenow
if mid_bull_disp
last_bull_ob_top := mid_close
last_bull_ob_bot := mid_open
last_bull_ob_time := timenow
// Draw OB boxes (draw always but can be toggled)
if showOB
if not na(last_bear_ob_top)
box.new(bar_index - 1, last_bear_ob_top, bar_index + 1, last_bear_ob_bot, border_color=color.new(color.red,0), bgcolor=color.new(color.red,85))
if not na(last_bull_ob_top)
box.new(bar_index - 1, last_bull_ob_top, bar_index + 1, last_bull_ob_bot, border_color=color.new(color.green,0), bgcolor=color.new(color.green,85))
// ---------------- execTF FVG detection (top-level logic) ----------------
// simple 3-candle gap heuristic
bull_fvg_local = exec_low_2 > exec_high_1
bear_fvg_local = exec_high_2 < exec_low_1
// Compute FVG box coords at top-level
fvg_bull_top = exec_high_1
fvg_bull_bot = exec_low_2
fvg_bear_top = exec_high_2
fvg_bear_bot = exec_low_1
if showFVG
if bull_fvg_local
box.new(bar_index - 2, fvg_bull_top, bar_index, fvg_bull_bot, border_color=color.new(color.green,0), bgcolor=color.new(color.green,85))
if bear_fvg_local
box.new(bar_index - 2, fvg_bear_top, bar_index, fvg_bear_bot, border_color=color.new(color.red,0), bgcolor=color.new(color.red,85))
// ---------------- micro structure on execTF ----------------
micro_high = exec_high
micro_low = exec_low
micro_high_1 = exec_high_1
micro_low_1 = exec_low_1
micro_bos_long = micro_high > micro_high_1
micro_bos_short = micro_low < micro_low_1
// ---------------- killzone check (top-level) ----------------
kill_ok = true
if useKillzone
hh = hour(time('GMT-5'))
mm = minute(time('GMT-5'))
// London approx
inLondon = (hh > 2 or (hh == 2 and mm >= 45)) and (hh < 5 or (hh == 5 and mm <= 0))
inNY = (hh > 8 or (hh == 8 and mm >= 20)) and (hh < 11 or (hh == 11 and mm <= 30))
kill_ok := inLondon or inNY
// ---------------- Entry logic (top-level boolean decisions) ----------------
hasBullOB = not na(last_bull_ob_top)
hasBearOB = not na(last_bear_ob_top)
entryLong = htf_final_long and hasBullOB and micro_bos_long and bull_fvg_local and kill_ok
entryShort = htf_final_short and hasBearOB and micro_bos_short and bear_fvg_local and kill_ok
// ---------------- SL / TP suggestions and plotting ----------------
var label lastEntryLabel = na
if entryLong or entryShort
entryPrice = close
suggestedSL = entryLong ? (htf_low - slBuffer * syminfo.mintick) : (htf_high + slBuffer * syminfo.mintick)
slDist = math.abs(entryPrice - suggestedSL)
suggestedTP = entryLong ? (entryPrice + slDist * rrTarget) : (entryPrice - slDist * rrTarget)
if showEntries
label.delete(lastEntryLabel)
lastEntryLabel := label.new(bar_index, entryPrice, entryLong ? "ENTRY LONG" : "ENTRY SHORT", style=label.style_label_center, color=entryLong ? color.green : color.red, textcolor=color.white)
line.new(bar_index, suggestedSL, bar_index + 20, suggestedSL, color=color.orange, style=line.style_dashed)
line.new(bar_index, suggestedTP, bar_index + 40, suggestedTP, color=color.aqua, style=line.style_dashed)
plotshape(entryLong, title="Entry Long", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(entryShort, title="Entry Short", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
alertcondition(entryLong, title="CRT SMC Entry Long", message="Entry Long — HTF bias + midTF OB + execTF confirmation")
alertcondition(entryShort, title="CRT SMC Entry Short", message="Entry Short — HTF bias + midTF OB + execTF confirmation")
Algoticks.in: Bollinger Bands Strategy (Sample)Bollinger Bands Strategy - User Guide
Overview
This is a Mean Reversion strategy using Bollinger Bands. It generates trading signals when price moves outside the bands and then crosses back, or simply crosses the bands depending on the logic. It integrates with Algoticks.in API for automated trading on Delta Exchange.
Strategy Logic
Long Signal: When Price crosses below the Lower Band (Oversold / Dip Buy)
Short Signal: When Price crosses above the Upper Band (Overbought / Top Sell)
Automatically closes opposite positions before entering new ones
Quick Setup
1. Add to TradingView
Open TradingView and go to the chart
Click "Pine Editor" at the bottom
Paste the script code
Click "Add to Chart"
2. Configure Strategy Parameters
Strategy Settings
Length (default: 20): The lookback period for the SMA basis
StdDev (default: 2.0): The number of standard deviations for the bands
General API Settings
Paper Trading : Enable for testing without real money
Signal Type : Choose "Trading Signal" (default) for tracking
Exchange : DELTA (Delta Exchange)
Segment :
futures - Perpetual contracts
options - Call/Put options
spot - Spot trading
Order Settings: Basic
Quantity : Number of contracts (e.g., 1, 0.5, 2)
Validity :
GTC - Good Till Cancelled
IOC - Immediate or Cancel
FOK - Fill or Kill
DAY - Day order
Product : cross_margin or isolated_margin
Order Settings: Entry Type
Choose how orders are executed:
Market Order : Immediate fill at best price
Limit Order : Fill at specified price or better
Stop Market : Triggers at stop price, then market order
Stop Limit : Triggers at stop price, then limit order
Entry Prices (for Limit/Stop orders)
Limit Price:
Price : The value to use
Type : Last Price / Mark Price / Index Price
Mode :
Absolute - Exact price (e.g., 65000)
Relative - Offset from entry price
% Checkbox : If checked, relative uses percentage; if unchecked, uses points
Example:
Absolute: 65000 → Order at exactly 65000
Relative 1% (checked): Entry ± 1% of entry price
Relative 100 (unchecked): Entry ± 100 points
Trigger Price: Same logic as Limit Price, used for Stop orders
Exit / Bracket Prices (SL/TP)
Stop Loss (SL):
Type : Price type to monitor (Mark Price recommended)
Mode : Absolute or Relative
% : Percentage or points
SL : Stop loss value (e.g., 2 for 2%)
Trig : Optional trigger price (creates Stop-Limit SL)
Take Profit (TP): Same structure as SL
Example:
Long entry at 65000, SL = 2% → Exit at 63700 (65000 - 2%)
Short entry at 65000, TP = 3% → Exit at 63050 (65000 - 3%)
3. Options Trading Setup (Only if Segment = Options)
Strike Selection Method
User Defined Mode:
Manually specify exact strike and option type
Best for: Trading specific levels
Required fields:
Strike Price : e.g., "65000"
Option Type : Call or Put
Dynamic Mode:
System calculates strike based on ATM price
Best for: Automated strategies
Required fields:
Algo Type : Options Buying or Selling
Strike Offset : 0 (ATM), +1 (above ATM), -1 (below ATM)
Strike Interval : Gap between strikes (e.g., BTC: 500, ETH: 50)
Expiry Date Formats:
T+0 - Today
T+1 - Tomorrow
current week - This Friday
next week - Next Friday
current month - Last Friday of month
131125 - Specific date (13 Nov 2025)
4. Create Alert for Automation
Right-click on chart → "Add Alert"
Condition : Select your strategy name
Alert Actions : Webhook URL
Webhook URL : Your Algoticks.in API endpoint
Message : Leave as {{strategy.order.alert_message}} (contains JSON)
Click "Create"
The alert will automatically send JSON payloads to your API when signals occur.
Example Configurations
Standard Mean Reversion
Strategy: Length = 20, StdDev = 2.0
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1% (Relative)
TP: 2% (Relative)
Wide Band Reversal
Strategy: Length = 20, StdDev = 2.5
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1.5% (Relative)
TP: 3% (Relative)
Important Notes
Paper Trading First : Always test with paper trading enabled before live trading
Order Tags : Automatically generated for tracking (max 18 chars)
Position Management : Strategy closes opposite positions automatically
Signal Confirmation : Uses barstate.isconfirmed to prevent repainting
JSON Payload : All settings are converted to JSON and sent via webhook
Troubleshooting
No signals : Check if price is actually touching the bands
Orders not executing : Verify webhook URL and API credentials
Wrong strikes : Double-check Strike Interval for your asset
SL Bollinger Bands Strategy - User Guide
Overview
This is a Mean Reversion strategy using Bollinger Bands. It generates trading signals when price moves outside the bands and then crosses back, or simply crosses the bands depending on the logic. It integrates with Algoticks.in API for automated trading on Delta Exchange.
Strategy Logic
Long Signal: When Price crosses below the Lower Band (Oversold / Dip Buy)
Short Signal: When Price crosses above the Upper Band (Overbought / Top Sell)
Automatically closes opposite positions before entering new ones
Quick Setup
1. Add to TradingView
Open TradingView and go to the chart
Click "Pine Editor" at the bottom
Paste the script code
Click "Add to Chart"
2. Configure Strategy Parameters
Strategy Settings
Length (default: 20): The lookback period for the SMA basis
StdDev (default: 2.0): The number of standard deviations for the bands
General API Settings
Paper Trading : Enable for testing without real money
Signal Type : Choose "Trading Signal" (default) for tracking
Exchange : DELTA (Delta Exchange)
Segment :
futures - Perpetual contracts
options - Call/Put options
spot - Spot trading
Order Settings: Basic
Quantity : Number of contracts (e.g., 1, 0.5, 2)
Validity :
GTC - Good Till Cancelled
IOC - Immediate or Cancel
FOK - Fill or Kill
DAY - Day order
Product : cross_margin or isolated_margin
Order Settings: Entry Type
Choose how orders are executed:
Market Order : Immediate fill at best price
Limit Order : Fill at specified price or better
Stop Market : Triggers at stop price, then market order
Stop Limit : Triggers at stop price, then limit order
Entry Prices (for Limit/Stop orders)
Limit Price:
Price : The value to use
Type : Last Price / Mark Price / Index Price
Mode :
Absolute - Exact price (e.g., 65000)
Relative - Offset from entry price
% Checkbox : If checked, relative uses percentage; if unchecked, uses points
Example:
Absolute: 65000 → Order at exactly 65000
Relative 1% (checked): Entry ± 1% of entry price
Relative 100 (unchecked): Entry ± 100 points
Trigger Price: Same logic as Limit Price, used for Stop orders
Exit / Bracket Prices (SL/TP)
Stop Loss (SL):
Type : Price type to monitor (Mark Price recommended)
Mode : Absolute or Relative
% : Percentage or points
SL : Stop loss value (e.g., 2 for 2%)
Trig : Optional trigger price (creates Stop-Limit SL)
Take Profit (TP): Same structure as SL
Example:
Long entry at 65000, SL = 2% → Exit at 63700 (65000 - 2%)
Short entry at 65000, TP = 3% → Exit at 63050 (65000 - 3%)
3. Options Trading Setup (Only if Segment = Options)
Strike Selection Method
User Defined Mode:
Manually specify exact strike and option type
Best for: Trading specific levels
Required fields:
Strike Price : e.g., "65000"
Option Type : Call or Put
Dynamic Mode:
System calculates strike based on ATM price
Best for: Automated strategies
Required fields:
Algo Type : Options Buying or Selling
Strike Offset : 0 (ATM), +1 (above ATM), -1 (below ATM)
Strike Interval : Gap between strikes (e.g., BTC: 500, ETH: 50)
Expiry Date Formats:
T+0 - Today
T+1 - Tomorrow
current week - This Friday
next week - Next Friday
current month - Last Friday of month
131125 - Specific date (13 Nov 2025)
4. Create Alert for Automation
Right-click on chart → "Add Alert"
Condition : Select your strategy name
Alert Actions : Webhook URL
Webhook URL : Your Algoticks.in API endpoint
Message : Leave as {{strategy.order.alert_message}} (contains JSON)
Click "Create"
The alert will automatically send JSON payloads to your API when signals occur.
Example Configurations
Standard Mean Reversion
Strategy: Length = 20, StdDev = 2.0
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1% (Relative)
TP: 2% (Relative)
Wide Band Reversal
Strategy: Length = 20, StdDev = 2.5
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1.5% (Relative)
TP: 3% (Relative)
Important Notes
Paper Trading First : Always test with paper trading enabled before live trading
Order Tags : Automatically generated for tracking (max 18 chars)
Position Management : Strategy closes opposite positions automatically
Signal Confirmation : Uses barstate.isconfirmed to prevent repainting
JSON Payload : All settings are converted to JSON and sent via webhook
Troubleshooting
No signals : Check if price is actually touching the bands
Orders not executing : Verify webhook URL and API credentials
Wrong strikes : Double-check Strike Interval for your asset
SL
Algoticks.in: RSI StrategyRSI Strategy - User Guide
Overview
This is a Relative Strength Index (RSI) strategy that generates trading signals based on overbought and oversold levels. It integrates with Algoticks.in API for automated trading on Delta Exchange.
Strategy Logic
Long Signal: When RSI crosses above the Oversold level (Mean Reversion / Dip Buy)
Short Signal: When RSI crosses below the Overbought level (Mean Reversion / Top Sell)
Automatically closes opposite positions before entering new ones
Quick Setup
1. Add to TradingView
Open TradingView and go to the chart
Click "Pine Editor" at the bottom
Paste the script code
Click "Add to Chart"
2. Configure Strategy Parameters
Strategy Settings
RSI Length (default: 14): The lookback period for RSI calculation
Overbought Level (default: 70): Level above which the asset is considered overbought
Oversold Level (default: 30): Level below which the asset is considered oversold
General API Settings
Paper Trading : Enable for testing without real money
Signal Type : Choose "Trading Signal" (default) for tracking
Exchange : DELTA (Delta Exchange)
Segment :
futures - Perpetual contracts
options - Call/Put options
spot - Spot trading
Order Settings: Basic
Quantity : Number of contracts (e.g., 1, 0.5, 2)
Validity :
GTC - Good Till Cancelled
IOC - Immediate or Cancel
FOK - Fill or Kill
DAY - Day order
Product : cross_margin or isolated_margin
Order Settings: Entry Type
Choose how orders are executed:
Market Order : Immediate fill at best price
Limit Order : Fill at specified price or better
Stop Market : Triggers at stop price, then market order
Stop Limit : Triggers at stop price, then limit order
Entry Prices (for Limit/Stop orders)
Limit Price:
Price : The value to use
Type : Last Price / Mark Price / Index Price
Mode :
Absolute - Exact price (e.g., 65000)
Relative - Offset from entry price
% Checkbox : If checked, relative uses percentage; if unchecked, uses points
Example:
Absolute: 65000 → Order at exactly 65000
Relative 1% (checked): Entry ± 1% of entry price
Relative 100 (unchecked): Entry ± 100 points
Trigger Price: Same logic as Limit Price, used for Stop orders
Exit / Bracket Prices (SL/TP)
Stop Loss (SL):
Type : Price type to monitor (Mark Price recommended)
Mode : Absolute or Relative
% : Percentage or points
SL : Stop loss value (e.g., 2 for 2%)
Trig : Optional trigger price (creates Stop-Limit SL)
Take Profit (TP): Same structure as SL
Example:
Long entry at 65000, SL = 2% → Exit at 63700 (65000 - 2%)
Short entry at 65000, TP = 3% → Exit at 63050 (65000 - 3%)
3. Options Trading Setup (Only if Segment = Options)
Strike Selection Method
User Defined Mode:
Manually specify exact strike and option type
Best for: Trading specific levels
Required fields:
Strike Price : e.g., "65000"
Option Type : Call or Put
Dynamic Mode:
System calculates strike based on ATM price
Best for: Automated strategies
Required fields:
Algo Type : Options Buying or Selling
Strike Offset : 0 (ATM), +1 (above ATM), -1 (below ATM)
Strike Interval : Gap between strikes (e.g., BTC: 500, ETH: 50)
Expiry Date Formats:
T+0 - Today
T+1 - Tomorrow
current week - This Friday
next week - Next Friday
current month - Last Friday of month
131125 - Specific date (13 Nov 2025)
4. Create Alert for Automation
Right-click on chart → "Add Alert"
Condition : Select your strategy name
Alert Actions : Webhook URL
Webhook URL : Your Algoticks.in API endpoint
Message : Leave as {{strategy.order.alert_message}} (contains JSON)
Click "Create"
The alert will automatically send JSON payloads to your API when signals occur.
Example Configurations
Standard RSI Reversal
Strategy: RSI Length = 14, OB = 70, OS = 30
Segment: futures
Order Type: market_order
Quantity: 1
SL: 1.5% (Relative)
TP: 3% (Relative)
Aggressive Scalping
Strategy: RSI Length = 7, OB = 80, OS = 20
Segment: futures
Order Type: market_order
Quantity: 0.5
SL: 0.5% (Relative)
TP: 1% (Relative)
Important Notes
Paper Trading First : Always test with paper trading enabled before live trading
Order Tags : Automatically generated for tracking (max 18 chars)
Position Management : Strategy closes opposite positions automatically
Signal Confirmation : Uses barstate.isconfirmed to prevent repainting
JSON Payload : All settings are converted to JSON and sent via webhook
Troubleshooting
No signals : Check if RSI is actually reaching your OB/OS levels
Orders not executing : Verify webhook URL and API credentials
Wrong strikes : Double-check Strike Interval for your asset
SL/TP not working : Ensure values are non-zero and mode is correct
Support
For API setup and connector configuration, visit Algoticks.in documentation.
YM Ultimate SNIPER v6# YM Ultimate SNIPER v6 - Documentation & Trading Guide
## 🎯 ORDERFLOW EDITION | Order Blocks + Liquidity Sweeps + IFVG
**TARGET: 3-7 High-Confluence Trades per Day**
**Philosophy: "Zones That Matter"**
---
## ⚡ WHAT'S NEW IN v6
### Major Additions
| Feature | Description | Orderflow Purpose |
|---------|-------------|-------------------|
| **Order Blocks** | Last opposing candle before significant move | Shows where institutions absorbed orders |
| **Liquidity Sweeps** | Sweep of swing H/L with rejection | Identifies stop hunts / trap reversals |
| **IFVG** | Inverse FVG when price reclaims a gap | Failed institutional move = reversal signal |
| **Zone Quality Score** | 0-10 rating for each zone | Only "zones that matter" display |
| **3-Tier Scoring** | Weak/Medium/Excellent classification | Better trade selection |
| **Enhanced Table** | Larger, categorized, color-coded | Instant situation awareness |
### Orderflow Mindset
This version is built around **institutional order flow concepts**:
1. **Institutions leave footprints** → Order Blocks mark where they filled orders
2. **Retail gets trapped** → Liquidity Sweeps show the trap before reversal
3. **Failed moves reverse hard** → IFVG marks failed institutional attempts
4. **Not all zones are equal** → Quality scoring filters noise
---
## 🎯 QUICK REFERENCE
```
┌─────────────────────────────────────────────────────────────────────────┐
│ YM ULTIMATE SNIPER v6 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ SIGNALS: │
│ S🎯 = S-Tier (50+ pts) → HOLD position │
│ A🎯 = A-Tier (25-49 pts) → SWING trade │
│ B🎯 = B-Tier (12-24 pts) → SCALP quick │
│ Z = Zone entry (quality FVG/OB zone) │
│ LS↑ = Bullish Liquidity Sweep (lows swept + rejection) │
│ LS↓ = Bearish Liquidity Sweep (highs swept + rejection) │
│ │
│ ZONES: │
│ 🟦 Blue boxes = Bullish Order Block (buy zone) │
│ 🟪 Pink boxes = Bearish Order Block (sell zone) │
│ 🟩 Green boxes = Bullish FVG (buy zone) │
│ 🟥 Red boxes = Bearish FVG (sell zone) │
│ 🟣 Purple dashed = IFVG (inverse - strong reversal zone) │
│ │
│ SCORE CLASSIFICATION: │
│ EXCELLENT (7.0+) = Full size, high confidence │
│ MEDIUM (4.5-6.9) = Standard size, good setup │
│ WEAK (<4.5) = No signal shown │
│ │
│ SESSIONS (ET): │
│ LDN = 3:00-5:00 AM (London) │
│ NY = 9:30-11:30 AM (New York Open) │
│ PWR = 3:00-4:00 PM (Power Hour) │
│ │
└─────────────────────────────────────────────────────────────────────────┘
```
---
## 📦 ORDER BLOCKS (OB)
### What Are Order Blocks?
Order blocks mark the **last opposing candle before a significant move**. This is where institutional traders absorbed retail orders before moving price in their intended direction.
### Detection Logic (Breaker Style)
```
BULLISH OB:
├── Last BEARISH candle before strong bullish move
├── Move after must be ≥ 1.5x ATR
├── Shows where institutions absorbed selling
└── Expect support when price returns
BEARISH OB:
├── Last BULLISH candle before strong bearish move
├── Move after must be ≥ 1.5x ATR
├── Shows where institutions absorbed buying
└── Expect resistance when price returns
```
### OB Quality Scoring
Each Order Block gets a strength score (0-10) based on:
- **Move strength** after the OB (ATR multiple)
- **Volume** on the OB candle
- **Body ratio** of the OB candle
Only OBs with strength ≥ 4 are displayed.
### Trading Order Blocks
| Scenario | Action |
|----------|--------|
| Price returns to Bull OB + buy delta | Look for LONG |
| Price returns to Bear OB + sell delta | Look for SHORT |
| OB + FVG overlap (thick border) | HIGH PROBABILITY |
| OB tested once (gray) | Still valid, often best entry |
| OB broken (closes through) | Invalidated, removed |
---
## 💎 LIQUIDITY SWEEPS
### What Are Liquidity Sweeps?
A liquidity sweep occurs when price **hunts stop losses** by briefly breaking a swing high/low, then **immediately reverses** back. This is the classic "stop hunt" or "liquidity grab."
### Detection Logic
```
BULLISH SWEEP (LS↑):
├── Price sweeps BELOW a recent swing low
├── Closes BACK ABOVE the swing level
├── Shows lower wick (rejection)
├── Buy delta dominance on the candle
└── SIGNAL: Lows swept, shorts trapped → GO LONG
BEARISH SWEEP (LS↓):
├── Price sweeps ABOVE a recent swing high
├── Closes BACK BELOW the swing level
├── Shows upper wick (rejection)
├── Sell delta dominance on the candle
└── SIGNAL: Highs swept, longs trapped → GO SHORT
```
### Why Sweeps Matter for Orderflow
1. **Retail stops get hit** → Liquidity provided to institutions
2. **Institutions fill orders** → At better prices thanks to the sweep
3. **Price reverses** → Move in intended direction begins
4. **You enter with institutions** → Not against them
### Sweep + Zone = High Probability
When a liquidity sweep happens AT or NEAR an Order Block or FVG zone, the probability increases significantly.
---
## 🔄 IFVG (INVERSE FVG)
### What Is an IFVG?
An Inverse FVG forms when price **fills an FVG and then reclaims it** in the opposite direction. This signals a **failed institutional move**.
### Detection Logic
```
BULLISH IFVG:
├── Bearish FVG was created (gap down)
├── Price fills the gap (tests zone)
├── Price CLOSES ABOVE the gap with buy delta
└── SIGNAL: Bears failed → Strong reversal UP
BEARISH IFVG:
├── Bullish FVG was created (gap up)
├── Price fills the gap (tests zone)
├── Price CLOSES BELOW the gap with sell delta
└── SIGNAL: Bulls failed → Strong reversal DOWN
```
### Why IFVG Is Powerful
- Shows institutional failure → Other side takes control
- Pre-assigned quality score of 8.0 (high priority)
- Often marks significant reversals
- Purple dashed boxes for easy identification
---
## 📊 ZONE QUALITY SCORING
### The "Zones That Matter" Filter
Not all FVGs and OBs are created equal. v6 implements a **Zone Quality Score** (0-10) that filters out low-quality zones.
### Quality Calculation
| Factor | Max Points | How Measured |
|--------|------------|--------------|
| Gap Size | 2.5 | Larger gap = more points |
| Impulse Strength | 2.5 | Stronger move = more points |
| Volume | 2.0 | Higher volume = more points |
| OB Alignment | 2.0 | FVG overlaps with OB = bonus |
| Session | 1.0 | Created in active session = bonus |
### Min Quality Threshold (Default: 6.0)
Zones scoring below this threshold **are not displayed**. Adjust in settings:
- **Conservative**: Set to 7.0+ (fewer, better zones)
- **Standard**: 6.0 (balanced)
- **Aggressive**: 4.0-5.0 (more zones, more noise)
### Visual Quality Indicators
- **Thick border**: Zone aligns with Order Block (high quality)
- **Bright color**: Fresh zone
- **Gray color**: Tested zone (still valid)
- **Removed**: Broken zone (invalidated)
---
## 📊 CONFLUENCE SCORING SYSTEM
### Score Components (Max ~12, normalized to 10)
| Factor | Points | Condition |
|--------|--------|-----------|
| **Tier** | 1-3 | B=1, A=2, S=3 |
| **FVG Zone** | +1.5 | Price in quality FVG |
| **Order Block** | +1.5 | Price in OB |
| **IFVG** | +1.0 | Price in Inverse FVG |
| **Strong Volume** | +1.0 | Volume ≥ 2x average |
| **Extreme Volume** | +0.5 | Volume ≥ 2.5x average |
| **Strong Delta** | +1.0 | Delta ≥ 70% |
| **Extreme Delta** | +0.5 | Delta ≥ 78% |
| **CVD Momentum** | +0.5-1.0 | CVD trending with signal |
| **Liquidity Sweep** | +1.5 | Recent sweep confirms direction |
### Score Classification
| Score | Class | Confidence | Position Size |
|-------|-------|------------|---------------|
| **7.0+** | EXCELLENT | Very High | Full size (100%) |
| **4.5-6.9** | MEDIUM | Good | Standard (75%) |
| **< 4.5** | WEAK | Low | No signal shown |
### Score Displayed in Table
The table shows both the numeric score and classification:
- Green background + "EXCELLENT" = Top tier setup
- Orange background + "MEDIUM" = Decent setup
- Gray + "WEAK" = Below threshold
---
## 📊 ENHANCED TABLE REFERENCE
The v6 table is organized into **4 sections**:
### CANDLE Section
| Row | What It Shows |
|-----|---------------|
| Points | Candle range in points + Tier (S/A/B/X) |
| Volume | Volume ratio + grade (🔥/✓✓/✓/✗) |
### ORDERFLOW Section
| Row | What It Shows |
|-----|---------------|
| Delta | Buy/Sell % + grade (🔥/✓✓/✓/—) |
| CVD | Direction + strength (▲▲ STRONG, ▲ UP, etc.) |
### STRUCTURE Section
| Row | What It Shows |
|-----|---------------|
| FVG Zone | Current zone status + quality score |
| Order Block | OB status (BULL OB / BEAR OB / —) |
| Liq Sweep | Recent sweep status + 🎯 indicator |
### SIGNAL Section
| Row | What It Shows |
|-----|---------------|
| Session | Current session (NY/LDN/PWR/OFF) + 🟢/🔴 |
| SCORE | Numeric score /10 + classification |
### Color Coding
- **🟢 Green/Lime**: Good, meets threshold, bullish
- **🟠 Orange/Amber**: Caution, borderline, medium
- **🔴 Red**: Bad, below threshold, bearish
- **⚪ Gray**: Inactive/neutral
- **🔥**: Extreme/exceptional reading
---
## ✅ ENTRY CHECKLIST v6
Before entering any trade:
### Basic Requirements
- Signal present (S🎯/A🎯/B🎯 or Z)
- Score ≥ 4.5 (MEDIUM or better)
- Session active (LDN/NY/PWR shows 🟢)
### Orderflow Confirmation
- Delta colored (not gray)
- CVD arrow matches direction
- Volume shows ✓ or better
### Structure Bonus (Any = Better)
- In FVG Zone
- In Order Block
- Recent Liquidity Sweep
- IFVG present
### Execute
- Enter at signal candle close
- Stop below/above candle (shown on chart)
- Target at calculated R:R level
---
## 🎯 IDEAL SETUPS (HIGH WIN RATE)
### Setup 1: Sweep + Zone + Tier
```
Conditions:
├── Liquidity Sweep just occurred (LS↑ or LS↓)
├── Price is at Order Block or FVG
├── Tier signal fires (S/A/B)
├── Score: 7+ EXCELLENT
└── Win Rate: ~75-85%
```
### Setup 2: IFVG + Delta Confirmation
```
Conditions:
├── IFVG just formed (purple zone)
├── Strong delta (70%+) in IFVG direction
├── CVD confirming
├── Score: 7+ EXCELLENT
└── Win Rate: ~70-80%
```
### Setup 3: OB + FVG Overlap
```
Conditions:
├── Order Block present
├── FVG zone overlaps with OB (thick border)
├── Price returns to overlap zone
├── Delta confirms direction
└── Win Rate: ~70-78%
```
### Setup 4: Clean Zone Entry
```
Conditions:
├── Quality zone (score 6+)
├── No tier signal but Z entry shows
├── Delta matches zone direction
├── In active session
└── Win Rate: ~65-72%
```
---
## ⛔ DO NOT TRADE
- Session shows "OFF" or 🔴
- Score < 4.5 (WEAK)
- Delta shows "—" (no dominance)
- CVD conflicts with signal direction
- Multiple conflicting zones
- Zone quality < 6
- Major news imminent (FOMC, NFP, CPI)
- Price chopping between zones
---
## 🔧 SETTINGS GUIDE
### Recommended Configurations
**Conservative (2-4 trades/day):**
```
Min Score Medium: 5.5
Min Score Excellent: 7.5
Min Zone Quality: 7.0
Min Volume Ratio: 2.0
Delta Threshold: 65%
```
**Standard (4-6 trades/day):**
```
Min Score Medium: 4.5
Min Score Excellent: 7.0
Min Zone Quality: 6.0
Min Volume Ratio: 1.8
Delta Threshold: 62%
```
**Aggressive (6-8 trades/day):**
```
Min Score Medium: 4.0
Min Score Excellent: 6.5
Min Zone Quality: 5.0
Min Volume Ratio: 1.5
Delta Threshold: 60%
```
---
## 🚨 ALERTS PRIORITY
### Must-Have Alerts
| Alert | Priority | Action |
|-------|----------|--------|
| ⭐ EXCELLENT LONG/SHORT | 🔴 CRITICAL | Drop everything, check NOW |
| 🎯 S-TIER | 🟠 HIGH | Evaluate within 10 seconds |
| 💎 LIQUIDITY SWEEP | 🟠 HIGH | Check for zone confluence |
| 🔄 IFVG | 🟡 MEDIUM | Note reversal potential |
### Useful Context Alerts
| Alert | Purpose |
|-------|---------|
| 📦 NEW OB | Mark institutional zone |
| 📦 NEW FVG | Mark gap zone |
| SESSION OPEN | Prepare to trade |
---
## 📈 TRADE JOURNAL v6
```
DATE: ___________
SESSION: ☐ LDN ☐ NY ☐ PWR
SETUP TYPE:
☐ Sweep + Zone ☐ IFVG ☐ OB+FVG ☐ Zone Entry
TRADE:
├── Time: _______
├── Signal: S🎯 / A🎯 / B🎯 / Z / LS
├── Direction: LONG / SHORT
├── Score: ___/10 (EXCELLENT / MEDIUM)
├── Entry: _______
├── Stop: _______
├── Target: _______
│
├── In FVG Zone: ☐ Yes ☐ No
├── In Order Block: ☐ Yes ☐ No
├── Liquidity Sweep: ☐ Yes ☐ No
├── IFVG Present: ☐ Yes ☐ No
│
├── Result: +/- ___ pts ($_____)
└── Notes: _______________________
DAILY SUMMARY:
├── Trades: ___
├── EXCELLENT setups: ___
├── MEDIUM setups: ___
├── Wins: ___ | Losses: ___
├── Net P/L: $_____
└── Best setup type: _______________________
```
---
## 🏆 GOLDEN RULES v6
> **"Institutions sweep, then move. Wait for the sweep."**
> **"Order Blocks show where they filled. Trade there."**
> **"IFVG = They failed. Take the other side."**
> **"Zone Quality 6+ or walk away."**
> **"EXCELLENT score = Green light. MEDIUM = Yellow light. WEAK = Red light."**
> **"Confluence beats conviction. Stack the factors."**
> **"Leave every trade with money. The next setup is coming."**
---
## 🔧 TROUBLESHOOTING
| Issue | Solution |
|-------|----------|
| No signals | Lower Min Score Medium to 4.0 |
| Too many signals | Raise Min Score Medium to 5.5+ |
| Too many zones | Raise Min Zone Quality to 7.0+ |
| Zones cluttering | Reduce Max Zones to 6-8 |
| OBs everywhere | Raise OB Min Strength to 1.8+ |
| Missing sweeps | Lower Sweep Lookback, reduce Min Wick Ratio |
| Table too small | Change Table Size to "large" |
| Wrong timezone | Check Session Timezone setting |
---
## 📝 TECHNICAL NOTES
- **Pine Script v6** (latest syntax)
- **Works on**: YM, MYM, NQ, MNQ, ES, MES, GC, MGC
- **Auto-detects** instrument for proper point calculation
- **Recommended TF**: 1-5 minute for day trading
- **Min TradingView Plan**: Free (no premium features required)
- **Max visual elements**: 500 labels, 500 boxes, 500 lines
---
*© Alexandro Disla - YM Ultimate SNIPER v6*
*Orderflow Edition | Zones That Matter*
1.1 SMF LONG: Sweep → BOS → OB → BOS break SMF LONG Strategy (Sweep → BOS → Order Block → BOS) — Summary
The strategy looks for a moment when the market takes liquidity to the downside through a sweep (breaking previous lows), followed by the formation of the first BOS, indicating that sellers have lost control. After that, the strategy waits for the creation of an Order Block (OB) — the last bearish candle before the upward impulse — which highlights the zone where large players entered positions. When price returns to the OB, the entry (TVH) is placed at the top of the OB, the stop-loss at the bottom of the OB, and the take-profit is always set to 3× the stop size, regardless of the OB width.
In a one-year backtest from December 2024 to December 2025, the strategy and indicator showed a win rate of 30.85%:
65 stop-losses,
29 take-profits,
and 15 missed trades where the take-profit was hit before price could return to the entry zone.
TSD Trend DotsThis script is a modified version of the original “Trend Strength Directional (TSD)” by Trebor_Namor. All core logic, idea, and inspiration come from Trebor_Namor’s work – this version simply adds a clearer alert framework.
TSD combines a wave-based momentum filter with a custom MFI to show the strength and direction of money flow. The “black” wave tracks price momentum, while the MFI color shows whether capital is flowing into (green) or out of (red) the market.
In this edition, the dots are separated into explicit signals:
Green Dot – bullish cross (momentum turning up, potential buy/entry area).
Red Dot – bearish cross (momentum turning down, potential take-profit/exit area).
Separate alertcondition events are provided for Green and Red dots so traders can set individual alerts for long and short bias, while still respecting the original TSD concept. This script is for educational and research purposes only – always combine it with your own analysis and risk management.
boomboamindian indiator used for analysis of market used to know entry and exit points in all markets
Third eye • StrategyThird eye • Strategy – User Guide
1. Idea & Concept
Third eye • Strategy combines three things into one system:
Ichimoku Cloud – to define market regime and support/resistance.
Moving Average (trend filter) – to trade only in the dominant direction.
CCI (Commodity Channel Index) – to generate precise entry signals on momentum breakouts.
The script is a strategy, not an indicator: it can backtest entries, exits, SL, TP and BreakEven logic automatically.
2. Indicators Used
2.1 Ichimoku
Standard Ichimoku settings (by default 9/26/52/26) are used:
Conversion Line (Tenkan-sen)
Base Line (Kijun-sen)
Leading Span A & B (Kumo Cloud)
Lagging Span is calculated but hidden from the chart (for visual simplicity).
From the cloud we derive:
kumoTop – top of the cloud under current price.
kumoBottom – bottom of the cloud under current price.
Flags:
is_above_kumo – price above the cloud.
is_below_kumo – price below the cloud.
is_in_kumo – price inside the cloud.
These conditions are used as trend / regime filters and for stop-loss & trailing stops.
2.2 Moving Average
You can optionally display and use a trend MA:
Types: SMA, EMA, DEMA, WMA
Length: configurable (default 200)
Source: default close
Filter idea:
If MA Direction Filter is ON:
When Close > MA → strategy allows only Long signals.
When Close < MA → strategy allows only Short signals.
The MA is plotted on the chart (if enabled).
2.3 CCI & Panel
The CCI (Commodity Channel Index) is used for entry timing:
CCI length and source are configurable (default length 20, source hlc3).
Two thresholds:
CCI Upper Threshold (Long) – default +100
CCI Lower Threshold (Short) – default –100
Signals:
Long signal:
CCI crosses up through the upper threshold
cci_val < upper_threshold and cci_val > upper_threshold
Short signal:
CCI crosses down through the lower threshold
cci_val > lower_threshold and cci_val < lower_threshold
There is a panel (table) in the bottom-right corner:
Shows current CCI value.
Shows filter status as colored dots:
Green = filter enabled and passed.
Red = filter enabled and blocking trades.
Gray = filter is disabled.
Filters shown in the panel:
Ichimoku Cloud filter (Long/Short)
Ichimoku Lines filter (Conversion/Base vs Cloud)
MA Direction filter
3. Filters & Trade Direction
All filters can be turned ON/OFF independently.
3.1 Ichimoku Cloud Filter
Purpose: trade only when price is clearly above or below the Kumo.
Long Cloud Filter (Use Ichimoku Cloud Filter) – when enabled:
Long trades only if close > cloud top.
Short Cloud Filter – when enabled:
Short trades only if close < cloud bottom.
If the cloud filter is disabled, this condition is ignored.
3.2 Ichimoku Lines Above/Below Cloud
Purpose: stronger trend confirmation: Ichimoku lines should also be on the “correct” side of the cloud.
Long Lines Filter:
Long allowed only if Conversion Line and Base Line are both above the cloud.
Short Lines Filter:
Short allowed only if both lines are below the cloud.
If this filter is OFF, the conditions are not checked.
3.3 MA Direction Filter
As described above:
When ON:
Close > MA → only Longs.
Close < MA → only Shorts.
4. Anti-Re-Entry Logic (Cloud Touch Reset)
The strategy uses internal flags to avoid continuous re-entries in the same direction without a reset.
Two flags:
allowLong
allowShort
After a Long entry, allowLong is set to false, allowShort to true.
After a Short entry, allowShort is set to false, allowLong to true.
Flags are reset when price touches the Kumo:
If Low goes into the cloud → allowLong = true
If High goes into the cloud → allowShort = true
If Close is inside the cloud → both allowLong and allowShort are set to true
There is a key option:
Wait Position Close Before Flag Reset
If ON: cloud touch will reset flags only when there is no open position.
If OFF: flags can be reset even while a trade is open.
This gives a kind of regime-based re-entry control: after a trend leg, you wait for a “cloud interaction” to allow new signals.
5. Risk Management
All risk management is handled inside the strategy.
5.1 Position Sizing
Order Size % of Equity – default 10%
The strategy calculates:
position_value = equity * (Order Size % / 100)
position_qty = position_value / close
So position size automatically adapts to your current equity.
5.2 Take Profit Modes
You can choose one of two TP modes:
Percent
Fibonacci
5.2.1 Percent Mode
Single Take Profit at X% from entry (default 2%).
For Long:
TP = entry_price * (1 + tp_pct / 100)
For Short:
TP = entry_price * (1 - tp_pct / 100)
One strategy.exit per side is used: "Long TP/SL" and "Short TP/SL".
5.2.2 Fibonacci Mode (2 partial TPs)
In this mode, TP levels are based on a virtual Fib-style extension between entry and stop-loss.
Inputs:
Fib TP1 Level (default 1.618)
Fib TP2 Level (default 2.5)
TP1 Share % (Fib) (default 50%)
TP2 share is automatically 100% - TP1 share.
Process for Long:
Compute a reference Stop (see SL section below) → sl_for_fib.
Compute distance: dist = entry_price - sl_for_fib.
TP levels:
TP1 = entry_price + dist * (Fib TP1 Level - 1)
TP2 = entry_price + dist * (Fib TP2 Level - 1)
For Short, the logic is mirrored.
Two exits are used:
TP1 – closes TP1 share % of position.
TP2 – closes remaining TP2 share %.
Same stop is used for both partial exits.
5.3 Stop-Loss Modes
You can choose one of three Stop Loss modes:
Stable – fixed % from entry.
Ichimoku – fixed level derived from the Kumo.
Ichimoku Trailing – dynamic SL following the cloud.
5.3.1 Stable SL
For Long:
SL = entry_price * (1 - Stable SL % / 100)
For Short:
SL = entry_price * (1 + Stable SL % / 100)
Used both for Percent TP mode and as reference for Fib TP if Kumo is not available.
5.3.2 Ichimoku SL (fixed, non-trailing)
At the time of a new trade:
For Long:
Base SL = cloud bottom minus small offset (%)
For Short:
Base SL = cloud top plus small offset (%)
The offset is configurable: Ichimoku SL Offset %.
Once computed, that SL level is fixed for this trade.
5.3.3 Ichimoku Trailing SL
Similar to Ichimoku SL, but recomputed each bar:
For Long:
SL = cloud bottom – offset
For Short:
SL = cloud top + offset
A red trailing SL line is drawn on the chart to visualize current stop level.
This trailing SL is also used as reference for BreakEven and for Fib TP distance.
6. BreakEven Logic (with BE Lines)
BreakEven is optional and supports two modes:
Percent
Fibonacci
Inputs:
Percent mode:
BE Trigger % (from entry) – move SL to BE when price goes this % in profit.
BE Offset % from entry – SL will be set to entry ± this offset.
Fibonacci mode:
BE Fib Level – Fib level at which BE will be activated (default 1.618, same style as TP).
BE Offset % from entry – how far from entry to place BE stop.
The logic:
Before BE is triggered, SL follows its normal mode (Stable/Ichimoku/Ichimoku Trailing).
When BE triggers:
For Long:
New SL = max(current SL, BE SL).
For Short:
New SL = min(current SL, BE SL).
This means BE will never loosen the stop – only tighten it.
When BE is activated, the strategy draws a violet horizontal line at the BreakEven level (once per trade).
BE state is cleared when the position is closed or when a new position is opened.
7. Entry & Exit Logic (Summary)
7.1 Long Entry
Conditions for a Long:
CCI signal:
CCI crosses up through the upper threshold.
Ichimoku Cloud Filter (optional):
If enabled → price must be above the Kumo.
Ichimoku Lines Filter (optional):
If enabled → Conversion Line and Base Line must be above the Kumo.
MA Direction Filter (optional):
If enabled → Close must be above the chosen MA.
Anti-re-entry flag:
allowLong must be true (cloud-based reset).
Position check:
Long entries are allowed when current position size ≤ 0 (so it can also reverse from short to long).
If all these conditions are true, the strategy sends:
strategy.entry("Long", strategy.long, qty = calculated_qty)
After entry:
allowLong = false
allowShort = true
7.2 Short Entry
Same structure, mirrored:
CCI signal:
CCI crosses down through the lower threshold.
Cloud filter: price must be below cloud (if enabled).
Lines filter: conversion & base must be below cloud (if enabled).
MA filter: Close must be below MA (if enabled).
allowShort must be true.
Position check: position size ≥ 0 (allows reversal from long to short).
Then:
strategy.entry("Short", strategy.short, qty = calculated_qty)
Flags update:
allowShort = false
allowLong = true
7.3 Exits
While in a position:
The strategy continuously recalculates SL (depending on chosen mode) and, in Percent mode, TP.
In Fib mode, fixed TP levels are computed at entry.
BreakEven may raise/tighten the SL if its conditions are met.
Exits are executed via strategy.exit:
Percent mode: one TP+SL exit per side.
Fib mode: two partial exits (TP1 and TP2) sharing the same SL.
At position open, the script also draws visual lines:
White line — entry price.
Green line(s) — TP level(s).
Red line — SL (if not using Ichimoku Trailing; with trailing, the red line is updated dynamically).
Maximum of 30 lines are kept to avoid clutter.
8. How to Use the Strategy
Choose market & timeframe
Works well on trending instruments. Try crypto, FX or indices on H1–H4, or intraday if you prefer more trades.
Adjust Ichimoku settings
Keep defaults (9/26/52/26) or adapt to your timeframe.
Configure Moving Average
Typical: EMA 200 as a trend filter.
Turn MA Direction Filter ON if you want to trade only with the main trend.
Set CCI thresholds
Default ±100 is classic.
Lower thresholds → more signals, higher noise.
Higher thresholds → fewer but stronger signals.
Enable/disable filters
Turn on Ichimoku Cloud and Ichimoku Lines if you want only “clean” trend trades.
Use Wait Position Close Before Flag Reset to control how often re-entries are allowed.
Choose TP & SL mode
Percent mode is simpler and easier to understand.
Fibonacci mode is more advanced: it aligns TP levels with the distance to stop, giving asymmetric RR setups (two partial TPs).
Choose Stable SL for fixed-risk trades, or Ichimoku / Ichimoku Trailing to tie stops to the cloud structure.
Set BreakEven
Enable BE if you want to lock in risk-free trades after a certain move.
Percent mode is straightforward; Fib mode keeps BreakEven in harmony with your Fib TP setup.
Run Backtest & Optimize
Press “Add to chart” → go to Strategy Tester.
Adjust parameters to your market and timeframe.
Look at equity curve, PF, drawdown, average trade, etc.
Live / Paper Trading
After you’re satisfied with backtest results, use the strategy to generate signals.
You can mirror entries/exits manually or connect them to alerts (if you build an alert-based execution layer).
BAY_PIVOT S/R(4 Full Lines + ALL Labels)//@version=5
indicator("BAY_PIVOT S/R(4 Full Lines + ALL Labels)", overlay=true, max_labels_count=500, max_lines_count=500)
// ────────────────────── TOGGLES ──────────────────────
showPivot = input.bool(true, "Show Pivot (Full Line + Label)")
showTarget = input.bool(true, "Show Target (Full Line + Label)")
showLast = input.bool(true, "Show Last Close (Full Line + Label)")
showPrevClose = input.bool(true, "Show Previous Close (Full Line + Label)")
useBarchartLast = input.bool(true, "Use Barchart 'Last' (Settlement Price)")
showR1R2R3 = input.bool(true, "Show R1 • R2 • R3")
showS1S2S3 = input.bool(true, "Show S1 • S2 • S3")
showStdDev = input.bool(true, "Show ±1σ ±2σ ±3σ")
showFib4W = input.bool(true, "Show 4-Week Fibs")
showFib13W = input.bool(true, "Show 13-Week Fibs")
showMonthHL = input.bool(true, "Show 1M High / Low")
showEntry1 = input.bool(false, "Show Manual Entry 1")
showEntry2 = input.bool(false, "Show Manual Entry 2")
entry1 = input.float(0.0, "Manual Entry 1", step=0.25)
entry2 = input.float(0.0, "Manual Entry 2", step=0.25)
stdLen = input.int(20, "StdDev Length", minval=1)
fib4wBars = input.int(20, "4W Fib Lookback")
fib13wBars = input.int(65, "13W Fib Lookback")
// ────────────────────── DAILY CALCULATIONS ──────────────────────
high_y = request.security(syminfo.tickerid, "D", high , lookahead=barmerge.lookahead_on)
low_y = request.security(syminfo.tickerid, "D", low , lookahead=barmerge.lookahead_on)
close_y = request.security(syminfo.tickerid, "D", close , lookahead=barmerge.lookahead_on)
pivot = (high_y + low_y + close_y) / 3
r1 = pivot + 0.382 * (high_y - low_y)
r2 = pivot + 0.618 * (high_y - low_y)
r3 = pivot + (high_y - low_y)
s1 = pivot - 0.382 * (high_y - low_y)
s2 = pivot - 0.618 * (high_y - low_y)
s3 = pivot - (high_y - low_y)
prevClose = close_y
last = useBarchartLast ? request.security(syminfo.tickerid, "D", close , lookahead=barmerge.lookahead_off) : close
target = pivot + (pivot - prevClose)
// StdDev + Fibs + Monthly (unchanged)
basis = ta.sma(close, stdLen)
dev = ta.stdev(close, stdLen)
stdRes1 = basis + dev
stdRes2 = basis + dev*2
stdRes3 = basis + dev*3
stdSup1 = basis - dev
stdSup2 = basis - dev*2
stdSup3 = basis - dev*3
high4w = ta.highest(high, fib4wBars)
low4w = ta.lowest(low, fib4wBars)
fib382_4w = high4w - (high4w - low4w) * 0.382
fib50_4w = high4w - (high4w - low4w) * 0.500
high13w = ta.highest(high, fib13wBars)
low13w = ta.lowest(low, fib13wBars)
fib382_13w_high = high13w - (high13w - low13w) * 0.382
fib50_13w = high13w - (high13w - low13w) * 0.500
fib382_13w_low = low13w + (high13w - low13w) * 0.382
monthHigh = ta.highest(high, 30)
monthLow = ta.lowest(low, 30)
// ────────────────────── COLORS ──────────────────────
colRed = color.rgb(255,0,0)
colLime = color.rgb(0,255,0)
colYellow = color.rgb(255,255,0)
colOrange = color.rgb(255,165,0)
colWhite = color.rgb(255,255,255)
colGray = color.rgb(128,128,128)
colMagenta = color.rgb(255,0,255)
colPink = color.rgb(233,30,99)
colCyan = color.rgb(0,188,212)
colBlue = color.rgb(0,122,255)
colPurple = color.rgb(128,0,128)
colRed50 = color.new(colRed,50)
colGreen50 = color.new(colLime,50)
// ────────────────────── 4 KEY FULL LINES ──────────────────────
plot(showPivot ? pivot : na, title="PIVOT", color=colYellow, linewidth=3, style=plot.style_linebr)
plot(showTarget ? target : na, title="TARGET", color=colOrange, linewidth=2, style=plot.style_linebr)
plot(showLast ? last : na, title="LAST", color=colWhite, linewidth=2, style=plot.style_linebr)
plot(showPrevClose ? prevClose : na, title="PREV CLOSE",color=colGray, linewidth=1, style=plot.style_linebr)
// ────────────────────── LABELS FOR ALL 4 KEY LEVELS (SAME STYLE AS OTHERS) ──────────────────────
f_label(price, txt, bgColor, txtColor) =>
if barstate.islast and not na(price)
label.new(bar_index, price, txt, style=label.style_label_left, color=bgColor, textcolor=txtColor, size=size.small)
if barstate.islast
showPivot ? f_label(pivot, "PIVOT\n" + str.tostring(pivot, "#.##"), colYellow, color.black) : na
showTarget ? f_label(target, "TARGET\n" + str.tostring(target, "#.##"), colOrange, color.white) : na
showLast ? f_label(last, "LAST\n" + str.tostring(last, "#.##"), colWhite, color.black) : na
showPrevClose ? f_label(prevClose, "PREV CLOSE\n"+ str.tostring(prevClose, "#.##"), colGray, color.white) : na
// ────────────────────── OTHER LEVELS – line stops at label ──────────────────────
f_level(p, txt, tc, lc, w=1) =>
if barstate.islast and not na(p)
lbl = label.new(bar_index, p, txt, style=label.style_label_left, color=lc, textcolor=tc, size=size.small)
line.new(bar_index-400, p, label.get_x(lbl), p, extend=extend.none, color=lc, width=w)
if barstate.islast
if showR1R2R3
f_level(r1, "R1\n" + str.tostring(r1, "#.##"), color.white, colRed)
f_level(r2, "R2\n" + str.tostring(r2, "#.##"), color.white, colRed)
f_level(r3, "R3\n" + str.tostring(r3, "#.##"), color.white, colRed, 2)
if showS1S2S3
f_level(s1, "S1\n" + str.tostring(s1, "#.##"), color.black, colLime)
f_level(s2, "S2\n" + str.tostring(s2, "#.##"), color.black, colLime)
f_level(s3, "S3\n" + str.tostring(s3, "#.##"), color.black, colLime, 2)
if showStdDev
f_level(stdRes1, "+1σ\n" + str.tostring(stdRes1, "#.##"), color.white, colPink)
f_level(stdRes2, "+2σ\n" + str.tostring(stdRes2, "#.##"), color.white, colPink)
f_level(stdRes3, "+3σ\n" + str.tostring(stdRes3, "#.##"), color.white, colPink, 2)
f_level(stdSup1, "-1σ\n" + str.tostring(stdSup1, "#.##"), color.white, colCyan)
f_level(stdSup2, "-2σ\n" + str.tostring(stdSup2, "#.##"), color.white, colCyan)
f_level(stdSup3, "-3σ\n" + str.tostring(stdSup3, "#.##"), color.white, colCyan, 2)
if showFib4W
f_level(fib382_4w, "38.2% 4W\n" + str.tostring(fib382_4w, "#.##"), color.white, colMagenta)
f_level(fib50_4w, "50% 4W\n" + str.tostring(fib50_4w, "#.##"), color.white, colMagenta)
if showFib13W
f_level(fib382_13w_high, "38.2% 13W High\n" + str.tostring(fib382_13w_high, "#.##"), color.white, colMagenta)
f_level(fib50_13w, "50% 13W\n" + str.tostring(fib50_13w, "#.##"), color.white, colMagenta)
f_level(fib382_13w_low, "38.2% 13W Low\n" + str.tostring(fib382_13w_low, "#.##"), color.white, colMagenta)
if showMonthHL
f_level(monthHigh, "1M HIGH\n" + str.tostring(monthHigh, "#.##"), color.white, colRed50, 2)
f_level(monthLow, "1M LOW\n" + str.tostring(monthLow, "#.##"), color.white, colGreen50, 2)
// Manual entries
plot(showEntry1 and entry1 > 0 ? entry1 : na, "Entry 1", color=colBlue, linewidth=2, style=plot.style_linebr)
plot(showEntry2 and entry2 > 0 ? entry2 : na, "Entry 2", color=colPurple, linewidth=2, style=plot.style_linebr)
// Background
bgcolor(close > pivot ? color.new(color.blue, 95) : color.new(color.red, 95))
Big Candle Identifier with RSI Divergence and Advanced Stops1. Strategy Objective
The main goal of this strategy is to:
Identify significant price momentum (big candles).
Enter trades at opportune moments based on market signals (candlestick patterns and RSI divergence).
Limit initial risk through a fixed stop loss.
Maximize profits by using a trailing stop that activates only after the trade moves a specified distance in the profitable direction.
2. Components of the Strategy
A. Big Candle Identification
The strategy identifies big candles as indicators of strong momentum.
A big candle is defined as:
The body (absolute difference between close and open) of the current candle (body0) is larger than the bodies of the last five candles.
The candle is:
Bullish Big Candle: If close > open.
Bearish Big Candle: If open > close.
Purpose: Big candles signal potential continuation or reversal of trends, serving as the primary entry trigger.
B. RSI Divergence
Relative Strength Index (RSI): A momentum oscillator used to detect overbought/oversold conditions and divergence.
Fast RSI: A 5-period RSI, which is more sensitive to short-term price movements.
Slow RSI: A 14-period RSI, which smoothens fluctuations over a longer timeframe.
Divergence: The difference between the fast and slow RSIs.
Positive divergence (divergence > 0): Bullish momentum.
Negative divergence (divergence < 0): Bearish momentum.
Visualization: The divergence is plotted on the chart, helping traders confirm momentum shifts.
C. Stop Loss
Initial Stop Loss:
When entering a trade, an immediate stop loss of 200 points is applied.
This stop loss ensures the maximum risk is capped at a predefined level.
Implementation:
Long Trades: Stop loss is set below the entry price at low - 200 points.
Short Trades: Stop loss is set above the entry price at high + 200 points.
Purpose:
Prevents significant losses if the price moves against the trade immediately after entry.
D. Trailing Stop
The trailing stop is a dynamic risk management tool that adjusts with price movements to lock in profits. Here’s how it works:
Activation Condition:
The trailing stop only starts trailing when the trade moves 200 ticks (profit) in the right direction:
Long Position: close - entry_price >= 200 ticks.
Short Position: entry_price - close >= 200 ticks.
Trailing Logic:
Once activated, the trailing stop:
For Long Positions: Trails behind the price by 150 ticks (trail_stop = close - 150 ticks).
For Short Positions: Trails above the price by 150 ticks (trail_stop = close + 150 ticks).
Exit Condition:
The trade exits automatically if the price touches the trailing stop level.
Purpose:
Ensures profits are locked in as the trade progresses while still allowing room for price fluctuations.
E. Trade Entry Logic
Long Entry:
Triggered when a bullish big candle is identified.
Stop loss is set at low - 200 points.
Short Entry:
Triggered when a bearish big candle is identified.
Stop loss is set at high + 200 points.
F. Trade Exit Logic
Trailing Stop: Automatically exits the trade if the price touches the trailing stop level.
Fixed Stop Loss: Exits the trade if the price hits the predefined stop loss level.
G. 21 EMA
The strategy includes a 21-period Exponential Moving Average (EMA), which acts as a trend filter.
EMA helps visualize the overall market direction:
Price above EMA: Indicates an uptrend.
Price below EMA: Indicates a downtrend.
H. Visualization
Big Candle Identification:
The open and close prices of big candles are plotted for easy reference.
Trailing Stop:
Plotted on the chart to visualize its progression during the trade.
Green Line: Indicates the trailing stop for long positions.
Red Line: Indicates the trailing stop for short positions.
RSI Divergence:
Positive divergence is shown in green.
Negative divergence is shown in red.
3. Key Parameters
trail_start_ticks: The number of ticks required before the trailing stop activates (default: 200 ticks).
trail_distance_ticks: The distance between the trailing stop and price once the trailing stop starts (default: 150 ticks).
initial_stop_loss_points: The fixed stop loss in points applied at entry (default: 200 points).
tick_size: Automatically calculates the minimum tick size for the trading instrument.
4. Workflow of the Strategy
Step 1: Entry Signal
The strategy identifies a big candle (bullish or bearish).
If conditions are met, a trade is entered with a fixed stop loss.
Step 2: Initial Risk Management
The trade starts with an initial stop loss of 200 points.
Step 3: Trailing Stop Activation
If the trade moves 200 ticks in the profitable direction:
The trailing stop is activated and follows the price at a distance of 150 ticks.
Step 4: Exit the Trade
The trade is exited if:
The price hits the trailing stop.
The price hits the initial stop loss.
5. Advantages of the Strategy
Risk Management:
The fixed stop loss ensures that losses are capped.
The trailing stop locks in profits after the trade becomes profitable.
Momentum-Based Entries:
The strategy uses big candles as entry triggers, which often indicate strong price momentum.
Divergence Confirmation:
RSI divergence helps validate momentum and avoid false signals.
Dynamic Profit Protection:
The trailing stop adjusts dynamically, allowing the trade to capture larger moves while protecting gains.
6. Ideal Market Conditions
This strategy performs best in:
Trending Markets:
Big candles and momentum signals are more effective in capturing directional moves.
High Volatility:
Larger price swings improve the probability of reaching the trailing stop activation level (200 ticks).
Nef33 Forex & Crypto Trading Signals PRO
1. Understanding the Indicator's Context
The indicator generates signals based on confluence (trend, volume, key zones, etc.), but it does not include predefined SL or TP levels. To establish them, we must:
Use dynamic or static support/resistance levels already present in the script.
Incorporate volatility (such as ATR) to adjust the levels based on market conditions.
Define a risk/reward ratio (e.g., 1:2).
2. Options for Determining SL and TP
Below, I provide several ideas based on the tools available in the script:
Stop Loss (SL)
The SL should protect you from adverse movements. You can base it on:
ATR (Volatility): Use the smoothed ATR (atr_smooth) multiplied by a factor (e.g., 1.5 or 2) to set a dynamic SL.
Buy: SL = Entry Price - (atr_smooth * atr_mult).
Sell: SL = Entry Price + (atr_smooth * atr_mult).
Key Zones: Place the SL below a support (for buys) or above a resistance (for sells), using Order Blocks, Fair Value Gaps, or Liquidity Zones.
Buy: SL below the nearest ob_lows or fvg_lows.
Sell: SL above the nearest ob_highs or fvg_highs.
VWAP: Use the daily VWAP (vwap_day) as a critical level.
Buy: SL below vwap_day.
Sell: SL above vwap_day.
Take Profit (TP)
The TP should maximize profits. You can base it on:
Risk/Reward Ratio: Multiply the SL distance by a factor (e.g., 2 or 3).
Buy: TP = Entry Price + (SL Distance * 2).
Sell: TP = Entry Price - (SL Distance * 2).
Key Zones: Target the next resistance (for buys) or support (for sells).
Buy: TP at the next ob_highs, fvg_highs, or liq_zone_high.
Sell: TP at the next ob_lows, fvg_lows, or liq_zone_low.
Ichimoku: Use the cloud levels (Senkou Span A/B) as targets.
Buy: TP at senkou_span_a or senkou_span_b (whichever is higher).
Sell: TP at senkou_span_a or senkou_span_b (whichever is lower).
3. Practical Implementation
Since the script does not automatically draw SL/TP, you can:
Calculate them manually: Observe the chart and use the levels mentioned.
Modify the code: Add SL/TP as labels (label.new) at the moment of the signal.
Here’s an example of how to modify the code to display SL and TP based on ATR with a 1:2 risk/reward ratio:
Modified Code (Signals Section)
Find the lines where the signals (trade_buy and trade_sell) are generated and add the following:
pinescript
// Calculate SL and TP based on ATR
atr_sl_mult = 1.5 // Multiplier for SL
atr_tp_mult = 3.0 // Multiplier for TP (1:2 ratio)
sl_distance = atr_smooth * atr_sl_mult
tp_distance = atr_smooth * atr_tp_mult
if trade_buy
entry_price = close
sl_price = entry_price - sl_distance
tp_price = entry_price + tp_distance
label.new(bar_index, low, "Buy: " + str.tostring(math.round(bull_conditions, 1)), color=color.green, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_up, size=size.tiny)
if trade_sell
entry_price = close
sl_price = entry_price + sl_distance
tp_price = entry_price - tp_distance
label.new(bar_index, high, "Sell: " + str.tostring(math.round(bear_conditions, 1)), color=color.red, textcolor=color.white, style=label.style_label_down, size=size.tiny)
label.new(bar_index, sl_price, "SL: " + str.tostring(math.round(sl_price, 2)), color=color.red, textcolor=color.white, style=label.style_label_up, size=size.tiny)
label.new(bar_index, tp_price, "TP: " + str.tostring(math.round(tp_price, 2)), color=color.blue, textcolor=color.white, style=label.style_label_down, size=size.tiny)
Code Explanation
SL: Calculated by subtracting/adding sl_distance to the entry price (close) depending on whether it’s a buy or sell.
TP: Calculated with a double distance (tp_distance) for a 1:2 risk/reward ratio.
Visualization: Labels are added to the chart to display SL (red) and TP (blue).
4. Practical Strategy Without Modifying the Code
If you don’t want to modify the script, follow these steps manually:
Entry: Take the trade_buy or trade_sell signal.
SL: Check the smoothed ATR (atr_smooth) on the chart or calculate a fixed level (e.g., 1.5 times the ATR). Also, review nearby key zones (OB, FVG, VWAP).
TP: Define a target based on the next key zone or multiply the SL distance by 2 or 3.
Example:
Buy at 100, ATR = 2.
SL = 100 - (2 * 1.5) = 97.
TP = 100 + (2 * 3) = 106.
5. Recommendations
Test in Demo: Apply this logic in a demo account to adjust the multipliers (atr_sl_mult, atr_tp_mult) based on the market (forex or crypto).
Combine with Zones: If the ATR-based SL is too wide, use the nearest OB or FVG as a reference.
Risk/Reward Ratio: Adjust the TP based on your tolerance (1:1, 1:2, 1:3)
Risk & Position DashboardRisk & Position Dashboard
Overview
The Risk & Position Dashboard is a comprehensive trading tool designed to help traders calculate optimal position sizes, manage risk, and visualize potential profit/loss scenarios before entering trades. This indicator provides real-time calculations for position sizing based on account size, risk percentage, and stop-loss levels, while displaying multiple take-profit targets with customizable risk-reward ratios.
Key Features
Position Sizing & Risk Management:
Automatic position size calculation based on account size and risk percentage
Support for leveraged trading with maximum leverage limits
Fractional shares support for brokers that allow partial share trading
Real-time fee calculation including entry, stop-loss, and take-profit fees
Break-even price calculation including trading fees
Multi-Target Profit Management:
Support for up to 3 take-profit levels with individual portion allocations
Customizable risk-reward ratios for each take-profit target
Visual profit/loss zones displayed as colored boxes on the chart
Individual profit calculations for each take-profit level
Visual Dashboard:
Clean, customizable table display showing all key metrics
Configurable label positioning and styling options
Real-time tracking of whether stop-loss or take-profit levels have been reached
Color-coded visual zones for easy identification of risk and reward areas
Advanced Configuration:
Comprehensive input validation and error handling
Support for different chart timeframes and symbols
Customizable colors, fonts, and display options
Hide/show individual data fields for personalized dashboard views
How to Use
Set Account Parameters: Configure your account size, maximum risk percentage per trade, and trading fees in the "Account Settings" section.
Define Trade Setup: Use the "Entry" time picker to select your entry point on the chart, then input your entry price and stop-loss level.
Configure Take Profits: Set your desired risk-reward ratios and portion allocations for each take-profit level. The script supports 1-3 take-profit targets.
Analyze Results: The dashboard will automatically calculate and display position size, number of shares, potential profits/losses, fees, and break-even levels.
Visual Confirmation: Colored boxes on the chart show profit zones (green) and loss zones (red), with lines extending to current price levels.
Reset Entry and SL:
You can easily reset the entry and stop-loss by clicking the "Reset points..." button from the script's "More" menu.
This is useful if you want to quickly clear your current trade setup and start fresh without manually adjusting the points on the chart.
Calculations
The script performs sophisticated calculations including:
Position size based on risk amount and price difference between entry and stop-loss
Leverage requirements and position amount calculations
Fee-adjusted risk-reward ratios for realistic profit expectations
Break-even price including all trading costs
Individual profit calculations for partial position closures
Detailed Take-Profit Calculation Formula:
The take-profit prices are calculated using the following mathematical formula:
// Core variables:
// risk_amount = account_size * (risk_percentage / 100)
// total_risk_per_share = |entry_price - sl_price| + (entry_price * fee%) + (sl_price * fee%)
// shares = risk_amount / total_risk_per_share
// direction_factor = 1 for long positions, -1 for short positions
// Take-profit calculation:
net_win = total_risk_per_share * shares * RR_ratio
tp_price = (net_win + (direction_factor * entry_price * shares) + (entry_price * fee% * shares)) / (direction_factor * shares - fee% * shares)
Step-by-step example for a long position (based on screenshot):
Account Size: 2,000 USDT, Risk: 2% = 40 USDT
Entry: 102,062.9 USDT, Stop Loss: 102,178.4 USDT, Fee: 0.06%
Risk per share: |102,062.9 - 102,178.4| + (102,062.9 × 0.0006) + (102,178.4 × 0.0006) = 115.5 + 61.24 + 61.31 = 238.05 USDT
Shares: 40 ÷ 238.05 = 0.168 shares (rounded to 0.17 in display)
Position Size: 0.17 × 102,062.9 = 17,350.69 USDT
Position Amount (with 9x leverage): 17,350.69 ÷ 9 = 1,927.85 USDT
For 2:1 RR: Net win = 238.05 × 0.17 × 2 = 80.94 USDT
TP1 price = (80.94 + (1 × 102,062.9 × 0.17) + (102,062.9 × 0.0006 × 0.17)) ÷ (1 × 0.17 - 0.0006 × 0.17) = 101,464.7 USDT
For 3:1 RR: TP2 price = 101,226.7 USDT (following same formula with RR=3)
This ensures that after accounting for all fees, the actual risk-reward ratio matches the specified target ratio.
Risk Management Features
Maximum Trade Amount: Optional setting to limit position size regardless of account size
Leverage Limits: Built-in maximum leverage protection
Fee Integration: All calculations include realistic trading fees for accurate expectations
Validation: Automatic checking that take-profit portions sum to 100%
Historical Tracking: Visual indication when stop-loss or take-profit levels are reached (within last 5000 bars)
Understanding Max Trade Amount - Multiple Simultaneous Trades:
The "Max Trade Amount" feature is designed for traders who want to open multiple positions simultaneously while maintaining proper risk management. Here's how it works:
Key Concept:
- Risk percentage (2%) always applies to your full Account Size
- Max Trade Amount limits the capital allocated per individual trade
- This allows multiple trades with full risk on each trade
Example from Screenshot:
Account Size: 2,000 USDT
Max Trade Amount: 500 USDT
Risk per Trade: 2% × 2,000 = 40 USDT per trade
Stop Loss Distance: 0.11% from entry
Result: Position Size = 17,350.69 USDT with 35x leverage
Total Risk (including fees): 40.46 USDT
Multiple Trades Strategy:
With this setup, you can open:
Trade 1: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 2: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 3: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Trade 4: 40 USDT risk, 495.73 USDT position amount (35x leverage)
Total Portfolio Exposure:
- 4 simultaneous trades = 4 × 495.73 = 1,982.92 USDT position amount
- Total risk exposure = 4 × 40 = 160 USDT (8% of account)
PivotBoss VWAP Bands (Auto TF) - FixedWhat this indicator shows (high level)
The indicator plots a VWAP line and three bands above (R1, R2, R3) and three bands below (S1, S2, S3).
Band spacing is computed from STD(abs(VWAP − price), N) and multiplied by 1, 2 and 3 to form R1–R3 / S1–S3. The script is timeframe-aware: on 30m/1H charts it uses Weekly VWAP and weekly bands; on Daily charts it uses Monthly VWAP and monthly bands; otherwise it uses the session/chart VWAP.
VWAP = the market’s volume-weighted average price (a measure of fair value). Bands = volatility-scaled zones around that fair value.
Trading idea — concept summary
VWAP = fair value. Price above VWAP implies bullish bias; below VWAP implies bearish bias.
Bands = graded overbought/oversold zones. R1/S1 are near-term limits, R2/S2 are stronger, R3/S3 are extreme.
Use trend alignment + price action + volume to choose higher-probability trades. VWAP bands give location and magnitude; confirmations reduce false signals.
Entry rules (multiple strategies with examples)
A. Momentum breakout (trend-following) — preferred on trending markets
Setup: Price consolidates near or below R1 and then closes above R1 with above-average volume. Chart: 30m/1H (Weekly VWAP) or Daily (Monthly VWAP) depending on your timeframe.
Entry: Enter long at the close of the breakout bar that closes above R1.
Stop-loss: Place initial stop below the higher of (VWAP or recent swing low). Example: if price broke R1 at ₹1,200 and VWAP = ₹1,150, set stop at ₹1,145 (5 rupee buffer below VWAP) or below the last swing low if that is wider.
Target: Partial target at R2, full target at R3. Trail stop to VWAP or to R1 after price reaches R2.
Example numeric: Weekly VWAP = ₹1,150, R1 = ₹1,200, R2 = ₹1,260. Buy at ₹1,205 (close above R1), stop ₹1,145, target1 ₹1,260 (R2), target2 ₹1,320 (R3).
B. Mean-reversion fade near bands — for range-bound markets
Setup: Market is not trending (VWAP flatish). Price rallies up to R2 or R3 and shows rejection (pin bar, bearish engulfing) on increasing or neutral volume.
Entry: Enter short after a confirmed rejection candle that fails to sustain above R2 or R3 (prefer confirmation: close back below R1 or below the rejection candle low).
Stop-loss: Just above the recent high (e.g., 1–2 ATR or a fixed buffer above R2/R3).
Target: First target VWAP, second target S1. Reduce size if taking R3 fade as it’s an extreme.
Example numeric: VWAP = ₹950, R2 = ₹1,020. Price spikes to ₹1,025 and forms a bearish engulfing candle. Enter short at ₹1,015 after the next close below ₹1,020. Stop at ₹1,035, target VWAP ₹950.
C. Pullback entries in trending markets — higher probability
Setup: Price is above VWAP and trending higher (higher highs and higher lows). Price pulls back toward VWAP or S1 with decreasing downside volume and a reversal candle forms.
Entry: Long when price forms a bullish reversal (hammer/inside-bar) with a close back above the pullback candle.
Stop-loss: Below the pullback low (or below S2 if a larger stop is justified).
Target: VWAP then R1; if momentum resumes, trail toward R2/R3.
Example numeric: Price trending above Weekly VWAP at ₹1,400; pullback to S1 at ₹1,360. Enter long at ₹1,370 when a bullish candle closes; stop at ₹1,350; first target VWAP ₹1,400, second target R1 ₹1,450.
Exit rules and money management
Basic exit hierarchy
Hard stop exit — when price hits initial stop-loss. Always use.
Target exit — take partial profits at R1/R2 (for longs) or S1/S2 (for shorts). Use trailing stops for the remainder.
VWAP invalidation — if you entered long above VWAP and price returns and closes significantly below VWAP, consider exiting (condition depends on timeframe and trade size).
Price action exit — reversal patterns (strong opposite candle, bearish/bullish engulfing) near targets or beyond signals to exit.
Trailing rules
After price reaches R2, move stop to breakeven + a small buffer or to VWAP.
After price reaches R3, trail by 1 ATR or lock a defined profit percentage.
Position sizing & risk
Risk per trade: commonly 0.5–2% of account equity.
Determine position size by RiskAmount ÷ (EntryPrice − StopPrice).
If the stop distance is large (e.g., trading R3 fades), reduce position size.
Filters & confirmation (to reduce false signals)
Volume filter: For breakouts, require volume above short-term average (e.g., >20-period average). Breakouts on low volume are suspect.
Trend filter: Only take breakouts in the direction of the higher-timeframe trend (for example, use Daily/Weekly trend when trading 30m/1H).
Candle confirmation: Prefer entries on close of the confirming candle (not intrabar noise).
Multiple confirmations: When R1 break happens but RSI/plotted momentum indicator does not confirm, treat signal as lower probability.
Special considerations for timeframe-aware logic
On 30m/1H the script uses Weekly VWAP/bands. That means band levels change only on weekly candles — they are strong, structural levels. Treat R1/R2/R3 as significant and expect fewer, stronger signals.
On Daily, the script uses Monthly VWAP/bands. These are wider; trades should allow larger stops and smaller position sizes (or be used for swing trades).
On other intraday charts you get session VWAP (useful for intraday scalps).
Example: If you trade 1H and the Weekly R1 is at ₹2,400 while session VWAP is ₹2,350, a close above Weekly R1 represents a weekly-level breakout — prefer that for swing entries rather than scalps.
Example trade walkthrough (step-by-step)
Context: 1H chart, auto-mapped → Weekly VWAP used.
Weekly VWAP = ₹3,000; R1 = ₹3,080; R2 = ₹3,150.
Price consolidates below R1. A large bullish candle closes at ₹3,085 with volume 40% above the 20-bar average.
Entry: Buy at close ₹3,085.
Stop: Place stop at ₹2,995 (just under Weekly VWAP). Risk = ₹90.
Position size: If risking ₹900 per trade → size = 900 ÷ 90 = 10 units.
Targets: Partial take-profit at R2 = ₹3,150; rest trailed with stop moved to breakeven after R2 is hit.
If price reverses and closes below VWAP within two bars, exit immediately to limit drawdown.
When to avoid trading these signals
High-impact news (earnings, macro announcements) that can gap through bands unpredictably.
Thin markets with low volume — VWAP loses significance when volumes are extremely low.
When weekly/monthly bands are flat but intraday price is volatile without clear structure — prefer session VWAP on smaller timeframes.
Alerts & automation suggestions
Alert on close above R1 / below S1 (use the built-in alertcondition the script adds). For higher-confidence alerts, require volume filter in the alert condition.
Automated order rules (if you automate): use limit entry at breakout close plus a small slippage buffer, immediate stop order, and OCO for TP and SL.
BackTestLibLibrary "BackTestLib"
Allows backtesting indicator performance. Tracks typical metrics such as won/loss, profit factor, draw down, etc. Trading View strategy library provides similar (and more comprehensive)
functionality but only works with strategies. This libary was created to address performance tracking within indicators.
Two primary outputs are generated:
1. Summary Table: Displays overall performance metrics for the indicator over the chart's loaded timeframe and history
2. Details Table: Displays a table of individual trade entries and exits. This table can grow larger than the available chart space. It does have a max number of rows supported. I haven't
found a way to add scroll bars or scroll bar equivalents yet.
f_init(data, _defaultStopLoss, _defaultTakeProfit, _useTrailingStop, _useTraingStopToBreakEven, _trailingStopActivation, _trailingStopOffset)
f_init Initialize the backtest data type. Called prior to using the backtester functions
Parameters:
data (backtesterData) : backtesterData to initialize
_defaultStopLoss (float) : Default trade stop loss to apply
_defaultTakeProfit (float) : Default trade take profit to apply
_useTrailingStop (bool) : Trailing stop enabled
_useTraingStopToBreakEven (bool) : When trailing stop active, trailing stop will increase no further than the entry price
_trailingStopActivation (int) : When trailing stop active, trailing will begin once price exceeds base stop loss by this number of points
_trailingStopOffset (int) : When trailing stop active, it will trail the max price achieved by this number of points
Returns: Initialized data set
f_buildResultStr(_resultType, _price, _resultPoints, _numWins, _pointsWon, _numLoss, _pointsLost)
f_buildResultStr Helper function to construct a string of resutling data for exit tooltip labels
Parameters:
_resultType (string)
_price (float)
_resultPoints (float)
_numWins (int)
_pointsWon (float)
_numLoss (int)
_pointsLost (float)
f_buildResultLabel(data, labelVertical, labelOffset, long)
f_buildResultLabel Helper function to construct an Exit label for display on the chart
Parameters:
data (backtesterData)
labelVertical (bool)
labelOffset (int)
long (bool)
f_updateTrailingStop(_entryPrice, _curPrice, _sl, _tp, trailingStopActivationInput, trailingStopOffsetInput, useTrailingStopToBreakEven)
f_updateTrailingStop Helper function to advance the trailing stop as price action dictates
Parameters:
_entryPrice (float)
_curPrice (float)
_sl (float)
_tp (float)
trailingStopActivationInput (float)
trailingStopOffsetInput (float)
useTrailingStopToBreakEven (bool)
Returns: Updated stop loss for current price action
f_enterShort(data, entryPrice, fixedStopLoss)
f_enterShort Helper function to enter a short and collect data necessary for tracking the trade entry
Parameters:
data (backtesterData)
entryPrice (float)
fixedStopLoss (float)
Returns: Updated backtest data
f_enterLong(data, entryPrice, fixedStopLoss)
f_enterLong Helper function to enter a long and collect data necessary for tracking the trade entry
Parameters:
data (backtesterData)
entryPrice (float)
fixedStopLoss (float)
Returns: Updated backtest data
f_exitTrade(data)
f_enterLong Helper function to exit a trade and update/reset tracking data
Parameters:
data (backtesterData)
Returns: Updated backtest data
f_checkTradeConditionForExit(data, condition, curPrice, enableRealTime)
f_checkTradeConditionForExit Helper function to determine if provided condition indicates an exit
Parameters:
data (backtesterData)
condition (bool) : When true trade will exit
curPrice (float)
enableRealTime (bool) : When true trade will evaluate if barstate is relatime or barstate is confirmed; otherwise just checks on is confirmed
Returns: Updated backtest data
f_checkTrade(data, curPrice, curLow, curHigh, enableRealTime)
f_checkTrade Helper function to determine if current price action dictates stop loss or take profit exit
Parameters:
data (backtesterData)
curPrice (float)
curLow (float)
curHigh (float)
enableRealTime (bool) : When true trade will evaluate if barstate is relatime or barstate is confirmed; otherwise just checks on is confirmed
Returns: Updated backtest data
f_fillCell(_table, _column, _row, _title, _value, _bgcolor, _txtcolor, _text_size)
f_fillCell Helper function to construct result table cells
Parameters:
_table (table)
_column (int)
_row (int)
_title (string)
_value (string)
_bgcolor (color)
_txtcolor (color)
_text_size (string)
Returns: Table cell
f_prepareStatsTable(data, drawTesterSummary, drawTesterDetails, summaryTableTextSize, detailsTableTextSize, displayRowZero, summaryTableLocation, detailsTableLocation)
f_fillCell Helper function to populate result table
Parameters:
data (backtesterData)
drawTesterSummary (bool)
drawTesterDetails (bool)
summaryTableTextSize (string)
detailsTableTextSize (string)
displayRowZero (bool)
summaryTableLocation (string)
detailsTableLocation (string)
Returns: Updated backtest data
backtesterData
backtesterData - container for backtest performance metrics
Fields:
tradesArray (array) : Array of strings with entries for each individual trade and its results
pointsBalance (series float) : Running sum of backtest points won/loss results
drawDown (series float) : Running sum of backtest total draw down points
maxDrawDown (series float) : Running sum of backtest total draw down points
maxRunup (series float) : Running sum of max points won over the backtest
numWins (series int) : Number of wins of current backtes set
numLoss (series int) : Number of losses of current backtes set
pointsWon (series float) : Running sum of points won to date
pointsLost (series float) : Running sum of points lost to date
entrySide (series string) : Current entry long/short
tradeActive (series bool) : Indicates if a trade is currently active
tradeComplete (series bool) : Indicates if a trade just exited (due to stop loss or take profit)
entryPrice (series float) : Current trade entry price
entryTime (series int) : Current trade entry time
sl (series float) : Current trade stop loss
tp (series float) : Current trade take profit
defaultStopLoss (series float) : Default trade stop loss to apply
defaultTakeProfit (series float) : Default trade take profit to apply
useTrailingStop (series bool) : Trailing stop enabled
useTrailingStopToBreakEven (series bool) : When trailing stop active, trailing stop will increase no further than the entry price
trailingStopActivation (series int) : When trailing stop active, trailing will begin once price exceeds base stop loss by this number of points
trailingStopOffset (series int) : When trailing stop active, it will trail the max price achieved by this number of points
resultType (series string) : Current trade won/lost
exitPrice (series float) : Current trade exit price
resultPoints (series float) : Current trade points won/lost
summaryTable (series table) : Table to deisplay summary info
tradesTable (series table) : Table to display per trade info






















