XAUUSD Pro Setup Suite manuel_lnt.fx is an advanced Pine Script v6 indicator designed exclusively for XAUUSD, built to automatically detect the 5 highest-probability setups in gold day trading.
It combines institutional price action, volatility patterns, mean reversion logic, and momentum confirmation to generate clean, filtered, and actionable signals.
The indicator automatically detects:
⸻
1️⃣ Break & Retest Premium (BR)
Identifies valid breaks of key levels and signals the retest with rejection wick, EMA20 trend confirmation, and neutral RSI.
→ Excellent for trend continuation.
⸻
2️⃣ Fakeout Liquidity Trap (FO)
Detects liquidity grabs above highs or below lows with an opposite close + engulfing candle confirmation.
→ The strongest setup for fast and explosive reversals on gold.
⸻
3️⃣ MACD Zero-Line Shift (MACD)
Signals when the MACD crosses the zero line while price breaks micro-structure.
→ Perfect for spotting the start of a new trend.
⸻
4️⃣ Bollinger Squeeze → Breakout (BB)
Recognizes volatility compression and signals when a breakout is likely to explode.
→ Ideal for clean breakout trades.
⸻
5️⃣ Mean Reversion on EMA50 (MR)
Highlights price extensions far away from the EMA50 with ATR confirmation and a reversal candle.
→ Great for pullbacks back toward the mean value.
指标和策略
52-Week High Percentage BandsGeneral price band indicator for momentum trading:
How to use the code
Open TradingView and navigate to a chart.
Click the "Pine Editor" tab at the bottom of your screen.
Delete any existing code in the editor window.
Copy and paste the Pine Script code provided above into the Pine Editor.
Click "Add to Chart" to apply the indicator.
How the code works
indicator("52-Week High Percentage Bands", overlay=true): This line names the indicator and tells TradingView to plot it directly on the price chart.
request.security(syminfo.tickerid, "D", ta.highest(high, lookbackPeriod)): This is the most critical part. It fetches the highest price from the daily timeframe over the last 365 days. This ensures accuracy even if your chart is set to a different timeframe (e.g., 4-hour or weekly).
upperBand and lowerBand: These variables calculate the specific price levels for the 10% and 23% bands by multiplying the 52-week high by 0.90 and 0.77, respectively.
plot(): This function draws the horizontal lines on the chart for each band.
fill(): This function takes two plots as arguments and colors the space between them to create the "band" effect.
highestHigh: This optional plot adds a line to show you the exact 52-week high.
Stocktech- Neutral Candle VisualiserStocktech.in™ — Neutral Candle Visualizer
Stocktech Neutral Candle Visualizer highlights price candles based on body strength.
Large-body candles follow trend direction (green/red), while small or neutral candles are marked in blue.
Simple, clean, and optimized for discretionary traders who prefer clear visual cues without indicators.
Features:
Auto-colored candles based on body size
Trend candles = green (bull) / red (bear)
Neutral/low-strength candles = blue
Works on all markets & timeframes
Created by Stocktech.in™
EMA 9×20 Multi-TF Scanner — M/W/DThis scrip will facilitate for swing trade based on momentum achieved in monthly weekly and daily
Michael's FVG Detector═══════════════════════════════════════
Michael's FVG Detector
═══════════════════════════════════════
A clean and efficient Fair Value Gap (FVG) indicator for TradingView that helps traders identify market imbalances with precision.
───────────────────────────────────────
Overview
───────────────────────────────────────
Fair Value Gaps (FVGs) are price inefficiencies that occur when there's a gap between the wicks of candlesticks, indicating rapid price movement with minimal trading activity. These gaps often act as support/resistance zones where price may return to "fill the gap."
This indicator automatically detects and visualizes both bullish and bearish FVGs on any timeframe, making it easy to spot potential trading opportunities.
───────────────────────────────────────
Features
───────────────────────────────────────
Core Functionality
Automatic FVG Detection : Identifies Fair Value Gaps in real-time as they form
Bullish & Bearish FVGs : Detects both upward and downward price gaps
3-Candle Pattern : Uses classic FVG logic (current candle low > high from 2 bars ago for bullish, vice versa for bearish)
Gap Size Display : Shows the exact size of each FVG in ticks directly on the box
Confirmed Bars Only : Only draws FVGs on confirmed bars to prevent repainting
Customization
Color Settings : Fully customizable colors for bullish and bearish FVGs with transparency control
Text Color : Configurable color for the tick size labels
Default Styling : Comes with sensible defaults (20% transparency, dark gray labels)
Performance Optimization
Smart Cleanup : Automatically removes boxes outside the visible chart area
Efficient Rendering : Maintains optimal performance even on lower timeframes
No Repainting : Uses confirmed bars only for reliable signals
───────────────────────────────────────
How It Works
───────────────────────────────────────
Detection Logic
Bullish FVG:
Current bar's low is higher than the high from 2 bars ago
Creates an upward gap that price left behind during bullish momentum
Bearish FVG:
Current bar's high is lower than the low from 2 bars ago
Creates a downward gap that price left behind during bearish momentum
Visual Display
Each detected FVG is displayed as:
A semi-transparent colored box spanning the gap area
The box extends from bar -2 to the current bar
Gap size in ticks shown at the bottom-left of each box
Singular/plural formatting ("1 tick" vs "X ticks")
───────────────────────────────────────
Performance Notes
───────────────────────────────────────
Cleanup runs every 50 bars to maintain optimal performance
Only creates boxes on confirmed bars (no real-time repainting)
Efficiently manages memory by removing off-screen boxes
Suitable for both manual and automated trading strategies
───────────────────────────────────────
Disclaimer
───────────────────────────────────────
This indicator is for educational and informational purposes only. It is not financial advice. Always do your own research and risk management before making trading decisions.
───────────────────────────────────────
Author : Michael
Version : 1.0
License : Free for personal use
Last Updated : November 2025
session high and low (only for current day) -HITHVEERits about session highs and lows and only for the current day and main sessions are asia london and newyork
TFU Multi-Symbol Screener + VWAP + Table Size Option + Blank RowTFU Multi-Symbol Screener + VWAP + Table Size Option + Blank Row
Net Profit Margin %📌 Net Profit Margin % Indicator — Short Explanation
This indicator calculates and displays a company’s Net Profit Margin (NPM) using its financial statements.
What it does:
Pulls Net Income and Total Revenue from the company’s quarterly (FQ) or yearly (FY) financials.
Calculates:
Net Profit Margin = (Net Income / Revenue) × 100
Plots the NPM% as a line chart.
Background turns green when margin is positive and red when negative.
Shows the latest NPM value in a small info table on the chart.
Purpose:
Helps you quickly see whether a company is profitable and how its profit margin is trending over time.
Turtle 20-Day Breakout (Donchian)Yes, the most important indicator used in the Turtle Rules (Turtle Trading Strategy) for finding breakouts above previous highs is the Donchian Channel. 🐢📈
Donchian Channel
The Donchian Channel is a trend-following indicator composed of three lines plotted on the chart:
Shutterstock
Upper Band: The highest high over the defined number of periods.
Lower Band: The lowest low over the defined number of periods.
Middle Line: The average of the Upper and Lower bands (not always used, but sometimes added for orientation).
The Turtle Rules use the following periods for the entry signals (breakouts) you mentioned in your query:
Short-Term (System 1): Crossing the 20-day high (this corresponds to the upper band of a Donchian Channel with a 20-period setting).
Mid-Term/Long-Term (System 2): Crossing the 55-day high (this corresponds to the upper band of a Donchian Channel with a 55-period setting).
Crossing the upper band signals a breakout and serves as the buy signal for a long position (for short positions, crossing below the lower band is used).
Is there anything else I can translate for you, or would you like me to elaborate on the Average True Range (ATR), the other key indicator used by the Turtles?
Stoch Cross OB/OS Signals CleanStoch Cross OB/OS Signals
Displays fast (%K) and slow (%D) Stochastic lines with visual signals for overbought and oversold conditions. Alerts when the fast line crosses the slow line in OB/OS zones using customizable symbols. Ideal for spotting short-term reversals and timing entries/exits. Features adjustable periods, OB/OS levels, and symbol sizes for clear chart visualization.
TNT TRADER MARKET ClOSEVertical Line of red showing the New York market close. Color and time can be changed
PEGY Ratio (Robust)
Using the PEG but incorporating Dividends in order to find value investing opportunities by better understanding growth vs. forward P/E.
PEGY Ratio (Div Adj PEG)Identifying the PEGY (Dividend Adjusted PEG) to find value investment opportunities.
Michael's Custom Watermark🔷 MICHAEL'S CUSTOM WATERMARK INDICATOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 OVERVIEW
A comprehensive chart watermark overlay that displays essential fundamental and technical information for stocks in a clean, customizable table format. Perfect for traders who want quick access to key metrics without cluttering their charts.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✨ KEY FEATURES
📊 Fundamental Data Display — Shows Industry, Sector, Market Cap, and P/E Ratio
📅 Earnings Information — Displays next earnings date with countdown timer
📈 ATR Volatility Indicator — 14-day ATR with color-coded visual alerts (🔴🟡🟢)
🎨 Auto Theme Detection — Automatically adjusts text color based on chart background
⚙️ Fully Customizable — Position, colors, size, and displayed metrics all adjustable
🏢 GICS Sector Mapping — Heuristic-based sector classification aligned with industry standards
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT MAKES THIS INDICATOR UNIQUE?
Unlike basic watermarks, this indicator provides:
Real-time fundamental data integration
Smart theme-aware color adaptation for both light and dark charts
Configurable volatility alerts using ATR thresholds
Earnings countdown feature to never miss important dates
Optimized display that only shows relevant data for the current symbol type
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 HOW TO USE
1. BASIC SETUP
Add the indicator to your chart. By default, it displays in the top-left corner with all features enabled.
2. POSITIONING
Vertical Location: Top, Middle, or Bottom
Horizontal Location: Left, Center, or Right
Vertical Offset: Fine-tune position with 0-50 pixel offset from top
3. CUSTOMIZATION OPTIONS
TEXT APPEARANCE:
Auto Text Color — Enable to automatically adapt text color to your chart theme
Manual Color — Set a fixed text color if auto-color is disabled
Text Size — Choose from Huge, Large, Normal, or Small
Theme Colors — Customize text color for light and dark backgrounds separately
DATA DISPLAY TOGGLES:
Show Industry & Sector — Display heuristic-based GICS-aligned sector and industry classification
Show Market Cap — View market capitalization in T/B/M format
Show P/E Ratio — Display Price-to-Earnings ratio (stocks only)
Show ATR (14-Day) — Display Average True Range with percentage and visual indicator
Show Next Earnings — Display upcoming earnings information
Show Earnings Countdown — Show days remaining until next earnings (requires earnings display)
4. ATR VOLATILITY ALERTS
Configure custom thresholds to monitor volatility:
Red Threshold — ATR percentage that triggers red alert 🔴 (default: 6%)
Yellow Threshold — ATR percentage that triggers yellow alert 🟡 (default: 3%)
Green — Shows automatically when ATR is below yellow threshold 🟢
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📐 UNDERSTANDING THE DISPLAY
🏢 SECTOR & INDUSTRY
Shows the GICS sector classification followed by the specific industry. The indicator uses heuristic-based mapping to align TradingView sectors with standard GICS classifications. Note that this mapping is based on keyword detection and industry analysis, so while generally accurate, it may not perfectly match official GICS classifications in all cases.
💰 MARKET CAP
Displays market capitalization using standard abbreviations:
T = Trillion
B = Billion
M = Million
📊 P/E RATIO
Shows the trailing twelve-month Price-to-Earnings ratio. Only displayed for stocks when enabled. Shows "N/A" if data is unavailable.
📈 ATR (14-DAY)
Displays the 14-period Average True Range in both absolute value and percentage terms, with a color-coded indicator:
🔴 Red: High volatility (above red threshold)
🟡 Yellow: Moderate volatility (between yellow and red thresholds)
🟢 Green: Low volatility (below yellow threshold)
📅 EARNINGS
Shows earnings information in three formats:
"X days remaining" — When countdown is enabled and earnings date is known
"Upcoming" — When date is in the future but countdown is disabled
"Recently Reported" — When earnings just occurred
"N/A" — When no earnings data is available
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ TECHNICAL DETAILS
SUPPORTED INSTRUMENTS:
Optimized for stocks with full fundamental data
Works with other instruments (crypto, forex, futures) but only displays applicable metrics
Automatically suppresses irrelevant data (e.g., P/E for non-stocks)
PERFORMANCE:
Lightweight overlay with minimal resource usage
Updates only on last bar for efficiency
No historical recalculation needed
COMPATIBILITY:
Pine Script v6
Works on all timeframes
Compatible with all chart types
Auto-adapts to theme changes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 TIPS & BEST PRACTICES
Enable Auto Text Color for seamless theme switching between light and dark modes
Adjust vertical offset to avoid overlap with price action in high-volatility periods
Use ATR thresholds appropriate to your trading style and asset class
Disable features you don't use to keep the watermark clean and focused
Position in corners to maximize chart viewing space
Use smaller text size for multi-panel layouts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 TROUBLESHOOTING
"N/A" SHOWING FOR P/E RATIO:
This is normal for non-stock instruments
May occur for stocks with negative earnings
Check if fundamental data is available for the symbol
EARNINGS SHOWING "N/A":
Earnings data may not be available for all stocks
Check TradingView's data coverage for your symbol
TEXT COLOR NOT VISIBLE:
Enable Auto Text Color feature
Manually set text color to contrast with your chart background
Adjust custom light/dark text colors in settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
This indicator is for informational purposes only. The fundamental data displayed is sourced from TradingView's data providers. Always verify critical information before making trading decisions. Past performance is not indicative of future results.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If you find this indicator helpful, please give it a boost 🚀 and share your feedback in the comments!
Version: 1.0
Pine Script Version: v6
Created by: Michael
ASHOK 15 Novashok trial 15 nov 1845h
I have created this strategy to convert my chart pattern and MACD, EMA observations to tradeable logic.
Vertical Lines: 5, 20, 50, 200 Days Back - 30 minutesVerticals lines to indicate 5, 20, 50, and 200 day marks on a 30 minute chart. Used in Swing trading with multi-timeframe approach to mark the levels.
Generated using Claude.
Ram Trend Scoring (Current TF Enhanced)Overview
The Ram Trend Scoring indicator is a trend & momentum scoring tool for Forex and other instruments. It evaluates multiple technical factors on the current timeframe to classify pairs as:
8 EMA Momentum Pair – strong trending momentum
20 EMA Pullback Pair – weaker trend, possible pullback setups
It uses a points-based system, where points are added for positive factors or subtracted for failed EMA conditions.
Scoring Components
Trend Structure – price relative to EMA20
ADX Strength – trend strength (>25 strong, >20 moderate)
Distance from EMA8 – price proximity to short-term EMA
Candle Body Strength – larger bodies indicate stronger momentum
Pullback Depth – evaluates how deep the retracement is
EMA8 Wick Rejection – bullish/bearish rejection near EMA8
EMA Separation – priority #1; ≥20 pips difference required, penalty -2 if not
EMA Angle – priority #2; slope ≥30° required, penalty -2 if not
EMA Order – priority #3; correct EMA8/EMA20 alignment, penalty -2 if not
Total Score = Sum of all factor scores.
Classification Threshold: default 12
Total ≥ threshold → “8 EMA Momentum Pair”
Total < threshold → “20 EMA Pullback Pair”
Table Display
2 columns × 11 rows:
Left column = factor name
Right column = score or value
Shows total score, individual scores, and classification
Usage / How to Trade
Trend Identification
Use the indicator to quickly see momentum strength
Check EMA plots and table scores for alignment
Priority Factors
First check EMA Separation (≥20 pips)
Then EMA Angle (≥30° slope)
Then EMA Order
Only if all conditions are met, consider the setup strong
Trade Planning
8 EMA Momentum Pair → Trend continuation setups
20 EMA Pullback Pair → Wait for retracement or reversal signals
Confirmation
Combine with your usual support/resistance, FVG, or price action for entry
Higher total scores → higher probability setups
Alerts
Use the built-in alerts for “8 EMA Momentum Pair” and “20 EMA Pullback Pair”
Key Advantages
Works entirely on current timeframe → no HTF errors
Easy visual scoring table
Adjustable parameters: EMAs, ADX, ATR, angle, separation
Helps identify high-probability trend continuation or pullback trades
Trendline Indicator for Pionex 2//@version=5
indicator("Trendline Indicator for Pionex", overlay=true)
// ----- קו מגמה ידני -----
// יוצרים קו מגמה פשוט לגרירה ידנית
var line trendLine = line.new(x1=bar_index-10, y1=close , x2=bar_index, y2=close, extend=extend.right, color=color.blue, width=2)
// קבלת המחיר הנוכחי של הקו
trendPrice = line.get_price(trendLine, bar_index)
// ----- תנאי קנייה ומכירה -----
longCondition = close > trendPrice
shortCondition = close < trendPrice
// ----- הצגה גרפית של תנאי הקנייה והמכירה -----
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
crypto edition//@version=5
strategy("crypto edition", overlay=true,
default_qty_type=strategy.fixed, default_qty_value=1, precision=5)
// ===== INPUTS =====
// --- Equity Mode ---
useEquityMode = input.bool(true, "Use Equity-based Position Sizing (On/Off)")
useEquityGrowth = input.bool(true, "Use Equity Growth/Compounding (On/Off)", tooltip="ON = Risk based on current equity (compounding) OFF = Risk based on initial capital (no compounding)")
fixedQty = input.float(1.0, "Fixed Lot Size (used when Equity Mode = Off)", minval=0.001, step=0.001)
// --- Risk Management ---
riskPercent = input.float(1.0, "Risk % per trade", minval=0.1, maxval=100, step=0.1)
atrSlMultiplier = input.float(2.0, "ATR SL Multiplier", minval=0.1, maxval=10, step=0.1)
atrTpMultiplier = input.float(3.0, "ATR TP Multiplier", minval=0.1, maxval=20, step=0.1)
// <-- Breakeven inputs -->
breakevenOn = input.bool(false, "Enable Breakeven (on/off)")
breakevenAtrMultiplier = input.float(1.0, "Breakeven ATR Multiplier", minval=0.0, maxval=10.0, step=0.1)
atrLength = input.int(14, "ATR Length (current TF)", minval=1, maxval=100, step=1)
atrTF = input.timeframe("", "ATR Timeframe (blank = chart TF)")
barsToWait = input.int(8, "Bars to wait since last trade", minval=1, maxval=100, step=1)
// --- Moving Average ---
maType = input.string("HMA", "Moving Average Type", options= )
maLength = input.int(20, "MA Length", minval=1, maxval=200, step=1)
maTF = input.timeframe("", "MA Timeframe")
// --- Additional Moving Average Filter ---
useMA2Filter = input.bool(true, "Use Second MA Filter (ON/OFF)")
ma2Type = input.string("HMA", "Second MA Type", options= )
ma2Length = input.int(50, "Second MA Length", minval=1, maxval=200, step=1)
ma2TF = input.timeframe("", "Second MA Timeframe")
// --- Kernel Inputs ---
lookbackWindow = input.int(14, "Kernel lookback window (h)", minval=1, maxval=200, step=1)
alpha = input.float(0.25, "Kernel alpha", minval=0.01, maxval=5.0, step=0.01)
startRegression = input.int(12, "Kernel start regression (x_0)", minval=1, maxval=100, step=1)
kernelAtrLength = input.int(7, "Kernel ATR length", minval=1, maxval=100, step=1)
nearFactor = input.float(1.9, "Near factor", minval=0.1, maxval=10, step=0.1)
farFactor = input.float(5.0, "Far factor", minval=0.1, maxval=10, step=0.1)
kernelTF = input.timeframe("", "Kernel Timeframe (Near/Far bands) (blank = chart TF)")
// --- Session Filters ---
enableSessionFilter = input.bool(false, "Enable Session Filtering")
londonSession = input.session("0800-1600", "London Session (from-to)")
nySession = input.session("1300-2200", "New York Session (from-to)")
asianSession = input.session("0000-0900", "Asian Session (from-to)")
// --- Miscellaneous ---
showPlots = input.bool(true, "Show plots (MA only)")
// ===== GLOBAL VARIABLES =====
var int lastTradeBar = na
var bool breakevenLongSet = false
var bool breakevenShortSet = false
// --- Streak Tracking ---
var int currentWinStreak = 0
var int currentLossStreak = 0
var int maxWinStreak = 0
var int maxLossStreak = 0
// ===== FUNCTIONS =====
// Hull MA function
hma(src, length) =>
ta.wma(2 * ta.wma(src, length / 2) - ta.wma(src, length), math.round(math.sqrt(length)))
// Select MA type
maValue =
maType == "HMA" ? request.security(syminfo.tickerid, maTF == "" ? timeframe.period : maTF, hma(close, maLength)) :
maType == "EMA" ? request.security(syminfo.tickerid, maTF == "" ? timeframe.period : maTF, ta.ema(close, maLength)) :
maType == "WMA" ? request.security(syminfo.tickerid, maTF == "" ? timeframe.period : maTF, ta.wma(close, maLength)) :
na
// Second MA calculation
ma2Value =
ma2Type == "HMA" ? request.security(syminfo.tickerid, ma2TF == "" ? timeframe.period : ma2TF, hma(close, ma2Length)) :
ma2Type == "EMA" ? request.security(syminfo.tickerid, ma2TF == "" ? timeframe.period : ma2TF, ta.ema(close, ma2Length)) :
ma2Type == "WMA" ? request.security(syminfo.tickerid, ma2TF == "" ? timeframe.period : ma2TF, ta.wma(close, ma2Length)) :
na
// ===== TREND DETECTION =====
// Conditions based on MA filter toggle
isUptrend = useMA2Filter ? (close > maValue and close > ma2Value) : (close > maValue)
isDowntrend = useMA2Filter ? (close < maValue and close < ma2Value) : (close < maValue)
// ===== SESSION FILTERING =====
inLondon = not na(time(timeframe.period, londonSession))
inNY = not na(time(timeframe.period, nySession))
inAsian = not na(time(timeframe.period, asianSession))
inSession = enableSessionFilter ? (inLondon or inNY or inAsian) : true
// ===== KERNEL FUNCTIONS =====
rationalKernel(series, startIdx, h, alpha) =>
sum = 0.0
sumW = 0.0
hh = h <= 0 ? 1 : h
denomBase = 2.0 * alpha * hh * hh
for i = 0 to hh - 1
idx = startIdx + i
p = nz(series )
dist = float(i)
w = math.pow(1.0 + (dist * dist) / denomBase, -alpha)
sum += w * p
sumW += w
sumW == 0.0 ? nz(series ) : sum / sumW
kernelATR(rhigh, rlow, rclose, startIdx, h, alpha, length) =>
trSum = 0.0
wSum = 0.0
maxIndex = math.min(length - 1, h - 1)
denomBase = 2.0 * alpha * h * h
for i = 0 to maxIndex
idx = startIdx + i
hhval = nz(rhigh )
llval = nz(rlow )
ccval = nz(rclose )
prevClose = nz(rclose )
tr = i == 0 ? hhval - llval : math.max(hhval - llval, math.max(math.abs(hhval - prevClose), math.abs(llval - prevClose)))
dist = float(i)
w = math.pow(1.0 + (dist * dist) / denomBase, -alpha)
trSum += tr * w
wSum += w
wSum == 0.0 ? (nz(rhigh ) - nz(rlow )) : trSum / wSum
// ===== PREPARE SERIES =====
haveEnough = bar_index > lookbackWindow + kernelAtrLength + 5
_kTF = kernelTF == "" ? timeframe.period : kernelTF
yhat_close = request.security(syminfo.tickerid, _kTF, rationalKernel(close, 0, lookbackWindow, alpha))
yhat_high = request.security(syminfo.tickerid, _kTF, rationalKernel(high, 0, lookbackWindow, alpha))
yhat_low = request.security(syminfo.tickerid, _kTF, rationalKernel(low, 0, lookbackWindow, alpha))
ktr = request.security(syminfo.tickerid, _kTF, kernelATR(high, low, close, 0, lookbackWindow, alpha, kernelAtrLength))
prev_yhat_close = request.security(syminfo.tickerid, _kTF, rationalKernel(close, 1, lookbackWindow, alpha))
prev_ktr = request.security(syminfo.tickerid, _kTF, kernelATR(high, low, close, 1, lookbackWindow, alpha, kernelAtrLength))
prevUpperNear = prev_yhat_close + nearFactor * prev_ktr
prevLowerNear = prev_yhat_close - nearFactor * prev_ktr
_atrTF = atrTF == "" ? timeframe.period : atrTF
currentAtr = request.security(syminfo.tickerid, _atrTF, ta.atr(atrLength))
upper_far = yhat_close + farFactor * ktr
upper_near= yhat_close + nearFactor * ktr
lower_near= yhat_close - nearFactor * ktr
lower_far = yhat_close - farFactor * ktr
closePrice = close
prevClose = close
// ===== ENTRY CONDITIONS =====
buyCondition = (prevClose <= prevLowerNear) and (closePrice > lower_near)
sellCondition = (prevClose >= prevUpperNear) and (closePrice < upper_near)
// ===== TREND FILTERED CONDITIONS =====
validBuyCondition = buyCondition and (closePrice < lower_near * 1.05) and isUptrend
validSellCondition = sellCondition and (closePrice > upper_near * 0.95) and isDowntrend
// ===== TRADE MANAGEMENT =====
canEnterTrade = na(lastTradeBar) ? true : (bar_index - lastTradeBar) >= barsToWait
noPos = strategy.position_size == 0
slLong = closePrice - atrSlMultiplier * currentAtr
tpLong = closePrice + atrTpMultiplier * currentAtr
slShort = closePrice + atrSlMultiplier * currentAtr
tpShort = closePrice - atrTpMultiplier * currentAtr
calcQtyByRisk(stopLossDistance) =>
accountBalance = useEquityGrowth ? strategy.equity : strategy.initial_capital
moneyRisk = accountBalance * (riskPercent / 100.0)
pointValue = syminfo.pointvalue
moneyRisk / (stopLossDistance * pointValue)
// ===== ENTRY & EXIT RULES =====
if noPos and canEnterTrade and haveEnough and inSession
if validBuyCondition
stopLossDistance = closePrice - slLong
qty = useEquityMode ? calcQtyByRisk(stopLossDistance) : fixedQty
if qty > 0
strategy.entry("Long", strategy.long, qty=qty)
strategy.exit("Exit Long", "Long", stop=slLong, limit=tpLong)
lastTradeBar := bar_index
if validSellCondition
stopLossDistance = slShort - closePrice
qty = useEquityMode ? calcQtyByRisk(stopLossDistance) : fixedQty
if qty > 0
strategy.entry("Short", strategy.short, qty=qty)
strategy.exit("Exit Short", "Short", stop=slShort, limit=tpShort)
lastTradeBar := bar_index
// ===== BREAKEVEN LOGIC =====
if strategy.position_size > 0
if breakevenOn and not breakevenLongSet
entryPrice = strategy.position_avg_price
if high >= entryPrice + breakevenAtrMultiplier * currentAtr
breakevenStop = entryPrice
strategy.exit("Exit Long", "Long", stop=breakevenStop, limit=tpLong)
breakevenLongSet := true
breakevenShortSet := false
else if strategy.position_size < 0
if breakevenOn and not breakevenShortSet
entryPrice = strategy.position_avg_price
if low <= entryPrice - breakevenAtrMultiplier * currentAtr
breakevenStop = entryPrice
strategy.exit("Exit Short", "Short", stop=breakevenStop, limit=tpShort)
breakevenShortSet := true
breakevenLongSet := false
if noPos
breakevenLongSet := false
breakevenShortSet := false
// ===== STREAK TRACKING ON TRADE CLOSE =====
var int lastTradeResult = 0 // 1 = win, -1 = loss, 0 = none
if strategy.closedtrades > 0
int tradeIndex = strategy.closedtrades - 1
float tradeProfit = strategy.closedtrades.profit(tradeIndex)
// Detect new closed trade
if tradeIndex != lastTradeResult
if tradeProfit > 0
currentWinStreak += 1
currentLossStreak := 0
maxWinStreak := math.max(maxWinStreak, currentWinStreak)
else if tradeProfit < 0
currentLossStreak += 1
currentWinStreak := 0
maxLossStreak := math.max(maxLossStreak, currentLossStreak)
lastTradeResult := tradeIndex
// Reset on first bar
if barstate.isfirst
currentWinStreak := 0
currentLossStreak := 0
maxWinStreak := 0
maxLossStreak := 0
// ===== PLOTS =====
plot(showPlots ? maValue : na, "Selected MA", color=color.orange, linewidth=2)
plot(showPlots and useMA2Filter ? ma2Value : na, "Second MA", color=color.purple, linewidth=2)
BTC Session Zones (Asia/London/NY)This indicator is designed to help crypto traders visualize the three major global trading sessions: Asian, London, and New York. It is particularly useful for identifying the recurring market phenomenon where price action during the Asian session (low liquidity) is often reversed or tested during the US session (high institutional liquidity).
By highlighting these time windows directly on the chart, traders can better anticipate volatility spikes, trap setups, and reversals—specifically the "Asia Pump, NY Dump" pattern.
Key Features:
🟢 Asian Session (Green Background):
Time: UTC 00:00 - 08:00
Context: Often characterized by retail accumulation or "maintenance" moves. If the price rallies here on low volume, be cautious of a reversal later.
🔵 London Session (Blue Background):
Time: UTC 07:00 - 15:00
Context: The transition period. Volatility begins to increase. The overlap with the Asian session (07:00-08:00 UTC) can set the tone for the day.
🔴 New York Session (Red Background):
Time: UTC 13:00 - 21:00
Context: High Risk / High Liquidity. This is when institutional capital and macroeconomic data hit the market. The overlap with the London session (13:00-15:00 UTC) is typically the most volatile period of the day.
🔻 NY Open Warning:
Includes a specific visual marker (Red Triangle) at the US stock market open (approx. 13:30 UTC) to signal potential trend reversals or "dump" risks.






















