Indicator

SMC POI Dashboard by LKBPSMC POI Dashboard — a non-repainting, multi-timeframe Smart Money Concepts indicator for PulseWire (Pine v6), built for XAUUSD but symbol-agnostic.
It independently tracks market structure — confirmed swing highs/lows (HH/HL/LH/LL), body-close-only Break of Structure, active trading range, and protected levels — across five fixed timeframes (4H/1H/15M/5M/1M) using request.security(). On every confirmed BOS, it deterministically detects a Point of Interest (order block): the last 1–3 opposite-colored candles immediately preceding the break, combined into a single zone. Each timeframe keeps only its newest Bullish and Bearish POI, drawn as a color-coded box (distinct color per timeframe) anchored to its true origin candle. Zones turn gray and freeze when price wicks into them (Mitigated), and are deleted outright if price closes fully through (Invalidated).
Chart visuals (swing labels, BOS markers, range/protected lines, and POI boxes) can be filtered to show only the timeframe matching your current chart, keeping the chart clean. A floating dashboard summarizes trend, last BOS, range, and both POIs for all five timeframes plus current price and status (inside/outside a POI) at a glance. Indicator

Indicator

Prior Range XL**Prior Range XL — Overview**
Prior Range XL plots the previous period's trading range directly on the chart and marks the key levels inside it. It answers a simple question at a glance: where did price trade last period, and where are the meaningful levels within that zone? The prior high and low from a higher timeframe (day, week, or month) often act as support, resistance, and targets in the current period, and this tool keeps them visible and updated without manual drawing.
**What it draws on the chart**
- **Range box** — a shaded rectangle spanning the prior period's high down to its low, giving an immediate visual sense of the zone price is working within.
- **Prior High line** — the top of the range, extended across the current period.
- **Prior Low line** — the bottom of the range, extended across the current period.
- **Midline** — the exact midpoint (50%) of the range, often treated as the "fair value" or equilibrium of the zone.
- **Two internal levels** — user-placed lines inside the range (defaults sit at 20% and 80%), useful for spotting partial retracements, entries, and profit zones between the extremes.
All lines and the box extend to the right and refresh as the current period develops. Range values are calculated from the regular trading session only, so overnight or extended-hours spikes don't distort the prior high and low.
**The inputs, grouped**
*Structure*
- **Structure Timeframe** — the heart of the tool. Choose Daily, Weekly, or Monthly to decide which prior period defines the range. Daily uses yesterday's range, Weekly uses last week's, Monthly uses last month's. This should be set at or above the chart's timeframe for correct behavior.
*Internal Levels*
- **Show Internal Level 1 / Level 2** — toggles each of the two inner lines on or off.
- **Level 1 Value / Level 2 Value** — sets where each inner line sits within the range on a 0-to-1 scale. Zero is the range low, one is the range high, and 0.5 is the midpoint. Setting a level to exactly 0.5 hides it, since the dedicated midline already covers that spot.
*Colors*
- **Box Fill Color** — the shade and transparency of the range rectangle.
- **Box Border Color** — the outline of the box.
- **Prior High Line Color** — color of the top line (labeled PDH).
- **Prior Low Line Color** — color of the bottom line (labeled PDL).
- **Midline Color** — color of the 50% line.
- **Internal Level Color** — color applied to both inner levels.
*Lines & Styles*
- **Line Width** — thickness of the box border and every line.
- **Midline Style** — solid, dashed, or dotted for the midpoint line.
- **Internal Level Style** — solid, dashed, or dotted for the two inner levels.
**How to use it**
- **Frame the session** — set the Structure Timeframe to the period that matters for the trading approach. Intraday traders typically use Daily; swing traders lean toward Weekly or Monthly.
- **Read the edges** — the prior high and low act as natural decision points. Price approaching an edge often stalls, reverses, or breaks through with momentum, and either outcome is tradable information.
- **Use the midline as a pivot** — trading above the midline leans bullish within the range; below it leans bearish. It's a quick read on which half of the zone price favors.
- **Place the internal levels intentionally** — the defaults at 20% and 80% highlight the outer quarters of the range, a common area for reactions before price tests the extremes. Adjust them to match a preferred method, such as thirds or a specific retracement depth.
- **Style for clarity** — assign distinct colors so the high, low, midline, and internal levels are instantly distinguishable, and use dashed or dotted styles to keep the inner lines from competing visually with the range boundaries.
**One practical note**
Because the title is "Prior Range XL," the chart platform treats it as its own indicator. Any earlier version under a different name stays separate and should be removed manually to avoid overlapping boxes and lines.
*(This description is drawn entirely from the indicator's own settings and logic — no outside sources involved.)* Indicator

DCA Performance Backtester [Multi-Mode]
DCA Performance Backtester
WHAT IT DOES
This indicator backtests Dollar-Cost Averaging (DCA) accumulation strategies on any symbol and shows the full result on the chart: an on-chart summary table, entry markers, average-cost line, real dividend (ex-date) tracking, a dividend-yield value zone, and a fair comparison against Lump Sum investing. It is accumulate-only (HODL) — no selling logic.
BUY MODES (can be combined)
1. Time-Based DCA — buy a fixed amount every Day / Week / Month. You can pick the weekday (weekly), the day of month (monthly, e.g. payday), or the hour (daily on intraday charts). If the market is closed on the target day, it buys the next trading day.
2. Buy the Dip — buy when price drops X% (default 12%) from the highest close of the last N bars (default 20). A cooldown (default 14 bars) spaces out repeat buys while the condition persists. Optional RSI settings:
• Filter mode — only buy when RSI is below the threshold (default 30).
• Hybrid mode — buy a normal unit on every qualifying dip (blue "D" label) AND an extra special unit when RSI is also below the threshold (red "fire" label), each stream with its own cooldown. The special unit size is adjustable via a multiplier.
3. Martingale-style averaging — first unit at a fixed size, then buy a larger unit (configurable multiplier) each time price falls another X% from the last entry, with a max-steps cap and optional reset when price recovers above average cost.
DIVIDENDS (REAL EX-DATE DATA)
Uses the symbol's actual dividend history. On each ex-date the script credits dividend × units held. Choose Gross or Net; where an exchange only provides gross figures (e.g. SET), Net is estimated as Gross × (1 − withholding tax %). Each ex-date is marked on the price chart with its per-round yield ("XD 2.35%" = dividend per share ÷ close of that day).
DIVIDEND-YIELD VALUE ZONE
Highlights price areas where the annual dividend yield at that price exceeds your threshold (default 8%/year) — useful for income-focused accumulation. Two calculation modes: trailing 12 months (TTM) or last completed calendar year. An outlier filter (default 2.5× median) excludes one-off special dividends so they do not inflate the yield. A reference line shows the exact price where yield equals the threshold.
SUMMARY TABLE
Buy count (normal vs RSI-passed dips), invested capital, units held, average cost, current portfolio value, P/L, ex-date count, total dividends received, dividends as % of invested capital, current TTM yield, DCA total return (incl. dividends), and a Lump Sum comparison computed from the same invested amount at the start date — including dividends on the Lump Sum side for a fair comparison.
ALERTS
Every buy signal fires alert() with a JSON payload (symbol, mode, price, amount, drawdown from high, RSI, and whether the RSI condition passed) — ready for webhooks. Create an alert with "Any alert() function call". Alerts fire on bar close for signals that occur after the alert is created; historical backtest markers do not fire.
HOW TO USE
Recommended on daily charts. Enable one or more buy modes, set your budget and date range, and read the "DCA beats/loses Lump Sum" row to judge whether systematic dip-buying suits the symbol. Typical tuning: calmer stocks work with smaller dip thresholds (5–7%), volatile ones with larger (12–15%).
METHOD & LIMITATIONS
Simulation buys at bar close (no intrabar fills). Accounting is computed by the script itself (indicator, not a strategy — no Strategy Tester tab). Commission % per purchase is included in cost basis. Dividend data depends on PulseWire's database and may be incomplete for some markets or older periods. Past performance does not guarantee future results. Educational tool — not investment advice.
═══════════════════════════════════════════════
DCA Performance Backtester
เครื่องมือทดสอบย้อนหลัง (backtest) กลยุทธ์สะสมหุ้นแบบ DCA กับสินทรัพย์ใดก็ได้ แสดงผลครบบนชาร์ต: ตารางสรุป, จุดซื้อ, เส้นต้นทุนเฉลี่ย, เงินปันผลจากวัน XD จริง, โซนราคาที่ปันผลคุ้ม และการเทียบกับ Lump Sum อย่างยุติธรรม — เป็นแบบซื้อสะสมอย่างเดียว (HODL) ไม่มีการขาย
โหมดการซื้อ (เปิดพร้อมกันได้)
1) DCA ตามรอบเวลา — รายวัน/รายสัปดาห์/รายเดือน เลือกวันและเวลาซื้อได้ ตลาดปิดวันเป้าหมายจะเลื่อนให้อัตโนมัติ
2) Buy the Dip — ซื้อเมื่อราคาย่อจาก High ตาม % ที่ตั้ง (ค่าเริ่มต้น 12% จากกรอบ 20 แท่ง เว้นซื้อซ้ำ 14 แท่ง) พร้อมตัวเลือก RSI สองแบบ: กรองอย่างเดียว หรือโหมดผสม — ไม้ปกติทุกครั้งที่ย่อ (ป้าย D สีฟ้า) + ไม้พิเศษเมื่อ RSI ต่ำกว่าเกณฑ์ด้วย (ป้ายไฟสีแดง) แยก cooldown สองสาย ปรับตัวคูณไม้พิเศษได้
3) ถัวเฉลี่ยขาลงแบบ Martingale — ไม้ใหญ่ขึ้นตามตัวคูณเมื่อราคาลงต่อ มีเพดานจำนวนไม้และรีเซ็ตเมื่อราคาฟื้น
เงินปันผล — ใช้ประวัติ XD จริงของสินทรัพย์ คิดจากจำนวนหน่วยที่ถือ ณ วัน XD เลือก Gross/Net ได้ (ตลาดที่มีแต่ Gross เช่น SET จะคำนวณ Net จากภาษีหัก ณ ที่จ่ายให้) จุด XD บนชาร์ตแสดง % ปันผลของงวดนั้นเทียบราคาวันนั้น
โซนปันผลคุ้ม — ไฮไลท์พื้นหลังช่วงราคาที่ yield ต่อปีสูงกว่าเกณฑ์ (ค่าเริ่มต้น 8%) เลือกวิธีคิดได้ทั้ง TTM 12 เดือน หรือปีปฏิทินล่าสุด พร้อมตัวกรองตัดปันผลพิเศษที่ทำให้ yield โป่งเกินจริง และเส้นบอกราคาที่ yield เท่าเกณฑ์พอดี
ตารางสรุป — จำนวนไม้ (แยกไม้ปกติ/ผ่าน RSI), เงินต้น, หน่วยที่ถือ, ต้นทุนเฉลี่ย, มูลค่าพอร์ต, กำไร/ขาดทุน, จำนวนครั้ง XD, ปันผลรวมและคิดเป็น % ของเงินต้น, yield ปัจจุบัน, ผลตอบแทนรวมปันผล และบรรทัดตัดสิน DCA ชนะ/แพ้ Lump Sum
Alert — ทุกสัญญาณซื้อยิง alert() เป็น JSON (สัญลักษณ์ โหมด ราคา จำนวนเงิน % ย่อ RSI และสถานะผ่าน RSI) พร้อมต่อ webhook ตั้งด้วย "Any alert() function call" — ยิงเฉพาะสัญญาณที่เกิดหลังตั้ง alert ที่ราคาปิดแท่ง
ข้อจำกัด — จำลองซื้อที่ราคาปิดแท่ง เป็น indicator จึงไม่มีแท็บ Strategy Tester ข้อมูลปันผลอิงฐานข้อมูล PulseWire ผลในอดีตไม่ยืนยันอนาคต จัดทำเพื่อการศึกษา ไม่ใช่คำแนะนำการลงทุน Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

High/Low Resistance LiquidityDescription
Not all liquidity pools are created equal. The market behaves very differently when attacking a clean, pristine target versus when it is grinding through jagged, already-swept price action.
The High/Low Resistance Liquidity indicator is an automated structural mapping engine that programmatically identifies and categorizes liquidity pools into Low Resistance (LRLR) and High Resistance (HRLR) targets in real-time.
🎯 What is LRLR and HRLR?
LRLR (Low Resistance Liquidity Run): These are "clean" targets. When stops are perfectly clustered at the exact same price, it creates a massive, unobstructed magnetic pull for price. When price attacks these areas, it displaces quickly and aggressively.
HRLR (High Resistance Liquidity Run): These are "dirty" or swept targets. If a pivot high has already swept a previous high and rejected (a false breakout or sweep), the liquidity resting there was already purged. Price will struggle, chop, and overlap heavily if it attempts to push back into that isolated zone.
✨ Key Features
Automated Target Detection: The indicator maps structural highs and lows using customizable left/right bar pivot confirmations, and immediately evaluates their relationship to the previous market structure.
EQH/EQL Detection (LRLR): If a new structural pivot forms within a tight tick threshold of the previous pivot, it validates them as Equal Highs or Equal Lows. A solid, highly visible line is drawn forward, marking a pristine Low Resistance target.
Swept Pivot Detection (HRLR): If a new pivot extends past the old pivot and reverses, it validates a sweep. A dotted warning line is drawn forward, marking a High Resistance target where price is likely to struggle.
Real-Time Mitigation: The script actively monitors price action. The exact moment a future candle wicks or closes through an active liquidity line, the line stops extending and its label updates to "Mitigated", keeping your charts completely free of historical clutter.
Standard Liquidity Toggle: Choose whether you only want to see explicit LRLR/HRLR targets, or if you want to also track all standard, unmitigated intermediate pivots in the background.
⚙️ Settings
Pivot Strength: Fully customize how many bars are required left and right to confirm a major structural point.
EQH/EQL Tolerance (Ticks): You dictate exactly how tight the price must align to be considered "Equal". (e.g., 5-10 ticks on lower timeframes, or expand it for Daily charts).
Display Settings: Toggle the visibility of Standard Unmitigated Pivots, turn text labels on or off, and fully customize the line colors to fit your exact chart aesthetic. Indicator

High / Low Resistance Liquidity TrendDescription
This indicator is a powerful, algorithmic tool designed for HRLR methodologies. It removes the subjectivity of identifying High Resistance Liquidity Runs (HRLR) and Low Resistance Liquidity Runs (LRLR) by dynamically mapping out the structural flow of liquidity on your chart using clean, point-to-point trendlines.
🎯 Core Concepts
In this methodology, understanding whether price will face "resistance" when drawing to a liquidity pool is critical for trade management:
Low Resistance Liquidity (LRLR): Clean, engineered liquidity. When price fails to sweep a previous structural extreme, it leaves behind smooth, resting stop-losses. This acts as a frictionless magnet for price.
High Resistance Liquidity (HRLR): Swept liquidity. When price violently takes out a previous extreme and reverses, it purges the local stop-losses. Returning to this level is a "High Resistance" run because the liquidity fuel has already been burned.
⚙️ How It Works
The script evaluates price action in real-time, detecting structural Pivot Highs and Pivot Lows. It then dynamically draws trendlines connecting adjacent pivots to reveal the underlying liquidity texture:
🟢 LRLR (Green Lines) - Failed Sweeps:
Highs: Connects a Pivot High to a subsequent Lower High.
Lows: Connects a Pivot Low to a subsequent Higher Low.
Signal: Clean trendline liquidity is building. Expect a fast, low-resistance run through this level.
🔴 HRLR (Red Lines) - Liquidity Sweeps:
Highs: Connects a Pivot High to a subsequent Higher High.
Lows: Connects a Pivot Low to a subsequent Lower Low.
Signal: A Turtle Soup / Sweep has occurred. Price may struggle to break this extreme cleanly.
✨ Visual Polish
This indicator is built with extreme attention to aesthetic detail. Rather than messy labels cluttering the wicks, the text (LRLR / HRLR) is mathematically positioned at the exact midpoint of the connecting trendlines. It features a custom Label Masking engine that dynamically cuts out the line exactly where the text sits, providing a stunning, ultra-clean look. (Note: Use the 'Chart Background Color' setting to ensure the label mask matches your specific PulseWire theme).
🔧 Settings
Pivot Left/Right Bars: Fully customize the structural lookback to define exactly what constitutes a valid swing high/low for your timeframe.
Visual Customization: Full control over colors and text labels.
Chart Background Mask: Allows you to swap the label cutout color between Light Mode and Dark Mode backgrounds flawlessly. Indicator

Indicator

Indicator

Swing TP/SL UltimateSwing TP/SL Ultimate
PulseWire Pine Script v6 — Overlay Indicator
Short title: TP/SL▲▼ | Version: 2.0 | Type: Overlay Indicator
Overview
Swing TP/SL Ultimate is an advanced Take Profit and Stop Loss analysis tool for PulseWire. Instead of requiring you to manually set fixed TP/SL percentages, it automatically calculates statistically-derived average TP and SL distances by studying every confirmed Swing High and Swing Low in historical price data across multiple timeframes and pivot lengths.
The core idea: the market's own past behaviour tells you how far it typically moves up (TP) and down (SL) from any given point. This indicator collects hundreds of those data points, filters out outliers, and surfaces the most reliable average — displayed as both a percentage and an actual price level on your chart.
Key Features
Multi-length Pivot DetectionSimultaneously scans 3 configurable pivot lengths (Fast / Mid / Slow) to maximise the number of valid swing samples
Multi-TimeFrame (HTF) PivotsImports pivots from a Higher TimeFrame and merges them into
the same statistical buffer
4 Averaging MethodsSimple, EMA-Weighted, Trimmed Mean, and Blended — all computed in parallel
Per-Bar ATR-Style AverageUses every bar's high−open and open−low as additional TP/SL samples for maximum data density
KNN High/Low PredictionA K-Nearest Neighbours model predicts the likely High and Low over the next 5 bars using 10 market features
Buy / Sell SignalsFires when price reaches a confirmed swing extreme, RSI confirms, and optional volume confirmation passes
Scalable DashboardFour size presets (Tiny / Small / Medium / Large) with compact mode for minimal screen space
Dual-format ValuesEvery metric is shown as both % and actual price — e.g. 2.34% (48,250.00)
Opaque Line LabelsLabels sit directly on chart lines with solid dark backgrounds so they block the line rather than overlap it
How It Works
1. Pivot Collection
A Swing High is a bar whose high is the highest of the N bars before it and the N bars after it. PulseWire confirms this N bars after the fact. The indicator runs this detection three times simultaneously with different lengths:
Fast pivot (default N=5) — captures minor swings, many samples
Mid pivot (default N=10) — captures medium swings
Slow pivot (default N=21) — captures major swings, fewer but stronger signals
HTF pivot (default N=10 on 60m) — imported from higher timeframe
Every confirmed pivot feeds into a unified rolling array buffer shared by all four sources.
2. Percentage Calculation
For each confirmed Swing High pivot:
TP% sample = (pivotHigh − confirmClose) / confirmClose × 100
For each confirmed Swing Low pivot:
SL% sample = (confirmClose − pivotLow) / confirmClose × 100
Only positive values are stored. The buffer is capped at Rolling Buffer Size entries — when full, the oldest sample is dropped (FIFO), keeping the average adaptive to the current market regime.
3. Averaging Methods
All four methods run simultaneously. You choose which one drives the final Suggested TP/SL prices:
Simple Average
The arithmetic mean of all samples in the rolling buffer. Straightforward and transparent.
EMA-Weighted Average
A running Exponential Moving Average applied to each new pivot sample as it arrives. Recent pivots are weighted more heavily than older ones, making this method more responsive to regime changes.
α = 2 / (EMA Period + 1)
emaTP = emaTP × (1 − α) + newSample × α
Trimmed Mean (default)
Sorts all buffer samples and removes the top and bottom N% before computing the mean. This eliminates the influence of extreme outlier swings (e.g. a flash crash or a parabolic spike) that would otherwise skew the average.
Default trim: 10% → removes top 10% and bottom 10% of samples
Blended
Averages the Trimmed Mean result with the Per-Bar ATR-style result. Combines the statistical robustness of pivot-based sampling with the high data density of per-bar measurement.
4. Per-Bar ATR-Style Sampling
In addition to pivot-based samples, every single bar contributes:
barTP% = (high − open) / open × 100 ← upside potential per bar
barSL% = (open − low) / open × 100 ← downside risk per bar
An EMA is applied to both series. This gives the indicator a very high sample count (one per bar vs. one per pivot event) and closely mirrors the concept of Average True Range expressed directionally as a percentage.
KNN Prediction
The indicator includes a K-Nearest Neighbours (KNN) machine learning model that predicts how far price is likely to move up and down over the next 5 bars.
Feature Vector (10 dimensions)
#FeatureWhat it captures0RSI (14)Momentum / overbought / oversold1Distance from EMA-50 %Trend deviation2ATR (14) as % of priceVolatility regime3Bollinger Band position %Price within range4Volume vs. 20-bar SMA %Volume spike detection5Candle body size %Bar strength6Upper wick %Rejection at highs7Lower wick %Rejection at lows8Momentum (10-bar) %Short-term trend force9Close position in 20-bar range %Range context
Algorithm
For every bar in the training window (up to 200 bars back, sampled every 2 bars for performance), compute the Euclidean distance between the current bar's feature vector and that historical bar's feature vector.
Select the K nearest historical bars (default K=5).
For each neighbour, look up what actually happened over the next 5 bars: how high did price go, how low did it go.
Weight each neighbour by inverse distance — closer matches contribute more.
The weighted average of future highs and lows becomes the KNN prediction.
The result is plotted as a dotted forward line on the chart and shown in the dashboard.
Buy / Sell Signals
Signals fire only when all conditions are simultaneously true.
Buy Signal (▲ BUY — green label below bar)
ConditionLogicNear Swing Lowclose ≤ lastSwingLow × (1 + avgSL% × 0.5)RSI OversoldRSI ≤ Oversold threshold (default 35)Bullish candleclose > openVolume (optional)volume > 20-bar SMA × 1.2
Sell Signal (▼ SELL — red label above bar)
ConditionLogicNear Swing Highclose ≥ lastSwingHigh × (1 − avgTP% × 0.5)RSI OverboughtRSI ≥ Overbought threshold (default 65)Bearish candleclose < openVolume (optional)volume > 20-bar SMA × 1.2
Note: Signals are contextual alerts, not a complete trading system. Always combine with your own analysis and risk management.
Dashboard
The on-chart table updates on every bar. Its size, position, and content depth are all configurable.
Size Presets
SizeTextRows shownTinytinyCore only (compact)SmallsmallCore + method breakdownMediumnormalCore + breakdown + range statsLargelargeFull: all above + KNN + signal state + HTF status
Dashboard Sections
Always visible
RowLabelDescriptionTitle⬡ TP / SL ULTIMATEActive method + sample countsLive▲ To Swing HIGH% and price distance to last pivot highLive▼ To Swing LOW% and price distance to last pivot lowAvg★ Avg TP (Final)Final averaged TP as % and suggested priceAvg★ Avg SL (Final)Final averaged SL as % and suggested priceAvg⚖ R:R RatioavgTP ÷ avgSL — green ≥2.0, yellow ≥1.0, red <1.0
Small and above
RowLabelDescriptionBreakdownSimple / EMA-Weighted / Trimmed / Per-BarTP% / SL% for each method side by side
Medium and above
RowLabelDescriptionRangeAvg High %Mean upside from all pivot samplesRangeMax / Min High %Best and worst upside seen in bufferRangeAvg Low %Mean downside from all pivot samplesRangeMax Low %Worst downside seen in buffer
Large only
RowLabelDescriptionKNNKNN Pred High +%Predicted upside over next 5 bars (% + price)KNNKNN Pred Low −%Predicted downside over next 5 bars (% + price)SignalRSICurrent RSI value, colour-codedSignalVolume vs SMACurrent volume as % of 20-bar SMASignalActive SignalBUY / SELL / WaitingInfoHTF PivotsWhether HTF pivot collection is active
Chart Visuals
ElementColourDescriptionDashed green lineGreenLast confirmed Swing High levelDashed red lineRedLast confirmed Swing Low levelSolid teal lineTealAvg TP suggested priceSolid orange lineOrangeAvg SL suggested priceDotted purple linePurpleKNN predicted High (forward projection)Dotted fuchsia lineFuchsiaKNN predicted Low (forward projection)▼ triangle above barRedConfirmed pivot high marker▲ triangle below barLimeConfirmed pivot low markerBUY labelLimeBuy signal — all conditions metSELL labelRedSell signal — all conditions met
All lines carry opaque labels (solid dark background matching the line colour) placed directly on the line so the text is legible without the line running through it.
Input Reference
📐 Pivot Detection
InputDefaultRangeDescriptionPivot Length 1 – Fast52–50Left/right bars to confirm a fast swingPivot Length 2 – Mid102–100Left/right bars for mid-grade swingPivot Length 3 – Slow212–200Left/right bars for slow/major swingRolling Buffer Size15020–500Max samples kept per side (TP / SL)Outlier Trim %100–40% of extremes removed from trimmed meanEMA Weight Period142–100Smoothing for EMA-weighted averagePer-Bar EMA Length20010–1000EMA length for per-bar ATR-style average
🌐 Multi-TimeFrame
InputDefaultDescriptionEnable HTF PivotsOnAdds higher-timeframe pivots to the bufferHigher TimeFrame60 (1H)Source timeframe for HTF pivotsHTF Pivot Length10Pivot detection length on the higher timeframe
🤖 KNN Prediction
InputDefaultRangeDescriptionEnable KNNOn—Toggle the KNN engine on/offK Neighbours53–15Number of nearest matches to useKNN Training Window10030–200How many bars back to search
📊 Averaging
InputDefaultOptionsDescriptionPrimary Pivot MethodTrimmed MeanSimple / EMA Weighted / Trimmed Mean / BlendedWhich pivot average drives the final outputSample SourceBlendedPivot Only / Per-Bar Only / BlendedWhat data feeds the final TP/SL
🎯 Signals
InputDefaultDescriptionShow Buy/Sell SignalsOnMaster toggle for signal markersRSI Length14Period for RSI calculationRSI Oversold – Buy35RSI threshold to confirm a buyRSI Overbought – Sell65RSI threshold to confirm a sellVolume ConfirmationOnRequire volume > 1.2× SMA to trigger
🖥 Dashboard
InputDefaultOptionsDescriptionPositionTop RightTop/Bottom × Left/RightCorner placement of the tableDashboard SizeMediumTiny / Small / Medium / LargeControls text size and row countUltra-Compact ModeOff—Shows only title + 6 core rows
🎨 Visuals
InputDefaultDescriptionShow Pivot Level LinesOnDashed lines at last Swing High / LowShow Avg TP/SL LinesOnSolid lines at suggested TP and SL pricesShow KNN Predicted LinesOnDotted forward lines from KNN modelShow Pivot MarkersOnTriangles at confirmed pivot barsShow Line LabelsOnOpaque labels on all chart lines
Recommended Settings by Use Case
Scalping (1m – 5m charts)
Pivot Length 1: 3 Pivot Length 2: 5 Pivot Length 3: 10
HTF Timeframe: 15
Buffer Size: 100 EMA Period: 7 Per-Bar EMA: 50
Primary: EMA Weighted Source: Blended
RSI Oversold: 30 RSI Overbought: 70
Swing Trading (1H – 4H charts)
Pivot Length 1: 5 Pivot Length 2: 10 Pivot Length 3: 21
HTF Timeframe: D
Buffer Size: 150 EMA Period: 14 Per-Bar EMA: 200
Primary: Trimmed Mean Source: Blended
RSI Oversold: 35 RSI Overbought: 65
Position Trading (Daily – Weekly charts)
Pivot Length 1: 10 Pivot Length 2: 20 Pivot Length 3: 50
HTF Timeframe: W
Buffer Size: 200 EMA Period: 21 Per-Bar EMA: 500
Primary: Simple Source: Pivot Only
RSI Oversold: 40 RSI Overbought: 60
Technical Notes
Pine Script version: v6
Type: indicator() with overlay=true
Max lines: 20 | Max labels: 50
MTF data: Uses barmerge.lookahead_off to prevent future-leak
KNN performance: Samples every 2nd bar in the training window; hard-capped at 200 bars to stay within Pine's execution time limits
Global scope rule: All plotshape() calls and var mutations are placed at the global scope as required by Pine Script v6
Changelog
VersionDateChanges1.0InitialBasic pivot avg + dashboard2.0CurrentKNN engine, MTF pivots, 4 avg methods, buy/sell signals, 4 dashboard sizes, opaque line labels, full Pine v6 scope compliance
Built for PulseWire Pine Script v6. For educational and analytical purposes only — not financial advice. Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Indicator
