Intraday Momentum for Volatile Stocks 29.09The strategy targets intraday momentum breakouts in volatile stocks when the broader market (Nifty) is in an uptrend. It enters long positions when stocks move significantly above their daily opening price with sufficient volume confirmation, then manages the trade using dynamic ATR-based stops and profit targets.
Entry Conditions
Price Momentum Filter: The stock must move at least 2.5% above its daily opening price, indicating strong bullish momentum. This percentage threshold is customizable and targets gap-up scenarios or strong intraday breakouts.
Volume Confirmation: Daily cumulative volume must exceed the 20-day average volume, ensuring institutional participation and genuine momentum. This prevents false breakouts on low volume.
Market Regime Filter: The Nifty index must be trading above its 50-day SMA, indicating a favorable market environment for momentum trades. This macro filter helps avoid trades during bearish market conditions.
Money Flow Index: MFI must be above 50, confirming buying pressure and positive money flow into the stock. This adds another layer of momentum confirmation.
Time Restriction: Trades are only initiated before 3:00 PM to ensure sufficient time for position management and avoid end-of-day volatility.
Exit Management
ATR Trailing Stop Loss: Uses a 3x ATR multiplier for dynamic stop-loss placement that trails higher highs, protecting profits while giving trades room to breathe. The trailing mechanism locks in gains as the stock moves favorably.
Profit Target: Set at 4x ATR above the entry price, providing a favorable risk-reward ratio based on the stock's volatility characteristics. This adaptive approach adjusts targets based on individual stock behavior.
Position Reset: Both stops and targets reset when not in a position, ensuring fresh calculations for each new trade.
Key Strengths
Volatility Adaptation: The ATR-based approach automatically adjusts risk parameters to match current market volatility levels. Higher volatility stocks get wider stops, while calmer stocks get tighter management.
Multi-Timeframe Filtering: Combines intraday price action with daily volume patterns and market regime analysis for robust signal generation.
Risk Management Focus: The strategy prioritizes capital preservation through systematic stop-loss placement and position sizing considerations.
Considerations for NSE Trading
This strategy appears well-suited for NSE intraday momentum trading, particularly for mid-cap and small-cap stocks that exhibit high volatility. The Nifty filter helps align trades with broader market sentiment, which is crucial in the Indian market context where sectoral and index movements strongly influence individual stocks.
The 2.5% threshold above open price is appropriate for volatile NSE stocks, though traders might consider adjusting this parameter based on the specific stocks being traded. The strategy's emphasis on volume confirmation is particularly valuable in the NSE environment where retail participation can create misleading price movements without institutional backin
אינדיקטורים ואסטרטגיות
Parabolic SAR BY CARLOZ🔹 What is the Parabolic SAR?
The Parabolic SAR (developed by Welles Wilder) is a trend-following indicator used to identify potential entry and exit points in the market.
🔹 What does “SAR” mean?
SAR = Stop And Reverse.
It suggests where to place a stop loss and also indicates when to reverse a position (from long to short or short to long).
🔹 How does it look on the chart?
It appears as a series of dots above or below the price:
Dots below price → bullish signal (uptrend).
Dots above price → bearish signal (downtrend).
Coach Box — Lite (Bottom-Right Guide) TOne-line tagline
“A tiny bottom-right guide that translates RSI/ramps momentum into clear actions: Go Outside / Go Inside / Hold / Wait.”
Long description (Public Library)
Coach Box — Lite is a minimal coaching panel that turns common momentum context (RSI, short-term “ramps”, basic regime) into a plain-English action with cautions.
What you get
Action: Go Outside (consider enter), Go Inside (consider exit/risk), Hold, or Wait
Why: one-line explanation (e.g., “clear setup; let it breathe.”)
Caution: quick risk flags (false-clear pressure, ramps misaligned, below EMA)
Context: score 0–10 with weather words (Rainy → Blue Sky), trend word, tiny regime vote
Inputs (simple)
Timeframes: 5m & 15m “ramps” (RSI2–RSI14), 1h & 4h RSI/MACD
Thresholds: ramp A/B triggers, RSI(1h/4h) “buy-ready”, EMA length
Emoji toggle for the weather text
How to read
Go Outside → momentum alignment is decent; if you trade it, size sanely and let it breathe.
Go Inside → risk is elevated (Rainy, ramps fail + below EMA, etc.).
Hold → already in; trail smart and watch RSI(1h)/ramps.
Wait → let setup cook; patience ≠ inaction.
Best practices
Treat this as coaching context, not an auto-trader. Pair with your entry/exit rules, stops, and R/R.
Test on your market & timeframe; thresholds are tunable.
Credits
Built by @hacklenajee with GPT-5 Thinking (ChatGPT).
Disclaimer
For education/research. Not financial advice. Markets carry risk.
Señales de Compra/Venta - KUSKUS + MACD AlgoAlphaseñales de compra/venta con base en la alineación de dos indicadores
LDR 2025 — DayTHIS IS NOT AN INDICATOR!
It's a loving gentle reminder for traders to keep an eye if this LDR day might impact your trading.
Daily EMA21 — Step LineIndicator: Daily EMA-21 Step Line
A lightweight tool that brings the Daily EMA-21 onto any timeframe chart as a clean, flat “step” line. It helps you see where price is in relation to a key higher-timeframe moving average, without cluttering your chart.
What It Does
Daily EMA Overlay: Fetches the Daily EMA-21 value and plots it on your chart, no matter what timeframe you’re viewing.
Step-Style Line: Drawn as a horizontal “step” line that only updates once per daily bar, keeping levels crisp and stable.
Repaint Control: Option to use the prior day’s EMA (stable, no intraday repaint) or today’s live-updating EMA.
Alerts: Optional alerts when price crosses above or below the Daily EMA-21.
How It Works
Daily Data Pull: Uses request.security to pull the Daily EMA-21 into any chart.
Flat Within Day: The value stays constant intraday and only “steps” at the next daily open.
Toggle Live/Prior: Choose between a repaint-free prior day close or an intraday-updating live EMA.
Configuration Settings
EMA Length: Default 21 (can be adjusted).
Live vs Prior: Toggle between today’s live EMA or yesterday’s confirmed EMA.
Line Color & Width: Fully customizable.
Alerts: Cross-up and cross-down alerts can be enabled via TradingView’s alert system.
Notes
Built in Pine v5 for reliability and compatibility.
Minimal by design — no tables, no clutter, just a higher-timeframe reference line.
Ideal for swing traders who want the Daily EMA-21 visible on intraday charts (e.g., 65m or 195m).
Not trade advice: this is a context tool to support your own strategy and risk management.
Time Cycles (90/30/10)This indicator plots hierarchical market cycles inside the 07:00 – 11:00 session (UTC-4), tailored for intraday NASDAQ trading on the 1-minute chart.
🔹 Cycles included:
90-minute cycle (primary)
30-minute cycles nested inside the 90m
10-minute cycles nested inside the 30m
🔹 Features:
Session-based: automatically resets daily at 07:00
Strict cutoff at 11:00 (no cycles extend past session close)
Adaptive box coloring to distinguish between nested cycles
Dynamic highs and lows: cycle boxes expand as new bars print
🔹 Use cases:
Visualize intraday rhythm & price structure
Spot potential turning points within nested timeframes
Enhance trade timing with cycle alignment
HTF EMA Step Lines (21/50/200)HTF EMA Step Lines (21/50/200)
Clean higher-timeframe MA levels on any chart. Flat, repaint-safe step lines for D/W/M — with optional labels, table, background cues, and alerts.
What it does
HTF Overlay : Shows 21 / 50 / 200 MAs from a higher timeframe (default Daily) on any chart.
Step Line Style : Lines are flat within the HTF bar and only update when a new HTF bar begins.
Repaint Control :
• Prior (default): previous confirmed HTF bar → no intraday repaint.
• Live : current HTF bar → updates intraday.
Extras : optional value labels, compact live values table, background cues, and %-distance label.
Alerts : Cross-up/down events for each selected HTF line.
How it works
Pulls HTF series with request.security .
Prior mode : shifts values by for stability.
Detects new HTF bars using time .
Plots with plot.style_stepline so levels remain flat until the next HTF open.
Inputs
Higher Timeframe : D / W / M (or any valid TF).
MA Type : EMA, SMA, or WMA.
Show 21 / 50 / 200 : toggle each line.
Live vs Prior : choose Live (updates) or Prior (no repaint).
Labels : show value label at each new HTF bar.
Live Values Table : compact 2-column panel in top-right.
BG Alignment : optional background tint when price > 21 > 50 > 200 (bull) or price < 200 (bear).
% Distance : live label showing distance from HTF-21 in %.
Styling : color & width per line.
Tips
For intraday execution (e.g. 65-min), use Prior mode to avoid drift.
Set HTF = W or M to get weekly/monthly lines without leaving your chart.
A soft warning appears if chart TF ≥ HTF (lines still valid but less contextual).
Alerts
Cross up/down alerts for 21/50/200 (compatible with Any alert() function call ).
Add alerts from the chart: Add Alert → Condition → This script .
Notes
Built in Pine v5 — minimal, readable, fast.
Levels are context tools, not signals.
Colours are tuned for dark charts; adjust for WCAG contrast.
SMA 50–200 Fill (Bull/Bear Colors)Overview
This TradingView Pine Script plots two simple moving averages (SMAs): one with a period of 50 and one with a period of 200. It also fills the area between the two SMAs. The fill color automatically changes depending on whether the 50-period SMA is above or below the 200-period SMA:
Bullish scenario (50 > 200): uses one color (bullFillColor)
Bearish scenario (50 < 200): uses another color (bearFillColor)
You can also customize the transparency of the filled area and the colors/widths of the SMA lines.
Key Parts of the Code
Inputs
src: The price source (default: close).
fastColor and slowColor: Colors for the 50- and 200-SMA lines.
bullFillColor and bearFillColor: The two fill colors used depending on whether the 50 SMA is above or below the 200 SMA.
fillTrans: The transparency of the fill (0 = fully opaque, 100 = fully transparent).
lwFast and lwSlow: Line widths of the 50- and 200-SMA lines.
Calculations
sma50 = ta.sma(src, 50)
sma200 = ta.sma(src, 200)
These two lines compute the moving averages of the chosen source price.
Plotting the SMAs
p50 and p200 use plot() to draw the SMA lines on the chart.
Each plot uses the chosen color and line width.
Dynamic Fill Color
A conditional determines which color to use:
fillColor = sma50 > sma200 ? color.new(bullFillColor, fillTrans) : color.new(bearFillColor, fillTrans)
If the 50 SMA is greater than the 200 SMA, the bullish color is used; otherwise, the bearish color is used.
Filling the Area
fill(p50, p200, color=fillColor) creates a shaded area between the two SMAs.
Because fillColor changes depending on the condition, the filled area automatically changes color when the SMAs cross.
How to Use It
Add to Chart: When you add this script to your chart, you’ll see the 50 and 200 SMAs with a shaded area between them.
Customize Colors: You can change line colors, fill colors, and transparency directly from the indicator’s settings panel.
Visual Cues: The fill color gives you an instant visual cue whether the short-term trend (50 SMA) is above or below the long-term trend (200 SMA).
Benefits
Gives a clear, simple visual representation of the trend’s strength and direction.
The customizable transparency lets you make the shading subtle or bold depending on your chart style.
Works on any time frame or instrument where you’d like to compare a short-term and long-term moving average.
Gold NY Session Key TimesJust showing to us that news come out, open market, close bond for NY Session Time For Indonesia
Rolling Highest + Qualified Ghost (price-synced)[돌파]English Guide
What this indicator does
Plots a rolling highest line hh = ta.highest(src, len) that step-changes whenever the highest value inside the last len bars changes.
When a step ends after being flat for at least minHold bars (a “plateau”), it draws a short horizontal ghost line for ghostLen bars to the right at the previous step level.
By default, the ghost appears only on step-down events (behaves like a short-lived resistance trace). You can allow both directions with the onlyOnDrop setting.
Everything is rendered with plot() series (not drawing objects), bound to the right price scale → it moves perfectly with the chart.
Inputs
len — Lookback window (bars) for the rolling highest.
basis — Price basis used to compute the highest: High / Close / HLC3 / OHLC4.
minHold — Minimum plateau length (bars). Only steps that stayed flat at least this long qualify for a ghost.
ghostLen — Number of bars to keep the horizontal ghost to the right.
onlyOnDrop — If true, make ghosts only when the step moves down (default). If false, also create ghosts on step-ups.
Visuals: mainColor/mainWidth for the main rolling highest line; ghostColor/ghostTrans/ghostWidth for the ghost.
How it works (logic)
Rolling highest:
hh = ta.highest(src, len) produces a stair-like line.
Step detection:
stepUp = hh > hh
stepDown = hh < hh
startUp / startDown mark the first bar of a new step (prevents retriggering while the step continues).
Plateau length (runLen):
Counts consecutive bars where hh remained equal:
runLen := (hh == hh ) ? runLen + 1 : 1
Qualification:
On the first bar of a step change, check previous plateau length prevHold = runLen .
If prevHold ≥ minHold and direction matches onlyOnDrop, start a ghost:
ghostVal := hh (the previous level)
ghostLeft := ghostLen
Ghost series:
While ghostLeft > 0, output ghostVal; otherwise output na.
It’s plotted with plot.style_linebr so the line appears as short, clean horizontal segments instead of connecting across gaps.
Why it stays synced to price
The indicator uses overlay=true, scale=scale.right, format=format.price, and pure series plot().
No line.new() objects → no “stuck on screen” behavior when panning/zooming.
Tips & customization
If your chart is a line chart (close), set basis = Close so visuals align perfectly.
Want ghosts on both directions? Turn off onlyOnDrop.
Make ghosts subtler by increasing ghostTrans (e.g., 60–80).
If ghosts appear too often or too rarely, tune minHold and len.
Larger minHold = only long, meaningful plateaus will create ghosts.
Edge cases
If len is very small or the market is very volatile, plateaus may be rare → fewer ghosts.
If the stair level changes almost every few bars, raise len or minHold.
한글 설명서
기능 요약
최근 len개 바 기준의 롤링 최고가 hh를 그립니다. 값이 바뀔 때마다 계단식(step)으로 변합니다.
어떤 계단이 최소 minHold봉 이상 유지된 뒤 스텝이 끝나면, 직전 레벨을 기준으로 우측 ghostLen봉짜리 수평선(고스트) 을 그립니다.
기본값은 하락 스텝에서만 고스트를 생성(onlyOnDrop=true). 꺼두면 상승 스텝에서도 만듭니다.
전부 plot() 시리즈 기반 + 우측 가격 스케일 고정 → 차트와 완전히 동기화됩니다.
입력값
len — 롤링 최고가 계산 윈도우(바 수).
basis — 최고가 계산에 사용할 기준: High / Close / HLC3 / OHLC4.
minHold — 플래토(같은 값 유지) 최소 길이. 이 이상 유지된 스텝만 고스트 대상.
ghostLen — 우측으로 고스트를 유지할 바 수.
onlyOnDrop — 체크 시 하락 스텝에서만 고스트 생성(기본). 해제하면 상승 스텝도 생성.
표시 옵션: 본선(mainColor/mainWidth), 고스트(ghostColor/ghostTrans/ghostWidth).
동작 원리
롤링 최고가:
hh = ta.highest(src, len) → 계단형 라인.
스텝 변화 감지:
stepUp = hh > hh , stepDown = hh < hh
startUp / startDown 으로 첫 바만 잡아 중복 트리거 방지.
플래토 길이(runLen):
hh가 같은 값으로 연속된 길이를 누적:
runLen := (hh == hh ) ? runLen + 1 : 1
자격 판정:
스텝이 바뀌는 첫 바에서 직전 플래토 길이 prevHold = runLen 가 minHold 이상이고, 방향이 설정(onlyOnDrop)과 맞으면 고스트 시작:
ghostVal := hh (직전 레벨)
ghostLeft := ghostLen
고스트 출력:
ghostLeft > 0 동안 ghostVal을 출력, 아니면 na.
plot.style_linebr로 짧은 수평 구간만 보이게 합니다(NA 구간에서 선을 끊음).
가격과 동기화되는 이유
overlay=true, scale=scale.right, format=format.price로 가격 스케일에 고정, 그리고 모두 plot() 시리즈로 그립니다.
line.new() 같은 도형 객체를 쓰지 않아 스크롤/줌 시 화면에 박히는 현상이 없습니다.
활용 팁
차트를 라인(종가) 로 보신다면 basis = Close로 맞추면 시각적으로 더욱 정확히 겹칩니다.
고스트가 너무 자주 나오면 minHold를 올리거나 len을 키워서 스텝 빈도를 낮추세요.
고스트를 더 은은하게: ghostTrans 값을 크게(예: 60–80).
저항/지지 라인처럼 보이게 하려면 기본 설정(onlyOnDrop=true)이 잘 맞습니다.
주의할 점
변동성이 큰 종목/타임프레임에선 플래토가 짧아 고스트가 드물 수 있습니다.
len이 너무 작으면 스텝이 잦아져 노이즈가 늘 수 있습니다.
RSI Zones Background + Optional RSI PaneOverview
This Pine Script indicator does two things at once:
Colors the background of the main price chart whenever the RSI value is below a lower threshold (default 30) or above an upper threshold (default 70). This highlights oversold and overbought zones directly on the price chart itself.
Optionally displays a separate RSI panel with the RSI line and shaded region between the two threshold levels for reference.
The indicator is fully customizable through the settings panel—color choices, transparency, and whether to show the separate RSI pane can all be adjusted.
Key Parts of the Code
1. Inputs
src: The source price series for RSI calculation.
len: RSI lookback length (default 14).
lowerThr and upperThr: The lower and upper thresholds (defaults: 30 and 70).
lowColor and highColor: Colors for the background when RSI is below or above the thresholds.
bgTrans: Transparency level for the background shading.
showRSI: Boolean to toggle the optional RSI pane on or off.
2. RSI Calculation
rsi = ta.rsi(src, len)
This computes the RSI from the chosen price source.
3. Background Coloring on the Price Chart
bgCol = rsi <= lowerThr ? color.new(lowColor,bgTrans) :
rsi >= upperThr ? color.new(highColor,bgTrans) :
na
bgcolor(bgCol)
If RSI ≤ lower threshold: background turns lowColor (oversold zone).
If RSI ≥ upper threshold: background turns highColor (overbought zone).
Otherwise, no background color.
4. Optional RSI Pane
plot(showRSI ? rsi : na, display=display.pane)
Plots the RSI line in a separate pane when showRSI is true; otherwise hides it.
5. Horizontal Lines for Thresholds
hLower = hline(lowerThr, ...)
hUpper = hline(upperThr, ...)
Two horizontal lines at the lower and upper thresholds.
Because hline() can’t be wrapped inside if blocks, the script always creates them but makes them transparent (using na color) when the pane is hidden.
6. Filling Between Threshold Lines
fill(hLower, hUpper, color=showRSI ? color.new(color.gray,95) : na)
When the RSI pane is visible, the area between the two threshold lines is shaded in gray to create a “mid-zone” effect. This fill also switches off (becomes na) if the pane is hidden.
7. Alerts
The script also includes two alert conditions:
When RSI crosses below the lower threshold.
When RSI crosses above the upper threshold.
How It Works in Practice
On the price chart, you’ll see the background turn blue (or your chosen color) when RSI is ≤30, and red when RSI is ≥70.
If you enable “Show RSI” in the settings, a separate RSI pane will appear below the price chart, plotting the RSI line with two threshold lines and a shaded region in between.
You can fully adjust transparency and colors to suit your chart style.
Benefits
Quickly visualize overbought and oversold conditions without opening a separate RSI window.
Optional RSI pane provides context when needed.
Customizable colors and transparency make it easy to integrate with any chart theme.
Alerts give you automatic notifications when RSI crosses key levels.
------------------------------------------------------------------------------------------------------------------
개요
이 지표는 두 가지 기능을 동시에 수행합니다.
가격 차트 뒤 배경에 색상 표시
RSI 값이 설정한 하단 임계값(기본 30) 이하이거나 상단 임계값(기본 70) 이상일 때, 가격 차트 뒤쪽에 과매도·과매수 구간을 색으로 표시해줍니다.
선택적으로 RSI 보조창 표시
옵션을 켜면 별도의 RSI 패널이 나타나서 RSI 라인과 두 임계값(30, 70)을 연결한 구간을 음영 처리하여 보여줍니다.
설정 창에서 색상·투명도·보조창 표시 여부를 전부 조정할 수 있습니다.
코드 핵심 설명
1. 입력값
src: RSI 계산에 사용할 가격 소스(기본 종가).
len: RSI 기간(기본 14).
lowerThr / upperThr: RSI 하단·상단 임계값(기본 30, 70).
lowColor / highColor: RSI가 각각 하단 이하·상단 이상일 때 배경 색상.
bgTrans: 배경 투명도(0=불투명, 100=투명).
showRSI: RSI 보조창을 켜고 끌 수 있는 스위치.
2. RSI 계산
rsi = ta.rsi(src, len)
지정한 가격 소스를 기반으로 RSI를 계산합니다.
3. 가격 차트 배경 색칠
bgCol = rsi <= lowerThr ? color.new(lowColor,bgTrans) :
rsi >= upperThr ? color.new(highColor,bgTrans) :
na
bgcolor(bgCol)
RSI ≤ 하단 임계값 → lowColor(과매도 색)
RSI ≥ 상단 임계값 → highColor(과매수 색)
나머지 구간은 색상 없음.
4. 선택적 RSI 보조창
plot(showRSI ? rsi : na, display=display.pane)
showRSI가 켜져 있으면 RSI 라인을 보조창에 표시하고, 꺼져 있으면 숨깁니다.
5. 임계값 가로선
hLower = hline(lowerThr, ...)
hUpper = hline(upperThr, ...)
하단·상단 임계값을 가로선으로 표시합니다.
hline은 if 블록 안에서 쓸 수 없기 때문에 항상 그려지지만, 보조창이 꺼지면 색을 na로 처리해 안 보이게 합니다.
6. 임계값 사이 영역 음영 처리
fill(hLower, hUpper, color=showRSI ? color.new(color.gray,95) : na)
보조창이 켜져 있을 때만 두 가로선 사이를 회색으로 채워 “중립 구간”을 강조합니다.
7. 알림 조건
RSI가 하단 임계값을 아래로 돌파할 때 알림.
RSI가 상단 임계값을 위로 돌파할 때 알림.
실제 작동 모습
가격 차트 뒤쪽에 RSI ≤30이면 파란색, RSI ≥70이면 빨간색 배경이 나타납니다(색상은 설정에서 변경 가능).
RSI 보조창을 켜면, RSI 라인과 임계값 가로선, 그리고 그 사이 음영 영역이 함께 나타납니다.
투명도를 높이거나 낮추어 강조 정도를 조절할 수 있습니다.
장점
별도의 RSI창을 열지 않고도 가격 차트 배경만으로 과매수·과매도 상태를 직관적으로 확인 가능.
필요하면 보조창으로 RSI를 직접 확인하면서 임계값 가이드와 음영 영역을 함께 볼 수 있음.
색상·투명도를 자유롭게 조절할 수 있어 차트 스타일에 맞게 커스터마이징 가능.
RSI가 임계값을 돌파할 때 자동 알림을 받을 수 있음.
DCA vs One-ShotCompare a DCA strategy by choosing the payment frequency (daily, weekly, or monthly), and by choosing whether or not to pay on weekends for cryptocurrency. You can add fees and the reference price (opening, closing, etc.).
Adaptive HMA SignalsAdaptive HMA Signals
This indicator pairs nicely with the Contrarian 100 MA and can be located here:
Overview
The "Adaptive HMA Signals" indicator is a sophisticated technical analysis tool designed for traders aiming to capture trend changes with precision. By leveraging Hull Moving Averages (HMAs) that adapt dynamically to market conditions (volatility or volume), this indicator generates actionable buy and sell signals based on price interactions with adaptive HMAs and slope analysis. Optimized for daily charts, it is highly customizable and suitable for trading forex, stocks, cryptocurrencies, or other assets. The indicator is ideal for swing traders and trend followers seeking to time entries and exits effectively.
How It Works
The indicator uses two adaptive HMAs—a primary HMA and a minor HMA—whose periods adjust dynamically based on user-selected market conditions (volatility via ATR or volume via RSI). It calculates the slope of the primary HMA to identify trend strength and generates exit signals when the price crosses the minor HMA under specific slope conditions. Signals are plotted as circles above or below the price, with inverted colors (white for buy, blue for sell) to enhance visibility on any chart background.
Key Components
Adaptive HMAs: Two HMAs (primary and minor) with dynamic periods that adjust based on volatility (ATR-based) or volume (RSI-based) conditions. Periods range between user-defined minimum and maximum values, adapting by a fixed percentage (3.141%).
Slope Analysis: Calculates the slope of the primary HMA over a 34-bar period to gauge trend direction and strength, normalized using market range data.
Signal Logic: Generates buy signals (white circles) when the price falls below the minor HMA with a flat or declining slope (indicating a potential trend reversal) and sell signals (blue circles) when the price rises above the minor HMA with a flat or rising slope.
Signal Visualization: Plots signals at an offset based on ATR for clarity, using semi-transparent colors to avoid chart clutter.
Mathematical Concepts
Dynamic Period Adjustment:
Primary HMA period adjusts between minLength (default: 144) and maxLength (default: 200).
Minor HMA period adjusts between minorMin (default: 55) and minorMax (default: 89).
Periods decrease by 3.141% under high volatility/volume and increase otherwise.
HMA Calculation:
Uses the Hull Moving Average formula: WMA(2 * WMA(src, length/2) - WMA(src, length), sqrt(length)).
Provides a smoother, faster-responding moving average compared to traditional MAs.
Slope Calculation:
Computes the slope of the primary HMA using a 34-bar period, normalized by the market range (highest high - lowest low over 34 bars).
Slope angle is converted to degrees using arccosine for intuitive trend strength interpretation.
Signal Conditions:
Buy: Slope ≥ 17° (flat or rising), price < minor HMA, low volatility/volume.
Sell: Slope ≤ -17° (flat or declining), price > minor HMA, low volatility/volume.
Signals are triggered only on confirmed bars to avoid repainting.
Entry and Exit Rules
Buy Signal (White Circle): Triggered when the price crosses below the minor HMA, the slope of the primary HMA is flat or rising (≥17°), and volatility/volume is low. The signal appears as a white circle above the price bar, offset by 0.72 * ATR(5).
Sell Signal (Blue Circle): Triggered when the price crosses above the minor HMA, the slope of the primary HMA is flat or declining (≤-17°), and volatility/volume is low. The signal appears as a blue circle below the price bar, offset by 0.72 * ATR(5).
Exit Rules: Exit a buy position on a sell signal and vice versa. Combine with other tools (e.g., support/resistance, RSI) for additional confirmation. Always apply proper risk management.
Recommended Usage
The "Adaptive HMA Signals" indicator is optimized for daily charts but can be adapted to other timeframes (e.g., 1H, 4H) with adjustments to period lengths. It performs best in trending or range-bound markets with clear reversal points. Traders should:
Backtest the indicator on their chosen asset and timeframe to validate signal reliability.
Combine with other technical tools (e.g., trendlines, Fibonacci retracements) for stronger trade setups.
Adjust minLength, maxLength, minorMin, and minorMax based on market volatility and timeframe.
Use the Charger input to toggle between volatility (ATR) and volume (RSI) adaptation for optimal performance in specific market conditions.
Customization Options
Source: Choose the price source (default: close).
Show Signals: Toggle visibility of buy/sell signals (default: true).
Charger: Select adaptation trigger—Volatility (ATR-based) or Volume (RSI-based) (default: Volatility).
Main HMA Periods: Set minimum (default: 144) and maximum (default: 200) periods for the primary HMA.
Minor HMA Periods: Set minimum (default: 55) and maximum (default: 89) periods for the minor HMA.
Slope Period: Fixed at 34 bars for slope calculation, adjustable via code if needed.
Why Use This Indicator?
The "Adaptive HMA Signals" indicator combines the responsiveness of HMAs with dynamic adaptation to market conditions, offering a robust tool for identifying trend reversals. Its clear visual signals, customizable periods, and adaptive logic make it versatile for various markets and trading styles. Whether you’re a beginner or an experienced trader, this indicator enhances your ability to time entries and exits with precision.
Tips for Users
Test the indicator thoroughly on your chosen market and timeframe to optimize settings (e.g., adjust period lengths for non-daily charts).
Use in conjunction with price action or other indicators (e.g., RSI, MACD) for stronger trade confirmation.
Monitor volatility/volume conditions to ensure the Charger setting aligns with market dynamics.
Ensure your chart timeframe aligns with the selected period lengths for accurate signal generation.
Apply strict risk management to protect against false signals in choppy markets.
Happy trading with the Adaptive HMA Signals indicator! Share your feedback and strategies in the TradingView community!
Lakshman Rekha Level IndicatorThis script gives the upper and lower limit, calculated by adding and subtracting the daily range from the close point
Rocket Scan – Midday Movers (No Pullback)This indicator is designed to spot intraday breakout movers that often appear after the market open — the ones that rip out of nowhere and cause FOMO if you’re late.
🔑 Core Logic
• Momentum Burst: Detects sudden price pops (ROC) with confirming relative volume.
• Squeeze → Breakout: Finds low-volatility compressions (tight Bollinger bandwidth) and flags the first breakout move.
• VWAP Reclaims: Highlights strong reversals when price reclaims VWAP on volume.
• Relative Volume (RVOL): Filters for unusual activity vs. recent averages.
• Gap Filter: Skips large overnight gappers, focuses on fresh intraday movers.
• Relative Strength: Optional filter requiring the symbol to outperform SPY (and sector ETF if chosen).
• Session Window: Default 10:30–15:30 ET to ignore noisy open action and catch true midday moves.
🎯 Use Case
• Built for traders who want early alerts on midday runners without waiting for pullbacks.
• Helps identify potential entry points before FOMO kicks in.
• Works best on liquid tickers (stocks, ETFs, crypto) with reliable intraday volume.
📊 Visuals
• Plots fast EMA, slow EMA, and VWAP for trend context.
• Paints green ▲ for long signals and red ▼ for short signals on the chart.
• Info label shows RVOL, ROC, RS filter status, and gap conditions.
🚨 Alerts
Two alert conditions included:
• Rocket: Midday LONG → Fires when bullish conditions align.
• Rocket: Midday SHORT → Fires when bearish conditions align.
⸻
⚠️ Disclaimer:
This tool is for educational and research purposes only. It is not financial advice. Trading involves risk; always do your own research or consult a licensed professional.
JBK — 2 bougies (tailles B1/B2 + contraintes + 4 EMA) JBK — 2 bougies (tailles B1/B2 + contraintes + 4 EMA)
CRT (Candle Range Theory)+ Daily Bias - Milana Trades Overview
This indicator combines Candle Range Theory (CRT) with a Daily & Weekly Bias model, providing traders with both short-term CRT candle detection and higher-timeframe directional context. It is designed to help traders identify liquidity traps, potential reversals, and overall market bias in a structured and visual way.
🔹 1. Candle Range Theory (CRT)
The CRT module focuses on detecting CRT candles (false breakouts) and marking key high/low ranges.
Bullish CRT :
Occurs when the price makes a lower low compared to the previous candle but closes bullish (close > open).
→ Signals potential upside reversal.
Bearish CRT :
Occurs when the price makes a higher high compared to the previous candle but closes bearish (close < open).
→ Signals potential downside reversal.
When a CRT is detected:
The indicator plots dotted lines and levels from the trap candle’s high/low.
Labels (CRT, CRT H, CRT L) are drawn for easy visualization.
Previous CRT levels/labels can be cleared automatically if desired.
Alerts are triggered once a trap is confirmed (on candle close).
🔹 2. Daily & Weekly Bias
The bias model provides directional context based on daily and weekly candle close
Bias is determined by analyzing:
Breaks of previous highs/lows.
Failed breaks (false moves beyond prior levels).
Inside bars (neutral conditions).
Possible Bias States:
The logic Daily BIAS
Close Above PDH → BULLISH
Close Below PDL → BEARISH
Failed Close Above → BEARISH
Failed Close Below → BULLISH
Inside Range → NEUTRAL
Both Daily and Weekly bias are calculated and displayed in a structured table.
⚠️ Important Note on Daily Bias
The Daily Bias provided by this indicator should be treated as a technical reference, not an absolute signal. Market structure is complex, and automatic bias detection may not always capture context such as news events, liquidity zones, or higher-timeframe confluence.
👉 Always prioritize your own market analysis and discretion over the indicator’s bias. Use the Daily/Weekly bias as a guideline to support your view, rather than as a rule to follow blindly.
🔹 3. Bias Table
A clean on-chart table (top-right corner by default) displays:
Timeframe (Daily / Weekly).
Current bias (Bullish, Bearish, Neutral).
The table is fully customizable:
Colors (header, text, row backgrounds).
Option to show/hide Daily or Weekly bias.
🔹 4. Alerts
The indicator supports real-time alerts:
Bearish CRT detected
Bullish CRT detected
These alerts trigger only on confirmed candle closes, ensuring reliable signals.
🔹 5. Settings
CRT Module
Length → How many bars CRT levels extend.
Clear Broken → Automatically clear past CRT lines when a new trap is detected.
Trap Candle Colors → Define bullish/bearish trap highlight colors.
CRT Line/Label Styling → Customize line style, width, label size, and text/background colors.
Bias Module
Show Table → Enable/disable bias table.
Show Daily / Show Weekly Bias → Toggle specific timeframes.
Colors → Set bullish, bearish, and neutral bias colors.
Table Styling → Customize background, border, header, and row colors.
🔹 6. How to Use
Look for trap candle signals (CRT labels) near important liquidity levels.
Use the Daily & Weekly bias table to confirm whether the broader trend supports the trap signal.
Align CRT signals with bias direction for higher-probability setups.
Use alerts to stay notified of trap events without monitoring the chart constantly.
See the levels. Feel the flow
Seasonal Pattern DecoderSeasonal Pattern Decoder
The Seasonal Pattern Decoder is a powerful tool designed for traders and analysts who want to uncover and leverage seasonal tendencies in financial markets. Instead of cluttering your chart with complex visuals, this indicator presents a clean, intuitive table that summarizes historical monthly performance, allowing you to spot recurring patterns at a glance.
How It Works
The indicator fetches historical monthly data for any symbol and calculates the percentage return for each month over a specified number of years. It then organizes this data into a comprehensive table, providing a clear, year-by-year and month-by-month breakdown of performance.
Key Features
Historical Performance Table: Displays monthly returns for up to a user-defined number of years, making it easy to compare performance across different periods.
Color-Coded Heatmap: Each cell is colored based on the performance of the month. Strong positive returns are shaded in green, while strong negative returns are shaded in red, allowing for immediate visual analysis of monthly strength or weakness.
Annual Summary: A "Σ" column shows the total percentage return for each full calendar year.
AVG Row: Calculates and displays the average return for each month across all the years shown in the table.
WR Row: Shows the "Win Rate" for each month, which is the percentage of time that month had a positive return. This is crucial for identifying high-probability seasonal trends.
How to Use
Add the "Seasonal Pattern Decoder" indicator to your chart. Note that it works best on Daily, Weekly, or Monthly timeframes. A warning message will be displayed on intraday charts.
In the indicator settings, adjust the "Lookback Period" to control how many years of historical data you want to analyze.
Use the "Show Years Descending" option to sort the table from the most recent year to the oldest.
The "Heat Range" setting allows you to adjust the sensitivity of the color-coding to fit the volatility of the asset you are analyzing.
This tool is ideal for confirming trading biases, developing seasonal strategies, or simply gaining a deeper understanding of an asset's typical behavior throughout the year.
## Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Market Structure 2.0- Zig Zag , BoS and Supply/Demand ZonesMarket Structure 2.0- Zig Zag, BoS and Supply/Demand
Unlock the full picture of market structure with this all-in-one indicator. At its core, it’s built around precise price action reversals, detected through smart engulfment of highs and lows. Every reversal acts as a single, powerful trigger that automatically maps out supply and demand zones and structural levels (swing high/lows, BoS and market shift) — everything you need to understand the market at a glance.
Whether you’re scanning for trend continuation, identifying structural levels for entries and exits, or marking key areas for Fibonacci retracements, this indicator simplifies it all. BoS signals help you ride the prevailing trend, zones highlight areas of interest, and swing highs/lows give you structural context — all perfectly aligned with each other, all as a result of price-action based reversals.
Want to see the bigger picture? The HTF input lets you track higher timeframe structures right on your current chart, giving you an edge for live trading. Just remember: for consistent results, refresh your chart before observing HTF structure, and use caution when back-testing, as higher timeframe patterns may appear inconsistent in bar-replay (refresh chart regularly for accurate results). Also, be aware that supply/demand zones are most accurate on the chosen timeframes raw timeframe (for example if using 4h on HTF input, 4h supply/demand zones are more accurate when observing 4h chart and may show discrepancy on lower timeframes).
With this tool, the chaos of the market is transformed into a clean, actionable map — all guided by the same unique reversal logic.
Real-Time Alerts
This indicator doesn’t just visualize market structure — it actively notifies you when critical events occur, so you can observe passively without being glued to the charts. Alerts are fully customizable and cover every key element of market behavior:
Supply & Demand Zones
• New Supply Zone (Bullish) – Triggers when a fresh supply area forms.
• New Demand Zone (Bearish) – Alerts you to newly established demand.
Internal Shifts & Swing Points
• Bullish Internal Shift – Detects bullish price shifts across all swing lows.
• Bearish Internal Shift – Detects bearish shifts across all swing highs.
• Higher Highs (HH) / Higher Lows (HL) / Lower Highs (LH) / Lower Lows (LL) – Track critical swing points with precise conditions to avoid false signals.
• Liquidity Sweeps (LS) – Alerts when price sweeps stop-loss areas, signaling potential traps or continuation setups.
Market Structure & Breaks of Structure (BoS)
• Bullish / Bearish BoS – Highlights breaks in structure that confirm trend continuation or reversals.
• Bullish / Bearish Market Shifts – Flags larger trend changes detected by the indicator’s unique reversal logic.
Alerts can be triggered on LTF , MTF , or HTF charts, giving you flexibility to match your trading style. Each alert is configurable, so you receive only the notifications that matter to you — whether it’s swing points, market shifts, or key supply and demand levels.
With these alerts, you’re not just watching the market — you’re anticipating it.
🌊 Big Wave Motion Detector — Main TFs Only (1m/5m/1H/4H/1D)Big Wave Motion Detector 🌊 — Main Timeframes Only
What it does
Scans motion by measuring percent change across the main timeframes: 1m, 5m, 1H, 4H, 1D. Results are shown in a compact on-chart table with direction arrows, optional heatmap coloring, and a clear summary of which TF is making the biggest wave right now.
How it measures change
Choose your basis in settings:
Close → Previous Close (classic return for that TF), or
Open → Current Price (live) for more intrabar responsiveness.
“Since Daily Open %” gives extra context (same value on each row because it’s daily).
Table columns
Timeframe – 1m, 5m, 1H, 4H, 1D
Change % – percent move for that TF (heatmap optional)
Dir – ▲ up / ▼ down (toggle)
Note –
✅ Big Wave! (between Min & Max)
🚀 Too Fast! (above Max)
🔄 Warming Up (medium)
🐢 Small Moves
😴 Sleepy…
Since D Open % – optional daily context
Summary – shows the largest absolute move and its TF
Key inputs
Min / Max Big Wave % – define your wave band (e.g., 5–15%).
Change Basis – Close→Prev Close vs Open→Now (live).
Heatmap / Arrows / Daily Column / Decimals – presentation tweaks.
Alerts (static messages)
Any TF Big Wave
Individual: 1m / 5m / 1H / 4H / 1D
Tips
For scalps, tighten the band (e.g., 1–5%).
For swings, widen it (e.g., 5–15%+).
For most reliable alerts, use On bar close (HTFs finalize at their bar close).
Notes
This build intentionally excludes 15m and 12H (main TFs only).
Values on higher TF rows will update as those bars develop (especially in Open→Now mode).
Disclaimer
Educational only—no financial advice. Always test before using live.
Concise SMA Golden/Death_Crossconcise golden/death cross
When SMA 50 crosses over SMA 200, it indicates a bull market.
Previous candle - D-T.R.A.D.I.N.G//@version=6
indicator("Previous candle - byDen (Body % line & Wick size) ", overlay=true, max_boxes_count=200, max_lines_count=200, max_labels_count=200)
// ---------------- Inputs ----------------
showHighLow = input.bool(true, "Show High/Low lines")
showHLBox = input.bool(true, "Show High-Low Box (full range)")
showMidLine = input.bool(true, "Show Middle Line")
showCloseLine = input.bool(true, "Show Close Line")
showBodyPct = input.bool(true, "Show Body % Line")
enableWickBox = input.bool(true, "Show Wick-Body Box (previous candle)")
keepLastWick = input.bool(false, "Keep last Wick-Box when disabled")
bodyPct = input.float(25.0, "Body % Level", step=0.1, minval=0.0, maxval=100.0)
// colors / styles
cHighLow = input.color(color.white, "H/L Line Color")
hlStyleStr = input.string("solid", "H/L Style", options= )
hlWidth = input.int(1, "H/L Width", minval=1, maxval=5)
cMid = input.color(color.yellow, "Mid Line Color")
midStyleStr = input.string("dashed", "Mid Style", options= )
midWidth = input.int(1, "Mid Width", minval=1, maxval=5)
cClose = input.color(color.yellow, "Close Line Color")
closeStyleStr = input.string("dotted", "Close Style", options= )
closeWidth = input.int(1, "Close Width", minval=1, maxval=5)
cBoxBorder = input.color(color.red, "HL Box Border")
cBoxFill = color.new(input.color(color.gray, "HL Box Fill"), 85)
cBullBox = color.new(input.color(color.green, "Bull WickBox"), 80)
cBearBox = color.new(input.color(color.red, "Bear WickBox"), 80)
cWboxBorder = input.color(color.white, "WickBox Border")
cBodyPct = input.color(color.blue, "Body % Line Color")
bodyPctStyle = input.string("dashed", "Body % Line Style", options= )
bodyPctWidth = input.int(1, "Body % Line Width", minval=1, maxval=5)
// table colors / pip size
cPipBox = input.color(color.new(color.blue, 80), "Table Background Color")
cPipText = input.color(color.white, "Table Text Color")
pipSize = input.float(0.1, "Pip size (XAUUSD=0.1)", step=0.01)
wickLabelText = input.string("Wick", "Opis za wick")
bodyLabelText = input.string("H/L-Body%", "Opis za H/L-Body%")
descFontSizeStr = input.string("small", "Table Description Font Size", options= )
valFontSizeStr = input.string("normal", "Table Value Font Size", options= )
// custom texts for line labels
txtHigh = input.string("High", "Label Text - High")
txtLow = input.string("Low", "Label Text - Low")
txtMid = input.string("Mid", "Label Text - Mid")
txtClose = input.string("Close", "Label Text - Close")
txtBody = input.string("Body%", "Label Text - Body %")
lineFontSizeStr = input.string("small", "Line Label Font Size", options= )
lineLabelPos = input.string("above", "Line Label Position", options= )
lineLabelAlign = input.string("center", "Line Label Align", options= )
// ---------------- Candle Display Options ----------------
highDisplay = input.string("Both", "High Line Display", options= )
lowDisplay = input.string("Both", "Low Line Display", options= )
midDisplay = input.string("Both", "Mid Line Display", options= )
closeDisplay = input.string("Both", "Close Line Display", options= )
bodyDisplay = input.string("Both", "Body % Line Display", options= )
hlBoxDisplay = input.string("Both", "HL Box Display", options= )
wickBoxDisplay = input.string("Both", "Wick Box Display", options= )
// timeframe filter
enabledTFs = input.string("1,5,15,30,60,240,D", "Enable on timeframes")
// ---------------- Helpers ----------------
is_tf_enabled(tfStr) =>
str.contains("," + enabledTFs + ",", "," + tfStr + ",")
line_style_from_str(s) =>
s == "dotted" ? line.style_dotted : s == "dashed" ? line.style_dashed : line.style_solid
get_font_size(fs) =>
fs == "tiny" ? size.tiny : fs == "small" ? size.small : fs == "large" ? size.large : fs == "huge" ? size.huge : size.normal
get_label_style(a) =>
a == "left" ? label.style_label_left : a == "right" ? label.style_label_right : label.style_label_center
get_y_pos(basePrice, pos) =>
pos == "above" ? basePrice + (syminfo.mintick * 10) : basePrice - (syminfo.mintick * 10)
// ---------------- Data ----------------
tf = timeframe.period
= request.security(syminfo.tickerid, tf, , lookahead=barmerge.lookahead_off)
midLevel = (prevH + prevL) / 2
isBull = prevC > prevO
// ---------------- Persistent ----------------
var line lHigh = na
var line lLow = na
var line lMid = na
var line lClose = na
var line lBodyPct = na
var box bHL = na
var box wickBox = na
var table wickTable = na
var label labHigh = na
var label labLow = na
var label labMid = na
var label labClose = na
var label labBodyPct = na
offsetBars = input.int(20, "Bars right", minval=1, maxval=500)
leftX_base = bar_index
rightX_base = bar_index + offsetBars
if na(wickTable)
wickTable := table.new(position.bottom_right, 2, 2, border_width=1, frame_color=color.white)
// ---------------- DRAW ----------------
if barstate.isconfirmed and is_tf_enabled(tf)
// delete previous labels
if not na(labHigh)
label.delete(labHigh)
labHigh := na
if not na(labLow)
label.delete(labLow)
labLow := na
if not na(labMid)
label.delete(labMid)
labMid := na
if not na(labClose)
label.delete(labClose)
labClose := na
if not na(labBodyPct)
label.delete(labBodyPct)
labBodyPct := na
// --- DRAW HIGH ---
drawHigh = (highDisplay=="Both") or (highDisplay=="Bullish" and isBull) or (highDisplay=="Bearish" and not isBull)
if showHighLow and drawHigh
if not na(lHigh)
line.delete(lHigh)
lHigh := line.new(leftX_base, prevH, rightX_base, prevH, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
labHigh := label.new(rightX_base, get_y_pos(prevH,lineLabelPos), txtHigh, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cHighLow, size=get_font_size(lineFontSizeStr))
// --- DRAW LOW ---
drawLow = (lowDisplay=="Both") or (lowDisplay=="Bullish" and isBull) or (lowDisplay=="Bearish" and not isBull)
if showHighLow and drawLow
if not na(lLow)
line.delete(lLow)
lLow := line.new(leftX_base, prevL, rightX_base, prevL, xloc=xloc.bar_index, color=cHighLow, width=hlWidth, style=line_style_from_str(hlStyleStr))
labLow := label.new(rightX_base, get_y_pos(prevL,lineLabelPos), txtLow, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cHighLow, size=get_font_size(lineFontSizeStr))
// --- DRAW MID ---
drawMid = (midDisplay=="Both") or (midDisplay=="Bullish" and isBull) or (midDisplay=="Bearish" and not isBull)
if showMidLine and drawMid
if not na(lMid)
line.delete(lMid)
lMid := line.new(leftX_base, midLevel, rightX_base, midLevel, xloc=xloc.bar_index, color=cMid, width=midWidth, style=line_style_from_str(midStyleStr))
labMid := label.new(rightX_base, get_y_pos(midLevel,lineLabelPos), txtMid, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cMid, size=get_font_size(lineFontSizeStr))
// --- DRAW CLOSE ---
drawClose = (closeDisplay=="Both") or (closeDisplay=="Bullish" and isBull) or (closeDisplay=="Bearish" and not isBull)
if showCloseLine and drawClose
if not na(lClose)
line.delete(lClose)
lClose := line.new(leftX_base, prevC, rightX_base, prevC, xloc=xloc.bar_index, color=cClose, width=closeWidth, style=line_style_from_str(closeStyleStr))
labClose := label.new(rightX_base, get_y_pos(prevC,lineLabelPos), txtClose, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cClose, size=get_font_size(lineFontSizeStr))
// --- DRAW BODY% ---
float bodySize = math.abs(prevC-prevO)
float levelPct = na
drawBody = (bodyDisplay=="Both") or (bodyDisplay=="Bullish" and isBull) or (bodyDisplay=="Bearish" and not isBull)
if showBodyPct and bodySize>0 and drawBody
if not na(lBodyPct)
line.delete(lBodyPct)
levelPct := isBull ? (prevC - (bodyPct/100)*bodySize) : (prevC + (bodyPct/100)*bodySize)
lBodyPct := line.new(leftX_base, levelPct, rightX_base, levelPct, xloc=xloc.bar_index, color=cBodyPct, width=bodyPctWidth, style=line_style_from_str(bodyPctStyle))
labBodyPct := label.new(rightX_base, get_y_pos(levelPct,lineLabelPos), txtBody, xloc=xloc.bar_index, yloc=yloc.price, style=get_label_style(lineLabelAlign), textcolor=cBodyPct, size=get_font_size(lineFontSizeStr))
// --- BOXES ---
drawHLBox = (hlBoxDisplay=="Both") or (hlBoxDisplay=="Bullish" and isBull) or (hlBoxDisplay=="Bearish" and not isBull)
if showHLBox and drawHLBox
if not na(bHL)
box.delete(bHL)
bHL := box.new(leftX_base, prevH, rightX_base, prevL, xloc=xloc.bar_index, border_color=cBoxBorder, bgcolor=cBoxFill)
drawWickBox = (wickBoxDisplay=="Both") or (wickBoxDisplay=="Bullish" and isBull) or (wickBoxDisplay=="Bearish" and not isBull)
if enableWickBox and drawWickBox
float topP = isBull ? prevH : prevC
float botP = isBull ? prevC : prevL
if not na(topP) and not na(botP)
if not na(wickBox)
box.delete(wickBox)
wickBox := box.new(leftX_base, topP, rightX_base, botP, xloc=xloc.bar_index, border_color=cWboxBorder, bgcolor=(isBull?cBullBox:cBearBox))
else if not enableWickBox and not keepLastWick and not na(wickBox)
box.delete(wickBox)
wickBox := na
// --- TABLE (vedno na obeh) ---
float wickPips = isBull ? prevH-prevC : prevC-prevL
float bodyPips = na
if not na(levelPct)
bodyPips := isBull ? math.round((prevH-levelPct)/pipSize) : math.round((levelPct-prevL)/pipSize)
table.cell(wickTable, 0, 0, wickLabelText, text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(descFontSizeStr))
table.cell(wickTable, 1, 0, str.tostring(wickPips/pipSize), text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(valFontSizeStr))
if not na(bodyPips)
table.cell(wickTable, 0, 1, bodyLabelText, text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(descFontSizeStr))
table.cell(wickTable, 1, 1, str.tostring(bodyPips), text_color=cPipText, bgcolor=cPipBox, text_size=get_font_size(valFontSizeStr))