MA5 — 四點高低 + H1/L1 水平線 + 突破/回買 + 月季線交叉//@version=5
indicator("MA5 — 四點高低 + H1/L1 水平線 + 突破/回買 + 月季線交叉", overlay=true)
// 1. 均線設定
ma5 = ta.sma(close, 5)
ma10 = ta.sma(close, 10)
ma20 = ta.sma(close, 20)
ma60 = ta.sma(close, 60) // ← 加上這一行
// 畫出均線
plot(ma5, title="MA5", color=color.red)
plot(ma10, title="MA10", color=color.orange)
plot(ma20, title="MA20", color=color.yellow)
plot(ma60, title="MA60", color=color.green)
// 2. 全域變數:方向、區段極值
var int direction = na
var float segHigh = na
var int segHighBar = na
var float segLow = na
var int segLowBar = na
// 3. 全域變數:儲存兩組高低
var float high1 = na
var int high1Bar = na
var float high2 = na
var int high2Bar = na
var float low1 = na
var int low1Bar = na
var float low2 = na
var int low2Bar = na
// 4. 全域變數:標籤與線段句柄
var label highLbl1 = na
var label highLbl2 = na
var label lowLbl1 = na
var label lowLbl2 = na
var line highLine = na
var line lowLine = na
var line h1Line = na
var line l1Line = na
// 5. 全域變數:回買訊號控制
var bool buyBackShown = false
// 6. 判斷當前段方向
currDir = close > ma5 ? 1 : close < ma5 ? -1 : direction
// 7. 首次初始化
if na(direction)
direction := currDir
segHigh := high
segHighBar := bar_index
segLow := low
segLowBar := bar_index
// 8. 同段內更新極值
if currDir == 1 and high > segHigh
segHigh := high
segHighBar := bar_index
if currDir == -1 and low < segLow
segLow := low
segLowBar := bar_index
// 9. 段落切換:推舊值→更新 H1/L1→刪舊標籤/線→畫新標籤/線→重置 seg*
if currDir != direction
high2 := high1
high2Bar := high1Bar
low2 := low1
low2Bar := low1Bar
if direction == 1
high1 := segHigh
high1Bar := segHighBar
else
low1 := segLow
low1Bar := segLowBar
buyBackShown := false
if not na(highLbl1)
label.delete(highLbl1)
if not na(highLbl2)
label.delete(highLbl2)
if not na(lowLbl1)
label.delete(lowLbl1)
if not na(lowLbl2)
label.delete(lowLbl2)
if not na(high2)
highLbl2 := label.new(high2Bar, high2, "H2", style=label.style_label_down, color=color.blue, textcolor=color.white)
if not na(high1)
highLbl1 := label.new(high1Bar, high1, "H1", style=label.style_label_down, color=color.blue, textcolor=color.white)
if not na(low2)
lowLbl2 := label.new(low2Bar, low2, "L2", style=label.style_label_up, color=color.purple, textcolor=color.white)
if not na(low1)
lowLbl1 := label.new(low1Bar, low1, "L1", style=label.style_label_up, color=color.purple, textcolor=color.white)
if not na(highLine)
line.delete(highLine)
if not na(high1) and not na(high2)
highLine := line.new(high2Bar, high2, high1Bar, high1, color=color.blue, width=2)
if not na(lowLine)
line.delete(lowLine)
if not na(low1) and not na(low2)
lowLine := line.new(low2Bar, low2, low1Bar, low1, color=color.purple, width=2)
if not na(h1Line)
line.delete(h1Line)
if not na(high1)
h1Line := line.new(high1Bar, high1, bar_index, high1, xloc=xloc.bar_index, extend=extend.right, color=color.green, style=line.style_dashed)
if not na(l1Line)
line.delete(l1Line)
if not na(low1)
l1Line := line.new(low1Bar, low1, bar_index, low1, xloc=xloc.bar_index, extend=extend.right, color=color.red, style=line.style_dashed)
segHigh := high
segHighBar := bar_index
segLow := low
segLowBar := bar_index
// 10. 更新方向
direction := currDir
// 11. 突破訊號:收盤首次突破 H1 且 ma5>ma10>ma20
buySignal = not na(high1) and ta.crossover(close, high1) and ma5 > ma10 and ma10 > ma20
if buySignal
label.new(bar_index, low, "突破", style=label.style_label_up, color=color.green, textcolor=color.white)
// 12. 回買訊號:L1 之後任一 K 棒,首次收盤突破 MA5,且高於 L1、漲幅>2%、ma5>ma10>ma20、且收盤>ma20
buyBackSignal = not na(low1) and bar_index > low1Bar and ta.crossover(close, ma5) and high > low1 and (close - open) / open > 0.02 and ma5 > ma10 and ma10 > ma20 and close > ma20 and not buyBackShown
if buyBackSignal
label.new(bar_index, low, "回買", style=label.style_label_up, color=color.green, textcolor=color.white)
buyBackShown := true
// 13. 月季線交叉且四線多頭排列時,在 K 棒正下方標示放大三角形
if ta.cross(ma20, ma60) and ma5 > ma10 and ma10 > ma20 and ma20 > ma60
label.new(bar_index, low, "▲", xloc=xloc.bar_index, yloc=yloc.belowbar, style=label.style_label_center, color=color.new(color.white, 100), textcolor=color.white, size=size.large)
Chart patterns
MA5 — 四點高低 + H1/L1 水平線 + 突破/回買 + 月季線交叉//@version=5
indicator("MA5 — 四點高低 + H1/L1 水平線 + 突破/回買 + 月季線交叉", overlay=true)
// 1. 均線設定
ma5 = ta.sma(close, 5)
ma10 = ta.sma(close, 10)
ma20 = ta.sma(close, 20)
ma60 = ta.sma(close, 60)
plot(ma5, title="MA5", color=color.orange)
plot(ma10, title="MA10", color=color.blue)
plot(ma20, title="MA20", color=color.red)
plot(ma60, title="MA60", color=color.gray)
// 2. 全域變數:方向、區段極值
var int direction = na
var float segHigh = na
var int segHighBar = na
var float segLow = na
var int segLowBar = na
// 3. 全域變數:保存兩組高低
var float high1 = na
var int high1Bar = na
var float high2 = na
var int high2Bar = na
var float low1 = na
var int low1Bar = na
var float low2 = na
var int low2Bar = na
// 4. 全域變數:標籤與線段句柄
var label highLbl1 = na
var label highLbl2 = na
var label lowLbl1 = na
var label lowLbl2 = na
var line highLine = na
var line lowLine = na
var line h1Line = na
var line l1Line = na
// 5. 全域變數:回買訊號控制
var bool buyBackShown = false
// 6. 判斷當前段方向
currDir = close > ma5 ? 1 : close < ma5 ? -1 : direction
// 7. 首次初始化
if na(direction)
direction := currDir
segHigh := high
segHighBar := bar_index
segLow := low
segLowBar := bar_index
// 8. 同段內更新極值
if currDir == 1 and high > segHigh
segHigh := high
segHighBar := bar_index
if currDir == -1 and low < segLow
segLow := low
segLowBar := bar_index
// 9. 段落切換:推舊值→存 H1/L1→刪舊標籤/線→畫新標籤/線→重置 seg*
if currDir != direction
// 推舊值
high2 := high1
high2Bar := high1Bar
low2 := low1
low2Bar := low1Bar
// 存 H1 或 L1,並重置回買旗標(遇到低段)
if direction == 1
high1 := segHigh
high1Bar := segHighBar
else
low1 := segLow
low1Bar := segLowBar
buyBackShown := false
// 刪除舊標籤
if not na(highLbl1)
label.delete(highLbl1)
if not na(highLbl2)
label.delete(highLbl2)
if not na(lowLbl1)
label.delete(lowLbl1)
if not na(lowLbl2)
label.delete(lowLbl2)
// 畫 H2/H1 標籤
if not na(high2)
highLbl2 := label.new(high2Bar, high2, "H2", style=label.style_label_down, color=color.blue, textcolor=color.white)
if not na(high1)
highLbl1 := label.new(high1Bar, high1, "H1", style=label.style_label_down, color=color.blue, textcolor=color.white)
// 畫 L2/L1 標籤
if not na(low2)
lowLbl2 := label.new(low2Bar, low2, "L2", style=label.style_label_up, color=color.purple, textcolor=color.white)
if not na(low1)
lowLbl1 := label.new(low1Bar, low1, "L1", style=label.style_label_up, color=color.purple, textcolor=color.white)
// 刪舊並畫高低連線
if not na(highLine)
line.delete(highLine)
if not na(high1) and not na(high2)
highLine := line.new(high2Bar, high2, high1Bar, high1, color=color.blue, width=2)
if not na(lowLine)
line.delete(lowLine)
if not na(low1) and not na(low2)
lowLine := line.new(low2Bar, low2, low1Bar, low1, color=color.purple, width=2)
// 刪舊並畫 H1 水平線
if not na(h1Line)
line.delete(h1Line)
if not na(high1)
h1Line := line.new(high1Bar, high1, bar_index, high1, xloc=xloc.bar_index, extend=extend.right, color=color.green, style=line.style_dashed)
// 刪舊並畫 L1 水平線
if not na(l1Line)
line.delete(l1Line)
if not na(low1)
l1Line := line.new(low1Bar, low1, bar_index, low1, xloc=xloc.bar_index, extend=extend.right, color=color.red, style=line.style_dashed)
// 重置 seg*
segHigh := high
segHighBar := bar_index
segLow := low
segLowBar := bar_index
// 10. 更新方向
direction := currDir
// 11. 突破訊號:首次收盤突破 H1 且 ma5>ma10>ma20
buySignal = not na(high1) and ta.crossover(close, high1) and ma5 > ma10 and ma10 > ma20
if buySignal
label.new(bar_index, low, "突破", style=label.style_label_up, color=color.green, textcolor=color.white)
// 12. 回買訊號:L1 之後任一棒,首次收盤突破 MA5,且高於 L1、漲幅>2%、ma5>ma10>ma20、且收盤>ma20
buyBackSignal = not na(low1) and bar_index > low1Bar and ta.crossover(close, ma5) and high > low1 and (close - open) / open > 0.02 and ma5 > ma10 and ma10 > ma20 and close > ma20 and not buyBackShown
if buyBackSignal
label.new(bar_index, low, "回買", style=label.style_label_up, color=color.blue, textcolor=color.white)
buyBackShown := true
// 13. 月季線交叉且四線多頭排列時,在 K 棒正下方標示放大三角形
if ta.cross(ma20, ma60) and ma5 > ma10 and ma10 > ma20 and ma20 > ma60
label.new(bar_index, low, "▲", xloc=xloc.bar_index, yloc=yloc.belowbar, style=label.style_label_center, color=color.new(color.white,100), textcolor=color.white, size=size.large)
Crptopastor support & Resistance ProWhat is “Cryptopastor SR Pro (v2)”?
An adaptive support-and-resistance engine that clusters swing points into price zones , then auto-draws trade plans (entry, stop-loss, multi-stage take-profits) and breakout alerts — in a single, self-contained Pine v6 study.
Why traders use it
Cuts through chart noise by keeping only the strongest confluence zones.
Updates widths automatically to match recent volatility.
Plots ready-made long or short setups you can accept, ignore or tweak.
Fires alerts the instant price closes across a zone’s midpoint.
Works on any symbol and any timeframe, from 1 min scalps to weekly swing charts.
How it works (under the hood)
Pivot harvesting – Every bar, the script scans the last prd candles for confirmed highs/lows with ta.pivothigh / ta.pivotlow .
Data pool maintenance – It stores only the most recent maxnumpp pivots, keeping the dataset light.
Clustering – Pivots lying inside a dynamic channel width ( ChannelW % of the past 300-bar range) merge into a common zone.
Strength scoring – Each zone’s score = number of pivots inside it. The top maxnumsr zones that beat min_strength survive; weaker or overlapping zones are discarded.
Visual rendering – Zones appear as translucent boxes: lime below price (potential support) or red above (potential resistance). Mid-prices are auto-labelled with timeframe + value.
Breakout detection – When a candle closes across any zone midpoint, an alert fires (“Support Broken” / “Resistance Broken”).
Trade-plan overlay (optional) – The script finds the closest valid zone and prints:
• Entry at midpoint
• Stop-loss buffered by sl_buffer_pct of zone height
• Up to num_tp_levels take-profit labels on successive opposite zones
Key inputs & typical tweaks
Pivot Period (prd) – Higher on H4/D1, lower on scalps.
Source – “High/Low” (classic) or “Close/Open” for body-based pivots.
Maximum Channel Width % – Tighten in ranging markets, widen in trending ones.
Minimum Strength – Raise to display only the most respected zones.
Show Trade Setups – Toggle if you want a pure S/R map without entries/SL/TPs.
Practical guide
Add the indicator to your chart and adjust ChannelW % until each zone looks realistic for your symbol’s volatility.
Hover a zone to view its pivot count; more pivots = stronger level.
Enable alerts → “Support or Resistance Broken” to catch live momentum shifts.
If you trade the built-in setups, confirm them with your own filters (volume, trend filters, etc.) and size positions around the printed stop-loss.
Disable the Trade Setup layer when back-testing other strategies — the S/R boxes remain.
What makes it different from classic horizontal lines?
Zone widths breathe with market range instead of staying fixed.
Self-filtering strength score removes the clutter of weak levels.
Integrated, label-based trade plans eliminate spreadsheet math.
Pure price-action logic — no MAs, RSI, Bollinger Bands or repackaged public code.
Pine-snip preview
// simplified glimpse only
float ph = ta.pivothigh(high, prd, prd)
float pl = ta.pivotlow(low, prd, prd)
// …clustering & scoring…
Disclaimer
This indicator is a technical-analysis tool, not financial advice. Test thoroughly on demo or small size before risking capital.
Peak TradePeakTrade AI Strategy
The PeakTrade AI strategy is an advanced crypto trading system, specifically optimized for the 15-minute BTC/USDT.P chart. It is not recommended for use on other timeframes or different assets.
One of the key components of the strategy is Alpha Trend, which uses a custom calculation based on ATR (Average True Range) to measure market volatility. It also incorporates momentum indicators like RSI (Relative Strength Index) and MFI (Money Flow Index) to determine the direction of the trend. This allows for a dynamic and real-time identification of trend strength and direction.
While the commonly used ATR multiplier is 3.0, PeakTrade AI internally determines the most suitable value for its strategy. In addition, it uses adaptive threshold levels for RSI and MFI to calculate trend levels that continuously adjust to changing market conditions. This dynamic adjustment significantly improves signal accuracy.
The strategy also integrates the Zero Lag Hull Moving Average (HMA) to track market momentum and direction with minimal delay. Compared to traditional moving averages, HMA responds faster to price action, offering an edge in identifying precise entry and exit points.
Specifically, the strategy analyzes the interaction between 46-period and 200-period HMAs, using mathematical momentum calculations to determine optimal entry and exit conditions.
Originality and Confirmation System
This strategy is not a simple combination of open-source indicators. It introduces a unique confirmation mechanism by analyzing USDT Dominance (USDT.D) data across multiple timeframes (1, 3, 5, 15, and 240 minutes). This allows it to assess market sentiment and risk appetite, effectively filtering out trades during unfavorable conditions.
This filtering system improves the signal confirmation rate by up to 20%.
Additionally, moving average filters and volatility-based confirmation mechanisms are used to reduce false signals and enhance the overall reliability of trade entries.
Default Backtest Settings:
Date Range: 01.01.2025 – 01.07.2025
Initial Capital: 1000 USDT
Leverage: 10x
Commission: 0.075%
Slippage: 0.1%
Average Risk/Reward Ratio: 2.917
Timeframe: Only for 15-minute charts
Optimized TP/SL Values for Risk Management:
Take-Profit (TP): 6.6%
Stop-Loss (SL): 2.0%
These values have been specifically optimized to balance profitability and risk, and have shown the best performance within the defined backtest period.
Post-Market Session AnalyzerThis script visually analyzes U.S. post-market trading hours (4:00 PM to 8:00 PM EST) by:
a) Highlighting post-market session background
b) Coloring candles based on price direction
c) Marking the final post-market candle with a trend label
Great for:
1) Traders who monitor after-hours price movement
2) Spotting late-day reversals or sentiment shifts
3) Understanding extended trading activity
NTL SCALP v2 with TP & SL (Absolute)NTL SCALP v2 with TP & SL (Absolute) – Scalping Trend System
Timeframe Example: 15-minute (XAUUSD)
Indicator Type: Combined trend-following and momentum-based scalping system
🔍 Purpose of This Indicator
This script is designed as a unified tool for intraday scalpers, combining multiple essential components—trend detection, entry signal logic, and automated risk management—into one streamlined system. Rather than simply merging various indicators, it integrates them with a clear purpose: to generate trade setups with actionable entries and realistic TP/SL targets in trending markets.
📌 Core Components & How They Work Together
Multi-Ribbon EMA Trend Filter
Multiple Exponential Moving Averages (EMAs) are used to detect short-, medium-, and long-term trends.
The EMA ribbons visually shift from red (bearish) to green (bullish) depending on the overall price structure.
These ribbons not only indicate trend direction but also serve as dynamic support/resistance levels.
Momentum-Based Entry Signals
Buy and sell signals are triggered when price momentum aligns with the trend (e.g., bullish breakout above EMAs with supporting candle structure).
The system ensures that trades are only taken in the direction of the prevailing trend, reducing the likelihood of false signals.
Auto-Generated Entry, TP & SL Levels
Once a valid setup is detected, the script plots the entry price, stop-loss (SL), and up to four take-profit (TP1–TP4) targets.
These levels are based on recent volatility and trend strength, allowing traders to manage risk and reward efficiently.
Labels such as “TP1 HIT” or “SL HIT” are displayed on the chart to show trade progress in real-time.
✅ How to Use This Indicator
Designed for scalping and short-term trend trading during high-volume market sessions (e.g., London/New York).
Ideal for traders who prefer clear rules for entry, exit, and risk management.
Can be used standalone, but works even better with confirmation from price action or volume-based tools.
🛑 Note
To ensure effective performance, avoid using this tool in ranging or low-volatility markets. It is optimized for trending environments.
⚠️ Disclaimer
This script is intended for educational purposes and does not constitute financial advice. Always conduct your own analysis and apply risk management when trading.
MTX TP SLBest use for 5 minute timeframe
scalping mode
with stop loss and take profit prices
any currencies
use at your own risk in understanding chart.
TTNY - CISD model - HTFThis is the HTF version of the CISD indicator. This one is NOT armed with alerts though.
It shows the CISD of a higher timeframe chart after taking an 'Important level'.
Timeframe inputs that are not a multiple of the chart's timeframe will result in a runtime error.
Alpha version
SMH - RSI PanelPlots multiple Relative Strength Index (RSI) lines from different timeframes in a dedicated panel. Designed to be used with the main 'SMH' indicator.
Wave 2 Flat Detection - B Breaks A High, C Breaks A Low//@version=5
indicator("Wave 2 Flat Detection - B Breaks A High, C Breaks A Low", overlay=true)
// === Parameters ===
wave1_len = 10 // length of wave 1
a_len = 5 // candles to look for Wave A
b_len = 3 // candles to look for Wave B
c_len = 3 // candles to look for Wave C
// === Detect Wave 1 (upward impulse) ===
wave1_start = low
wave1_end = high
wave1_valid = wave1_end > wave1_start * 1.05 // 5% move up
// === Wave A ===
a_start = high // assumed wave 1 top
a_end = low // correction low (Wave A end)
wave_a_valid = a_end < a_start
// === Wave B ===
b_high = high
wave_b_valid = b_high > a_start // B breaks above A's high
// === Wave C ===
c_low = low
wave_c_break = c_low < a_end // C breaks below A's low
// === Final Condition ===
flat_pattern_confirmed = wave1_valid and wave_a_valid and wave_b_valid and wave_c_break
// === Plot + Alert ===
plotshape(flat_pattern_confirmed, title="Flat Wave 2 Detected", location=location.belowbar, color=color.red, style=shape.labelup, text="C↓")
alertcondition(flat_pattern_confirmed, title="Wave C Breaks Below A", message="Wave C broke below Wave A low — Flat correction confirmed, watch for Wave 3")
[TH] กลยุทธ์ SMC หลายกรอบเวลา (V5.2 - M15 Lead)English Explanation
This Pine Script code implements a multi-timeframe trading strategy based on Smart Money Concepts (SMC). It's designed to identify high-probability trading setups by aligning signals across three different timeframes.
The core logic is as follows:
High Timeframe (HTF) - M15: Determines the overall market direction or bias.
Medium Timeframe (MTF) - M5: Identifies potential Points of Interest (POI), such as Order Blocks or Fair Value Gaps, in alignment with the M15 bias.
Low Timeframe (LTF) - Current Chart: Looks for a specific entry trigger within the M5 POI to execute the trade.
Detailed Breakdown
## Part 1: Inputs & Settings
This section allows you to customize the indicator's parameters:
General Settings:
i_pivotLookback: Sets the lookback period for identifying pivot highs and lows on the LTF, which is crucial for finding the Change of Character (CHoCH).
M15 Bias Settings:
i_m15EmaFast / i_m15EmaSlow: These two EMA (Exponential Moving Average) values on the 15-minute chart determine the main trend. A bullish trend is confirmed when the fast EMA is above the slow EMA, and vice-versa for a bearish trend.
M5 Point of Interest (POI) Settings:
i_showM5Fvg / i_showM5Ob: Toggles the visibility of Fair Value Gaps (FVG) and Order Blocks (OB) on the 5-minute chart. These are the zones where the script will look for trading opportunities.
i_maxPois: Limits the number of POI zones drawn on the chart to keep it clean.
LTF Entry Settings:
i_entryMode:
Confirmation: The script waits for a Change of Character (CHoCH) on the LTF (your current chart) after the price enters an M5 POI. A CHoCH is a break of a recent pivot high (for buys) or pivot low (for sells), suggesting a potential reversal. This is the safer entry method.
Aggressive: The script triggers an entry as soon as the price touches the 50% level of the M5 POI, without waiting for a CHoCH. This is higher risk but can provide a better entry price.
i_showChoch: Toggles the visibility of the CHoCH confirmation lines.
Trade Management Settings:
i_tpRatio: Sets the Risk-to-Reward Ratio (RRR) for the Take Profit target. For example, a value of 2.0 means the Take Profit distance will be twice the Stop Loss distance.
i_slMode: (New in V5.2) Provides four different methods to calculate the Stop Loss:
POI Zone (Default): Places the SL at the outer edge of the M5 POI zone.
Last Swing: Places the SL at the most recent LTF swing high/low before the entry.
ATR: Uses the Average True Range (ATR) indicator to set a volatility-based SL.
Previous Candle: Places the SL at the high or low of the candle immediately preceding the entry. This is the tightest and riskiest option.
i_maxHistory: Sets the number of past trades to display on the chart.
## Part 2: Data Types & Variables
This section defines custom data structures (type) to organize information:
Poi: A structure to hold all information related to a single Point of Interest, including its price boundaries, direction (bullish/bearish), and whether it has been mitigated (touched by price).
Trade: A structure to store details for each trade, such as its entry price, SL, TP, result (Win/Loss/Active), and chart objects for drawing.
## Part 3: Core Logic & Calculations
This is the engine of the indicator:
Data Fetching: It uses request.security to pull EMA data from the M15 timeframe and candle data (high, low, open, close) from the M5 timeframe.
POI Identification: The script constantly scans the M5 data for FVG and OB patterns. When a valid pattern is found that aligns with the M15 bias (e.g., a bullish OB during an M15 uptrend), it's stored as a Poi and drawn on the chart.
Entry Trigger:
It checks if the price on the LTF enters a valid (unmitigated) POI zone.
Based on the selected i_entryMode, it either waits for a CHoCH or enters aggressively.
Once an entry condition is met, it calculates the SL based on the i_slMode, calculates the TP using the i_tpRatio, and creates a new Trade.
Trade Monitoring: For every active trade, the script checks on each new bar if the price has hit the SL or TP level. When it does, the trade's result is updated, and the visual boxes are finalized.
## Part 5: On-Screen Display
This part creates the Performance Dashboard table shown on the top-right of the chart. It provides a real-time summary of:
M15 Bias: Current market direction.
Total Trades: The total number of completed trades from the history.
Win Rate: The percentage of winning trades.
Total R-Multiple: The cumulative Risk-to-Reward multiple (sum of RRR from wins minus losses). A positive value indicates overall profitability.
🇹🇭 คำอธิบายและข้อแนะนำภาษาไทย
สคริปต์นี้เป็น Indicator สำหรับกลยุทธ์การเทรดแบบ Smart Money Concepts (SMC) ที่ใช้การวิเคราะห์จากหลายกรอบเวลา (Multi-Timeframe) เพื่อหาจุดเข้าเทรดที่มีความเป็นไปได้สูง
หลักการทำงานของ Indicator มีดังนี้:
Timeframe ใหญ่ (HTF) - M15: ใช้กำหนดทิศทางหลักของตลาด หรือ "Bias"
Timeframe กลาง (MTF) - M5: ใช้หาโซนสำคัญ หรือ "Point of Interest (POI)" เช่น Order Blocks หรือ Fair Value Gaps ที่สอดคล้องกับทิศทางจาก M15
Timeframe เล็ก (LTF) - กราฟปัจจุบัน: ใช้หาสัญญาณยืนยันเพื่อเข้าเทรดในโซน POI ที่กำหนดไว้
รายละเอียดของโค้ด
## ส่วนที่ 1: การตั้งค่า (Inputs & Settings)
ส่วนนี้ให้คุณปรับแต่งค่าต่างๆ ของ Indicator ได้:
การตั้งค่าทั่วไป:
i_pivotLookback: กำหนดระยะเวลาที่ใช้มองหาจุดกลับตัว (Pivot) ใน Timeframe เล็ก (LTF) เพื่อใช้ยืนยันสัญญาณ Change of Character (CHoCH)
การตั้งค่า M15 (ทิศทางหลัก):
i_m15EmaFast / i_m15EmaSlow: ใช้เส้น EMA 2 เส้นบน Timeframe 15 นาที เพื่อกำหนดเทรนด์หลัก หาก EMA เร็วอยู่เหนือ EMA ช้า จะเป็นเทรนด์ขาขึ้น และในทางกลับกัน
การตั้งค่า M5 (จุดสนใจ - POI):
i_showM5Fvg / i_showM5Ob: เปิด/ปิด การแสดงโซน Fair Value Gaps (FVG) และ Order Blocks (OB) บน Timeframe 5 นาที ซึ่งเป็นโซนที่สคริปต์จะใช้หาโอกาสเข้าเทรด
i_maxPois: จำกัดจำนวนโซน POI ที่จะแสดงผลบนหน้าจอ เพื่อไม่ให้กราฟดูรกเกินไป
การตั้งค่า LTF (การเข้าเทรด):
i_entryMode:
ยืนยัน (Confirmation): เป็นโหมดที่ปลอดภัยกว่า โดยสคริปต์จะรอให้เกิดสัญญาณ Change of Character (CHoCH) ใน Timeframe เล็กก่อน หลังจากที่ราคาเข้ามาในโซน POI แล้ว
เชิงรุก (Aggressive): เป็นโหมดที่เสี่ยงกว่า โดยสคริปต์จะเข้าเทรดทันทีที่ราคาแตะระดับ 50% ของโซน POI โดยไม่รอสัญญาณยืนยัน CHoCH
i_showChoch: เปิด/ปิด การแสดงเส้น CHoCH บนกราฟ
การตั้งค่าการจัดการเทรด:
i_tpRatio: กำหนด อัตราส่วนกำไรต่อความเสี่ยง (Risk-to-Reward Ratio) เพื่อตั้งเป้าหมายทำกำไร (Take Profit) เช่น 2.0 หมายถึงระยะทำกำไรจะเป็น 2 เท่าของระยะตัดขาดทุน
i_slMode: (ฟีเจอร์ใหม่ V5.2) มี 4 รูปแบบในการคำนวณ Stop Loss:
โซน POI (ค่าเริ่มต้น): วาง SL ไว้ที่ขอบนอกสุดของโซน POI
Swing ล่าสุด: วาง SL ไว้ที่จุด Swing High/Low ล่าสุดของ Timeframe เล็ก (LTF) ก่อนเข้าเทรด
ATR: ใช้ค่า ATR (Average True Range) เพื่อกำหนด SL ตามระดับความผันผวนของราคา
แท่งเทียนก่อนหน้า: วาง SL ไว้ที่ราคา High/Low ของแท่งเทียนก่อนหน้าที่จะเข้าเทรด เป็นวิธีที่ SL แคบและเสี่ยงที่สุด
i_maxHistory: กำหนดจำนวนประวัติการเทรดที่จะแสดงย้อนหลังบนกราฟ
## ส่วนที่ 2: ประเภทข้อมูลและตัวแปร
ส่วนนี้เป็นการสร้างโครงสร้างข้อมูล (type) เพื่อจัดเก็บข้อมูลให้เป็นระบบ:
Poi: เก็บข้อมูลของโซน POI แต่ละโซน เช่น กรอบราคาบน-ล่าง, ทิศทาง (ขึ้น/ลง) และสถานะว่าถูกใช้งานไปแล้วหรือยัง (Mitigated)
Trade: เก็บรายละเอียดของแต่ละการเทรด เช่น ราคาเข้า, SL, TP, ผลลัพธ์ (Win/Loss/Active) และอ็อบเจกต์สำหรับวาดกล่องบนกราฟ
## ส่วนที่ 3: ตรรกะหลักและการคำนวณ
เป็นหัวใจสำคัญของ Indicator:
ดึงข้อมูลข้าม Timeframe: ใช้ฟังก์ชัน request.security เพื่อดึงข้อมูล EMA จาก M15 และข้อมูลแท่งเทียนจาก M5 มาใช้งาน
ระบุ POI: สคริปต์จะค้นหา FVG และ OB บน M5 ตลอดเวลา หากเจ้ารูปแบบที่สอดคล้องกับทิศทางหลักจาก M15 (เช่น เจอ Bullish OB ในขณะที่ M15 เป็นขาขึ้น) ก็จะวาดโซนนั้นไว้บนกราฟ
เงื่อนไขการเข้าเทรด:
เมื่อราคาใน Timeframe เล็ก (LTF) วิ่งเข้ามาในโซน POI ที่ยังไม่เคยถูกใช้งาน
สคริปต์จะรอสัญญาณตาม i_entryMode ที่เลือกไว้ (รอ CHoCH หรือเข้าแบบ Aggressive)
เมื่อเงื่อนไขครบ จะคำนวณ SL และ TP จากนั้นจึงบันทึกการเทรดใหม่
ติดตามการเทรด: สำหรับเทรดที่ยัง "Active" อยู่ สคริปต์จะคอยตรวจสอบทุกแท่งเทียนว่าราคาไปถึง SL หรือ TP แล้วหรือยัง เมื่อถึงจุดใดจุดหนึ่ง จะบันทึกผลและสิ้นสุดการวาดกล่องบนกราฟ
## ส่วนที่ 5: การแสดงผลบนหน้าจอ
ส่วนนี้จะสร้างตาราง "Performance Dashboard" ที่มุมขวาบนของกราฟ เพื่อสรุปผลการทำงานแบบ Real-time:
M15 Bias: แสดงทิศทางของตลาดในปัจจุบัน
Total Trades: จำนวนเทรดทั้งหมดที่เกิดขึ้นในประวัติ
Win Rate: อัตราชนะ คิดเป็นเปอร์เซ็นต์
Total R-Multiple: ผลตอบแทนรวมจากความเสี่ยง (R) ทั้งหมด (ผลรวม RRR ของเทรดที่ชนะ ลบด้วยจำนวนเทรดที่แพ้) หากเป็นบวกแสดงว่ามีกำไรโดยรวม
📋 ข้อแนะนำในการใช้งาน
Timeframe ที่เหมาะสม: Indicator นี้ถูกออกแบบมาให้ใช้กับ Timeframe เล็ก (LTF) เช่น M1, M3 หรือ M5 เนื่องจากมันดึงข้อมูลจาก M15 และ M5 มาเป็นหลักการอยู่แล้ว
สไตล์การเทรด:
Confirmation: เหมาะสำหรับผู้ที่ต้องการความปลอดภัยสูง รอการยืนยันก่อนเข้าเทรด อาจจะตกรถบ้าง แต่ลดความเสี่ยงจากการเข้าเทรดเร็วเกินไป
Aggressive: เหมาะสำหรับผู้ที่ยอมรับความเสี่ยงได้สูงขึ้น เพื่อให้ได้ราคาเข้าที่ดีที่สุด
การเลือก Stop Loss:
"Swing ล่าสุด" และ "โซน POI" เป็นวิธีมาตรฐานตามหลัก SMC
"ATR" เหมาะกับตลาดที่มีความผันผวนสูง เพราะ SL จะปรับตามสภาพตลาด
"แท่งเทียนก่อนหน้า" เป็นวิธีที่เสี่ยงที่สุด เหมาะกับการเทรดเร็วและต้องการ RRR สูงๆ แต่ก็มีโอกาสโดน SL ง่ายขึ้น
การบริหารความเสี่ยง: Indicator นี้เป็นเพียง เครื่องมือช่วยวิเคราะห์ ไม่ใช่สัญญาณซื้อขายอัตโนมัติ 100% ผู้ใช้ควรมีความเข้าใจในหลักการของ SMC และทำการบริหารความเสี่ยง (Risk Management) อย่างเคร่งครัดเสมอ
การทดสอบย้อนหลัง (Backtesting): ควรทำการทดสอบ Indicator กับสินทรัพย์และตั้งค่าต่างๆ เพื่อให้เข้าใจลักษณะการทำงานและประสิทธิภาพของมันก่อนนำไปใช้เทรดจริง
NEXGEN XNEXGEN X is a powerful multi-layered technical indicator developed by NexGen Trading Academy to give traders an edge by combining the strength of trend analysis (ADX) with the precision of momentum timing (MACD). This all-in-one tool is specially designed for those who want to identify strong trends and execute high-probability entries based on momentum shifts.
NEXGEN ADXNEXGEN ADX
NEXGEN ADX – Advanced Trend Strength & Directional Indicator
Purpose:
The NEXGEN ADX is a powerful trend analysis tool developed by NexGen Trading Academy to help traders identify the strength and direction of market trends with precision. Based on the Average Directional Index (ADX) along with +DI (Positive Directional Indicator) and –DI (Negative Directional Indicator), this custom indicator provides a reliable foundation for both trend-following strategies and trend reversal setups.
Wyckoff MAX Precision Signals (L+S)Updated wycoff indicator, this is to be used post 10AM PST
For SEED_ALEXDRAYM_SHORTINTEREST2:NQ and uses all of wycoff fundamentals into a bot
Multi-Timeframe S & R JACR# Multi-Timeframe Support & Resistance Indicator
## 🎯 Overview
The Multi-Timeframe Support & Resistance Indicator is a powerful technical analysis tool that displays support and resistance levels from up to 4 different timeframes simultaneously on your chart. This comprehensive indicator helps traders identify key price levels across multiple time horizons, providing a complete market structure analysis.
## 📊 Key Features
### ✨ **Multi-Timeframe Analysis**
- **4 Configurable Timeframes**: Analyze support and resistance levels from 4 different timeframes on a single chart
- **Default Settings**:
- Timeframe 1: 60 minutes (1H)
- Timeframe 2: 120 minutes (2H)
- Timeframe 3: 240 minutes (4H)
- Timeframe 4: 1 Day (1D)
- **Customizable**: Each timeframe can be adjusted to any desired interval
### 🎨 **Visual Customization**
- **Color-Coded Levels**: Each timeframe has its own color scheme for easy identification
- **Range Zones**: Optional support and resistance zones with customizable transparency
- **Dynamic Labels**: Timeframe identifiers automatically display next to each level
- **Clean Interface**: Professional styling with minimal chart clutter
### ⚙️ **Advanced Configuration**
- **Pivot Point Detection**: Customizable lookback and lookahead periods for precise level identification
- **Range Zones**: Adjustable percentage-based zones around key levels
- **Toggle Controls**: Enable/disable range zones for each timeframe independently
- **Extend Lines**: Support and resistance lines extend across the entire chart
## 🔧 Configuration Options
### **Support & Resistance Settings**
- **Support Look Back**: Number of bars to look back for pivot lows (default: 22)
- **Support Look Ahead**: Number of bars to look ahead for pivot lows (default: 26)
- **Resistance Look Back**: Number of bars to look back for pivot highs (default: 30)
- **Resistance Look Ahead**: Number of bars to look ahead for pivot highs (default: 27)
### **Individual Timeframe Settings**
For each of the 4 timeframes:
- **Timeframe Selection**: Choose any timeframe (minutes, hours, days, weeks, months)
- **Range Zones**: Enable/disable support and resistance zones
- **Support Range**: Percentage-based range around support levels (default: 0.25%)
- **Resistance Range**: Percentage-based range around resistance levels (default: 0.25%)
- **Color Customization**: Independent color settings for support and resistance levels
## 🎯 How It Works
The indicator uses pivot point analysis to identify significant support and resistance levels:
1. **Pivot Detection**: Identifies pivot highs and lows based on the configured lookback/lookahead periods
2. **Multi-Timeframe Analysis**: Requests data from each configured timeframe
3. **Level Tracking**: Maintains the most recent support and resistance levels for each timeframe
4. **Visual Display**: Draws lines, zones, and labels for all active levels
## 📈 Trading Applications
### **Trend Analysis**
- Identify key levels where price might reverse or consolidate
- Confirm trend strength by observing how price interacts with multi-timeframe levels
- Spot potential breakout opportunities
### **Entry and Exit Points**
- Use higher timeframe levels for strategic entries
- Lower timeframe levels for tactical entries and exits
- Confluence zones where multiple timeframe levels align
### **Risk Management**
- Place stop losses beyond key support/resistance levels
- Use range zones to account for price volatility around key levels
- Scale positions based on proximity to major levels
## 🔍 Best Practices
1. **Timeframe Selection**: Choose timeframes that align with your trading strategy
2. **Confluence Trading**: Look for areas where multiple timeframe levels converge
3. **Range Consideration**: Use percentage ranges to account for market volatility
4. **Clean Setup**: Toggle off unnecessary timeframes to avoid chart clutter
5. **Regular Updates**: Monitor how levels evolve as new pivot points form
## 📋 Technical Requirements
- **TradingView**: Compatible with TradingView's Pine Script v5
- **Chart Types**: Works on all chart types (candlestick, bar, line, etc.)
- **Instruments**: Compatible with all tradeable instruments (stocks, forex, crypto, commodities)
- **Timeframes**: Can be applied to any chart timeframe
## 🎨 Visual Elements
- **Solid Lines**: Main support and resistance levels
- **Shaded Zones**: Optional range areas around key levels
- **Labels**: Timeframe identifiers for easy reference
- **Color Coding**: Consistent green for support, red for resistance
- **Transparency**: Adjustable opacity for range zones
## 🚀 Performance Features
- **Efficient Processing**: Optimized for smooth chart performance
- **Memory Management**: Proper cleanup of drawing objects
- **Real-time Updates**: Levels update as new data becomes available
- **Scalable Design**: Works effectively on both small and large timeframes
This indicator is perfect for traders who want to incorporate multi-timeframe analysis into their trading strategy, providing a comprehensive view of market structure across different time horizons in a single, easy-to-use tool.
Auto YEAR High/Low with Fibonacci (MC) (Pub)This indicator automatically tracks and updates the current YEAR's HIGH and LOW levels in real-time. It calculates and plots key Fibonacci retracement and extension levels between the intra-year high and low, helping traders visualize potential reversal, breakout, and pullback zones.
✨ Key Features:
✅ Yearly High & Low Tracking
Real-time dynamic update of the current year's intra-year high and low levels.
Lines can extend left, right, both, or none, based on user preference.
📐 Fibonacci Level Plotting
Computes Fibonacci levels between yearly high and low.
Supports the following key retracement and extension levels:
88.6% Bear (Fib 11.4%)
78.6% Bear (Fib 23.6%)
61.8% Bear (Fib 38.2%)
50.0% Retracement
61.8% Bull
78.6% Bull
88.6% Bull
🧰 User Customization Options
Toggle visibility of each Fib level independently.
Selectable line extension behavior: left, right, both, or none.
Option to show/hide the high/low lines (with suggested enhancement).
Configurable line colors and styles for clarity.
🏷️ Informative Labels
Labels display price values for high, low, and each active Fibonacci level.
Positioned near the right of the chart for clear visibility.
Labels auto-refresh yearly for clean, uncluttered information.
🧠 Use Cases
Identify intra-year support/resistance zones.
Spot pullback or breakout points for entries and exits.
Enhance price action and confluence trading strategies
Auto MONTH High/Low with Fibonacci (MC) (Pub)This indicator automatically tracks and updates the current MONTH's HIGH and LOW levels in real-time. It calculates and plots key Fibonacci retracement and extension levels between the intra-month high and low, helping traders visualize potential reversal, breakout, and pullback zones.
✨ Key Features:
✅ Monthly High & Low Tracking
Real-time dynamic update of the current month's intra-month high and low levels.
Lines can extend left, right, both, or none, based on user preference.
📐 Fibonacci Level Plotting
Computes Fibonacci levels between monthly high and low.
Supports the following key retracement and extension levels:
88.6% Bear (Fib 11.4%)
78.6% Bear (Fib 23.6%)
61.8% Bear (Fib 38.2%)
50.0% Retracement
61.8% Bull
78.6% Bull
88.6% Bull
🧰 User Customization Options
Toggle visibility of each Fib level independently.
Selectable line extension behavior: left, right, both, or none.
Option to show/hide the high/low lines (with suggested enhancement).
Configurable line colors and styles for clarity.
🏷️ Informative Labels
Labels display price values for high, low, and each active Fibonacci level.
Positioned near the right of the chart for clear visibility.
Labels auto-refresh monthly for clean, uncluttered information.
🧠 Use Cases
Identify intramonth support/resistance zones.
Spot pullback or breakout points for entries and exits.
Enhance price action and confluence trading strategies
Auto WEEK High/Low with Fibonacci (MC) (Pub)This indicator automatically tracks and updates the current WEEK's HIGH and LOW levels in real-time. It calculates and plots key Fibonacci retracement and extension levels between the intra-week high and low, helping traders visualize potential reversal, breakout, and pullback zones.
✨ Key Features:
✅ Weekly High & Low Tracking
Real-time dynamic update of the current week's intra-week high and low levels.
Lines can extend left, right, both, or none, based on user preference.
📐 Fibonacci Level Plotting
Computes Fibonacci levels between weekly high and low.
Supports the following key retracement and extension levels:
88.6% Bear (Fib 11.4%)
78.6% Bear (Fib 23.6%)
61.8% Bear (Fib 38.2%)
50.0% Retracement
61.8% Bull
78.6% Bull
88.6% Bull
🧰 User Customization Options
Toggle visibility of each Fib level independently.
Selectable line extension behavior: left, right, both, or none.
Option to show/hide the high/low lines (with suggested enhancement).
Configurable line colors and styles for clarity.
🏷️ Informative Labels
Labels display price values for high, low, and each active Fibonacci level.
Positioned near the right of the chart for clear visibility.
Labels auto-refresh weekly for clean, uncluttered information.
🧠 Use Cases
Identify intra-week support/resistance zones.
Spot pullback or breakout points for entries and exits.
Enhance price action and confluence trading strategies
Auto DAY High/Low with Fibonacci Levels (MC) (Pub)This indicator automatically tracks and updates the current DAY's HIGH and LOW levels in real-time. It calculates and plots key Fibonacci retracement and extension levels between the intraday high and low, helping traders visualize potential reversal, breakout, and pullback zones.
✨ Key Features:
✅ Daily High & Low Tracking
Real-time dynamic update of the current day's intraday high and low levels.
Lines can extend left, right, both, or none, based on user preference.
📐 Fibonacci Level Plotting
Computes Fibonacci levels between daily high and low.
Supports the following key retracement and extension levels:
88.6% Bear (Fib 11.4%)
78.6% Bear (Fib 23.6%)
61.8% Bear (Fib 38.2%)
50.0% Retracement
61.8% Bull
78.6% Bull
88.6% Bull
🧰 User Customization Options
Toggle visibility of each Fib level independently.
Selectable line extension behavior: left, right, both, or none.
Option to show/hide the high/low lines (with suggested enhancement).
Configurable line colors and styles for clarity.
🏷️ Informative Labels
Labels display price values for high, low, and each active Fibonacci level.
Positioned near the right of the chart for clear visibility.
Labels auto-refresh daily for clean, uncluttered information.
🧠 Use Cases
Identify intraday support/resistance zones.
Spot pullback or breakout points for entries and exits.
Enhance price action and confluence trading strategies