Multi-MA + RSI Pullback Strategy (Jordan)1️⃣ Strategy logic I’ll code
From your screenshots:
Indicators
• EMAs: 600 / 200 / 100 / 50
• RSI: length 6, levels 80 / 20
Rules (simplified so a script can handle them):
• Use a higher-timeframe trend filter (15m or 1h) using the EMAs.
• Take entries on the chart timeframe (you can use 1m or 5m).
• Long:
• Higher-TF trend is up.
• Price is pulling back into a zone (between 50 EMA and 100 EMA on the entry timeframe – this approximates your 50–61% retrace).
• RSI crosses below 20 (oversold).
• Short:
• Higher-TF trend is down.
• Price pulls back between 50 & 100 EMAs.
• RSI crosses above 80 (overbought).
• Exits: ATR-based stop + take-profit with adjustable R:R (2:1 or 3:1).
• Max 4 trades per day.
News filter & “only trade gold” you handle manually (run it on XAUUSD and avoid news times yourself – TradingView can’t read the economic calendar from code).
Padrões gráficos
takeshi GPT//@version=5
indicator("猛の掟・初動スクリーナーGPT", overlay = true, timeframe = "", timeframe_gaps = true)
// ======================================================
// ■ 1. パラメータ設定
// ======================================================
// EMA長
emaFastLen = input.int(5, "短期EMA (5)", minval = 1)
emaMidLen = input.int(13, "中期EMA (13)", minval = 1)
emaSlowLen = input.int(26, "長期EMA (26)", minval = 1)
// 出来高
volMaLen = input.int(5, "出来高平均期間", minval = 1)
volMultInitial = input.float(1.3, "出来高 初動ライン (×)", minval = 1.0, step = 0.1)
volMultStrong = input.float(1.5, "出来高 本物ライン (×)", minval = 1.0, step = 0.1)
// 押し目・レジスタンス
pullbackLookback = input.int(20, "直近高値の探索期間", minval = 5)
pullbackMinPct = input.float(5.0, "押し目下限 (%)", minval = 0.0, step = 0.1)
pullbackMaxPct = input.float(15.0, "押し目上限 (%)", minval = 0.0, step = 0.1)
// ピンバー判定パラメータ
pinbarWickRatio = input.float(2.0, "ピンバー下ヒゲ/実体 比率", minval = 1.0, step = 0.5)
pinbarMaxUpperPct = input.float(25.0, "ピンバー上ヒゲ比率上限 (%)", minval = 0.0, step = 1.0)
// 大陽線判定
bigBodyPct = input.float(2.0, "大陽線の最低値幅 (%)", minval = 0.1, step = 0.1)
// ======================================================
// ■ 2. 基本テクニカル計算
// ======================================================
emaFast = ta.ema(close, emaFastLen)
emaMid = ta.ema(close, emaMidLen)
emaSlow = ta.ema(close, emaSlowLen)
// MACD
= ta.macd(close, 12, 26, 9)
// 出来高
volMa = ta.sma(volume, volMaLen)
// 直近高値(押し目判定用)
recentHigh = ta.highest(high, pullbackLookback)
drawdownPct = (recentHigh > 0) ? (recentHigh - close) / recentHigh * 100.0 : na
// ======================================================
// ■ 3. A:トレンド(初動)条件
// ======================================================
// 1. 5EMA↑ 13EMA↑ 26EMA↑
emaUpFast = emaFast > emaFast
emaUpMid = emaMid > emaMid
emaUpSlow = emaSlow > emaSlow
condTrendUp = emaUpFast and emaUpMid and emaUpSlow
// 2. 黄金並び 5EMA > 13EMA > 26EMA
condGolden = emaFast > emaMid and emaMid > emaSlow
// 3. ローソク足が 26EMA 上に2日定着
condAboveSlow2 = close > emaSlow and close > emaSlow
// ======================================================
// ■ 4. B:モメンタム(MACD)条件
// ======================================================
// ヒストグラム縮小+上向き
histShrinkingUp = (math.abs(histLine) < math.abs(histLine )) and (histLine > histLine )
// ゼロライン直下〜直上での上向き
nearZeroRange = 0.5 // ゼロライン±0.5
macdNearZero = math.abs(macdLine) <= nearZeroRange
// MACDが上向き
macdTurningUp = macdLine > macdLine
// MACDゼロライン上でゴールデンクロス
macdZeroCrossUp = macdLine > signalLine and macdLine <= signalLine and macdLine > 0
// B条件:すべて
condMACD = histShrinkingUp and macdNearZero and macdTurningUp and macdZeroCrossUp
// ======================================================
// ■ 5. C:需給(出来高)条件
// ======================================================
condVolInitial = volume > volMa * volMultInitial // 1.3倍〜 初動点灯
condVolStrong = volume > volMa * volMultStrong // 1.5倍〜 本物初動
condVolume = condVolInitial // 「8掟」では1.3倍以上で合格
// ======================================================
// ■ 6. D:ローソク足パターン
// ======================================================
body = math.abs(close - open)
upperWick = high - math.max(close, open)
lowerWick = math.min(close, open) - low
rangeAll = high - low
// 安全対策:0除算回避
rangeAllSafe = rangeAll == 0.0 ? 0.0000001 : rangeAll
bodyPct = body / close * 100.0
// ● 長い下ヒゲ(ピンバー)
lowerToBodyRatio = (body > 0) ? lowerWick / body : 0.0
upperPct = upperWick / rangeAllSafe * 100.0
isBullPinbar = lowerToBodyRatio >= pinbarWickRatio and upperPct <= pinbarMaxUpperPct and close > open
// ● 陽線包み足(bullish engulfing)
prevBearish = close < open
isEngulfingBull = close > open and prevBearish and close >= open and open <= close
// ● 5EMA・13EMAを貫く大陽線
crossFast = open < emaFast and close > emaFast
crossMid = open < emaMid and close > emaMid
isBigBody = bodyPct >= bigBodyPct
isBigBull = close > open and (crossFast or crossMid) and isBigBody
// D条件:どれか1つでOK
condCandle = isBullPinbar or isEngulfingBull or isBigBull
// ======================================================
// ■ 7. E:価格帯(押し目位置 & レジスタンスブレイク)
// ======================================================
// 7. 押し目 -5〜15%
condPullback = drawdownPct >= pullbackMinPct and drawdownPct <= pullbackMaxPct
// 8. レジスタンス突破 → 押し目 → 再上昇
// 直近 pullbackLookback 本の高値をレジスタンスとみなす(現在足除く)
resistance = ta.highest(close , pullbackLookback)
// レジスタンスブレイクが起きたバーからの経過本数
brokeAbove = ta.barssince(close > resistance)
// ブレイク後に一度レジ上まで戻したか
pulledBack = brokeAbove != na ? ta.lowest(low, brokeAbove + 1) < resistance : false
// 現在は再上昇方向か
reRising = close > close
condBreakPull = (brokeAbove != na) and (brokeAbove <= pullbackLookback) and pulledBack and reRising
// ======================================================
// ■ 8. 最終 8条件 & 三点シグナル
// ======================================================
// 8つの掟
condA = condTrendUp and condGolden and condAboveSlow2
condB = condMACD
condC = condVolume
condD = condCandle
condE = condPullback and condBreakPull
all_conditions = condA and condB and condC and condD and condE
// 🟩 最終三点シグナル
// 1. 長い下ヒゲ 2. MACDゼロライン上GC 3. 出来高1.5倍以上
threePoint = isBullPinbar and macdZeroCrossUp and condVolStrong
// 「買い確定」= 8条件すべて + 三点シグナル
buy_confirmed = all_conditions and threePoint
// ======================================================
// ■ 9. チャート表示 & スクリーナー用出力
// ======================================================
// EMA表示
plot(emaFast, color = color.orange, title = "EMA 5")
plot(emaMid, color = color.new(color.blue, 10), title = "EMA 13")
plot(emaSlow, color = color.new(color.green, 20), title = "EMA 26")
// 初動シグナル
plotshape(
all_conditions and not buy_confirmed,
title = "初動シグナル(掟8条件クリア)",
style = shape.labelup,
color = color.new(color.yellow, 0),
text = "初動",
location = location.belowbar,
size = size.small)
// 三点フルシグナル(買い確定)
plotshape(
buy_confirmed,
title = "三点フルシグナル(買い確定)",
style = shape.labelup,
color = color.new(color.lime, 0),
text = "買い",
location = location.belowbar,
size = size.large)
// スクリーナー用 series 出力(非表示)
plot(all_conditions ? 1 : 0, title = "all_conditions (8掟クリア)", display = display.none)
plot(buy_confirmed ? 1 : 0, title = "buy_confirmed (三点+8掟)", display = display.none)
True Gap Finder with Revisit DetectionTrue Gap Finder with Revisit Detection
This indicator is a powerful tool for intraday traders to identify and track price gaps. Unlike simple gap indicators, this script actively tracks the status of the gap, visualizing the void until it is filled (revisited) by price.
Key Features:
Active Gap Tracking: Finds gap-up and gap-down occurrences (where Low > Previous High or High < Previous Low) and actively tracks them.
Gap Zones (Clouds): Visually shades the empty "gap zone" (the void between the gap candles), making it instantly obvious where price needs to travel to fill the gap. The cloud disappears automatically once the gap is filled.
Dynamic Labels: automatically displays price labels at the origin of the gap, showing the specific price range (High-Low) that constitutes the gap. Labels are positioned intelligently to avoid cluttering current price action.
Alerts: Configurable alerts notify you the moment a gap is filled.
Customization: Full control over colors, clouds, labels, and alert settings to match your chart style.
How it works: The indicator tracks the most recent gap. If a new gap forms, it becomes the active focus. When price moves back to "close" or "fill" this gap area, the lines and clouds automatically stop plotting, giving you a clean chart that focuses only on open business.
Strategia S&P 500 vs US10Y Yield (od 2000)This strategy explores the macroeconomic relationship between the equity market (S&P 500) and the debt market (10-Year Treasury Yield). Historically, rapid spikes in bond yields often exert downward pressure on equity valuations, leading to corrections or bear markets.
The goal of this strategy is capital preservation. It attempts to switch to cash when yields are rising too aggressively and re-enter the stock market when the bond market stabilizes.
IDLP – Intraday Daily Levels Pro [FXSMARTLAB]🔥 IDLP – Intraday Daily Levels Pro
IDLP – Intraday Daily Levels Pro is a precision toolkit for intraday traders who rely on objective daily structure instead of repainting indicators and noisy signals.
Every level plotted by IDLP is derived from one simple rule:
Today’s trading decisions must be based on completed market data only.
That means:
✅ No use of the current day’s unfinished data for levels
✅ No lookahead
✅ No hidden repaint behavior
IDLP reconstructs the previous trading day from the intraday chart and then projects that structure forward onto the current session, giving you a stable, institutional-style intraday map.
🧱 1. Previous Daily Levels (Core Structure)
IDLP extracts and displays the full previous daily structure, which you can toggle on/off individually via the inputs:
Previous Daily High (PDH)
Previous Daily Low (PDL)
Previous Daily Open
Previous Daily Close,
Previous Daily Mid (50% of the range)
Previous Daily Q1 (25% of the range)
Previous Daily Q3 (75% of the range)
All of these come from the day that just closed and are then locked for the entire current session.
What these levels tell you:
PDH / PDL – true extremes of yesterday’s price action (liquidity zones, breakout/reversal points).
Previous Daily Open / Close – how the market positioned itself between session start and end
Mid (50%) – equilibrium level of the previous day’s auction.
Q1 / Q3 (25% / 75%) internal structure of the previous day’s range, dividing it into four equal zones and helping you see if price is trading in the lower, middle, or upper quarter of yesterday’s range.
All these levels are non-repaint: once the day is completed, they are fixed and never change when you scroll, replay, or backtest.
🎯 2. Previous Day Pivot System (P, S1, S2, R1, R2)
IDLP includes a classic floor-trader pivot grid, but critically:
It is calculated only from the previous day’s high, low, and close.
So for the current session, the following are fixed:
Pivot P – central reference level of the previous day.
Support 1 (S1) and Support 2 (S2)
Resistance 1 (R1) and Resistance 2 (R2)
These levels are widely used by institutional desks and algos to structure:
mean-reversion plays, breakout zones, intraday targets, and risk placement.
Everything in this section is non-repaint because it only uses the previous day’s fully closed OHLC.
📏 3. 1-Day ADR Bands Around Previous Daily Open
Instead of a multi-day ADR, IDLP uses a pure 1-Day ADR logic:
ADR = Range of the previous day
ADR = PDH − PDL
From that, IDLP builds two clean bands centered around the previous daily Open:
ADR Upper Band = Previous Day Open + (ADR × Multiplier)
ADR Lower Band = Previous Day Open − (ADR × Multiplier)
The multiplier is user-controlled in the inputs:
ADR Multiplier (default: 0.8)
This lets you choose how “tight” or “wide” you want the ADR envelope to be around the previous day’s open.
Typical use cases:
Identify realistic intraday extension targets, Spot exhaustion moves beyond ADR bands, Frame reversals after reaching volatility extremes, Align trades with or against volatility expansion
Again, since ADR is calculated only from the completed previous day, these bands are totally non-repaint during the current session.
🔒 4. True Non-Repaint Architecture
The internal logic of IDLP is built to guarantee non-repaint behavior:
It reconstructs each day using time("D") and tracks:
dayOpen, dayHigh, dayLow, dayClose for the current day
prevDayOpen, prevDayHigh, prevDayLow, prevDayClose for the previous day
At the moment a new day starts:
The “current day” gets “frozen” into prevDay*
These prevDay* values then drive: Previous Daily Levels, Pivots, ADR.
During the current day:
All these “previous day” values stay fixed, no matter what happens.
They do not move in real time, they do not shift in replay.
This means:
What you see in the past is exactly what you would have seen live.
No fake backtests.
No illusion of perfection from repainting behavior.
🎯 5. Designed For Intraday Traders
IDLP – Intraday Daily Levels Pro is made for:
- Day traders and scalpers
- Index and FX traders
- Prop firm challenge trading
- Traders using ICT/SMC-style levels, liquidity, and range logic
- Anyone who wants a clean, institutional-style daily framework without noise
You get:
Previous Day OHLC
Mid / Q1 / Q3 of the previous range
Previous-Day Pivots (P, S1, S2, R1, R2)
1-Day ADR Bands around Previous Day Open
All calculated only from closed data, updated once per day, and then locked.
Fanfans结构+极简合并增强版V2
中文:该指标整合Fanfans结构、高斯GWMA、动态摆动VWAP、MACD及极简交易信号,内置结构/GWMA/VWAP/EMA多维度过滤、成交量确认、动态ATR等优化功能。支持多空信号标注、止损止盈分层设置、信号质量评分,搭配图表信息面板与多级别警报共振机制,适用于1分钟等短周期交易,兼顾信号灵敏度与准确性。
English: This indicator integrates Fanfans structure, Gaussian GWMA, dynamic swing VWAP, MACD, and simple trading signals. It features multi-dimensional filters (structure/GWMA/VWAP/EMA), volume confirmation, dynamic ATR optimization. Supporting long/short signal labeling, layered SL/TP settings, signal quality scoring, it comes with a chart info panel and multi-level alert resonance. Suitable for short-term trading (e.g., 1-minute timeframe), balancing signal sensitivity and accuracy.
RSI 40-60 Range (30 Bars)RSI 40-60 Range (30 Bars) test for pine screenner for detec rsi 40-60 during 30 days
Qullamaggie 3★ / 4★ / 5★ Setup Detector (Clean, Colored Labels)Qullamaggie 3★ / 4★ / 5★ Setup Detector (Clean, Colored Labels)-Thaha
Stage 2 Pullback Swing indicatorThis scanner is built for swing traders who want high-probability pullbacks inside strong, established uptrends. It targets names in a confirmed Stage 2 bull phase (Weinstein model) that have pulled back 10–30% from a recent swing high on light selling volume, while still respecting fast EMAs.
Goal: find powerful uptrending stocks during controlled dips before the next leg higher.
What it looks for
Strong prior uptrend: price above the 50 and 200 SMAs, momentum positive over multiple timeframes
Confirmed Stage 2: price above a rising 30-week MA on the weekly chart
Pullback depth: 10–30% off recent swing highs—not too shallow, not broken
Pullback quality: range contained, no panic selling, trend structure intact
EMA behavior: price near EMA10 or EMA20 at signal time
Volume contraction: sellers fading throughout the pullback
Bullish shift: green candle back in trend direction
Why this matters
This setup hints at institutions defending positions during a temporary dip. Strong stocks pull back cleanly with declining volume, then resume the primary trend. This script alerts you when those conditions align.
Best way to use
Filter a strong universe before applying—quality tickers only
Pair with clear trade plans: risk defined by prior swing low or ATR
Trigger alerts instead of hunting charts manually
Intended for
Swing traders who want momentum continuation setups
Traders who prefer entering on controlled retracements
Anyone tired of chasing extended breakouts
abrun logic
A combination of MACD, Parabolic SAR, and volume, a buy signal will appear if 3 of the 5 conditions are met: MACD Golden Cross, Parabolic SAR, and above-average volume.
Linechart + Wicks - by SupersonicFXThis is a simple indicator that shows the highs and lows (wicks) on the linechart.
You can vary the colors.
Nothing more to say.
Hope some of you find it useful.
Fanfans结构加强vwap版 + 极简系统### 中英文双语总结(300字内)
中文:该指标整合Fanfans结构、动态摆动VWAP、高斯GWMA、MACD及极简交易系统,支持趋势过滤(可选GWMA/VWAP/结构维度)、多离场模式(ATR止盈止损/GWMA离场/混合)与移动止损。具备多空信号标注、止损止盈线绘制、多维度共振警报,图表信息面板实时展示结构/VWAP/GWMA/MACD状态,可自定义过滤规则、显示样式及交易参数,适配短周期交易,兼顾趋势判断与信号执行的灵活性。
English: This indicator integrates Fanfans structure, dynamic swing VWAP, Gaussian GWMA, MACD and a simple trading system. It supports trend filtering (GWMA/VWAP/structure optional), multiple exit modes (ATR SL/TP, GWMA exit, hybrid) and trailing stop. Featuring long/short signal labeling, SL/TP line drawing, multi-dimensional resonance alerts, its chart info panel displays real-time status of structure/VWAP/GWMA/MACD. Customizable filter rules, display styles and trading parameters make it suitable for short-term trading, balancing trend judgment and signal execution flexibility.
ONH / ONL Auto LevelsThis script automatically detects and plots the Overnight High (ONH) and Overnight Low (ONL) for each trading day.
It scans the entire overnight/Globex session (default: 18:00–09:30 EST for ES futures) and records the highest and lowest prices formed during that period.
At the start of the regular trading session (RTH), ONH and ONL levels remain on the chart as key liquidity zones.
These levels are commonly used for:
• Identifying liquidity sweeps
• Opening drive reversals
• Break-and-retest setups
• VWAP + ON levels confluence
• Scalping on 1m–5m charts
The script updates automatically every day and draws clean, minimal levels suitable for intraday traders.
Time settings can be adjusted to match any market or instrument.
True vs False Breakout (Vol + Body Shape) **Indicator Description: True vs. False Breakout Detector**
This indicator helps identify the quality of a breakout by analyzing price action and volume.
**★ Green Arrow: "True Breakout (Strong Candle)"**
This represents a high-confidence breakout signal.
* **Criteria:** Price Breakout + Volume Surge + Strong Candle Close (minimal to no upper wick).
* **Significance:** Indicates strong bullish momentum.
**● Grey Dot: "Weak Breakout"**
Appears when price breaks resistance but shows signs of weakness.
* **Criteria:** Breakout with low volume OR a long upper wick (rejection).
* **Meaning:** "Price made a new high, but the move is untrustworthy."
* **Action:** Do not chase the long position. Be cautious and look for potential reversals.
**▼ Red Label: "False Breakout (Reversal)"**
* **Signal:** Appears when a Weak Breakout (Grey Dot) is followed by bearish price action.
* **Action:** This indicates a confirmed False Breakout and presents a prime shorting opportunity.
-------------------------------------------------------------------------------------------
★指标描述:真假突破辨别。
★绿色箭头 "真突破 (强K线)":
这是你要的完美信号。
它意味着:价格破位 + 成交量放大 + K线收盘坚决(几乎没有上影线)。
对应刚才的行情: 刚才那根1H大阳线应该会触发这个信号。
灰色圆点 "弱势突破" (新增):
如果价格突破了阻力,但是没量,或者留了长上影线(像你之前描述的那几根15分钟线),指标会标记灰色圆点。
含义: “虽然价格破了新高,但我不信任它”。这时候千万不要追多,反而要准备做空。
红色标签 "假突破 (反转)":
当灰色圆点(弱势突破)出现后,紧接着出现红色标签,就是绝佳的做空点。
Cup & Handle Finder by Mashrab🚀 New Tool Alert: The "Perfect Cup" Finder
Hey everyone! I’ve built a custom indicator to help us find high-quality Cup & Handle setups before they breakout.
Most scripts just look for random highs and lows, but this one uses a geometric algorithm to ensure the base is actually round (avoiding those messy V-shapes).
How it works:
🔵 Blue Arc: This marks a verified, institutional-quality Cup.
🟠 Orange Box: This is the "Handle Zone." If you see this connecting to the current candle, it means the setup is live and ready for a potential entry!
Best Usage:
Works best on Weekly (1W) charts.
It’s designed to be an "Early Warning" system—alerting you while the handle is still forming so you don't miss the move.
Give it a try and let me know what you find! 📉📈
RRE ZonesLine Creation: Each FVG box now has a corresponding dashed line drawn through its center:
Uses a dashed style for clear visibility
Matches the FVG color (with 30% transparency)
Extends to the right like the box
Width of 1 pixel
Synchronized Cleanup: When FVG boxes are removed (either by reaching max count or being filled by price), their corresponding center lines are also deleted automatically.
The center lines help you:
Quickly identify the 50% level of each FVG
Use it as a potential target or entry level
Better visualize the gap's midpoint for trading decisions
BALA'S Indicator - Dynamic + 5-Min + Pre-Market LevelsINTRADAY Strategy on Nifty with 15min Candle Setup.
takeshi_2Step_Screener_MOU_KAKU_FIXED3//@version=5
indicator("MNO_2Step_Screener_MOU_KAKU_FIXED3", overlay=true, max_labels_count=500)
// =========================
// Inputs
// =========================
emaSLen = input.int(5, "EMA Short (5)")
emaMLen = input.int(13, "EMA Mid (13)")
emaLLen = input.int(26, "EMA Long (26)")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
macdZeroTh = input.float(0.2, "MOU: MACD near-zero threshold", step=0.05)
volLookback = input.int(5, "Volume MA days", minval=1)
volMinRatio = input.float(1.3, "MOU: Volume ratio min", step=0.1)
volStrong = input.float(1.5, "Strong volume ratio (Breakout/KAKU)", step=0.1)
volMaxRatio = input.float(3.0, "Volume ratio max (filter)", step=0.1)
wickBodyMult = input.float(2.0, "Pinbar: lowerWick >= body*x", step=0.1)
pivotLen = input.int(20, "Resistance lookback", minval=5)
pullMinPct = input.float(5.0, "Pullback min (%)", step=0.1)
pullMaxPct = input.float(15.0, "Pullback max (%)", step=0.1)
breakLookbackBars = input.int(5, "Pullback route: valid bars after break", minval=1)
// --- Breakout route (押し目なし初動ブレイク) ---
useBreakoutRoute = input.bool(true, "Enable MOU Breakout Route (no pullback)")
breakConfirmPct = input.float(0.3, "Break confirm: close > R*(1+%)", step=0.1)
bigBodyLookback = input.int(20, "Break candle body MA length", minval=5)
bigBodyMult = input.float(1.2, "Break candle: body >= MA*mult", step=0.1)
requireCloseNearHigh = input.bool(true, "Break candle: close near high")
closeNearHighPct = input.float(25.0, "Close near high threshold (% of range)", step=1.0)
allowMACDAboveZeroInstead = input.bool(true, "Breakout route: allow MACD GC above zero instead")
// 表示
showEMA = input.bool(true, "Plot EMAs")
showMou = input.bool(true, "Show MOU label")
showKaku = input.bool(true, "Show KAKU label")
showDebugTbl = input.bool(false, "Show debug table (last bar)")
locChoice = input.string("Below Bar", "Label location", options= )
lblLoc = locChoice == "Below Bar" ? location.belowbar : location.abovebar
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
// plot は if の中に入れない(naで制御)
plot(showEMA ? emaS : na, color=color.new(color.yellow, 0), title="EMA 5")
plot(showEMA ? emaM : na, color=color.new(color.blue, 0), title="EMA 13")
plot(showEMA ? emaL : na, color=color.new(color.orange, 0), title="EMA 26")
emaUpS = emaS > emaS
emaUpM = emaM > emaM
emaUpL = emaL > emaL
goldenOrder = emaS > emaM and emaM > emaL
above26_2days = close > emaL and close > emaL
// 勝率維持の土台(緩めない)
baseTrendOK = (emaUpS and emaUpM and emaUpL) and goldenOrder and above26_2days
// =========================
// MACD
// =========================
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdGC = ta.crossover(macdLine, macdSig)
macdUp = macdLine > macdLine
macdNearZero = math.abs(macdLine) <= macdZeroTh
macdGCAboveZero = macdGC and macdLine > 0 and macdSig > 0
macdMouOK = macdGC and macdNearZero and macdUp
macdBreakOK = allowMACDAboveZeroInstead ? (macdMouOK or macdGCAboveZero) : macdMouOK
// =========================
// Volume
// =========================
volMA = ta.sma(volume, volLookback)
volRatio = volMA > 0 ? (volume / volMA) : na
volumeMouOK = volRatio >= volMinRatio and volRatio <= volMaxRatio
volumeStrongOK = volRatio >= volStrong and volRatio <= volMaxRatio
// =========================
// Candle patterns
// =========================
body = math.abs(close - open)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
pinbar = (lowerWick >= wickBodyMult * body) and (lowerWick > upperWick) and (close >= open)
bullEngulf =
close > open and close < open and
close >= open and open <= close
bigBull =
close > open and
open < emaM and close > emaS and
(body > ta.sma(body, 20))
candleOK = pinbar or bullEngulf or bigBull
// =========================
// Resistance / Pullback route
// =========================
res = ta.highest(high, pivotLen)
pullbackPct = res > 0 ? (res - close) / res * 100.0 : na
pullbackOK = pullbackPct >= pullMinPct and pullbackPct <= pullMaxPct
brokeRes = ta.crossover(close, res )
barsSinceBreak = ta.barssince(brokeRes)
afterBreakZone = (barsSinceBreak >= 0) and (barsSinceBreak <= breakLookbackBars)
pullbackRouteOK = afterBreakZone and pullbackOK
// =========================
// Breakout route (押し目なし初動ブレイク)
// =========================
breakConfirm = close > res * (1.0 + breakConfirmPct / 100.0)
bullBreak = close > open
bodyMA = ta.sma(body, bigBodyLookback)
bigBodyOK = bodyMA > 0 ? (body >= bodyMA * bigBodyMult) : false
rng = math.max(high - low, syminfo.mintick)
closeNearHighOK = not requireCloseNearHigh ? true : ((high - close) / rng * 100.0 <= closeNearHighPct)
mou_breakout =
useBreakoutRoute and
baseTrendOK and
breakConfirm and
bullBreak and
bigBodyOK and
closeNearHighOK and
volumeStrongOK and
macdBreakOK
mou_pullback = baseTrendOK and volumeMouOK and candleOK and macdMouOK and pullbackRouteOK
mou = mou_pullback or mou_breakout
// =========================
// KAKU (Strict): 8条件 + 最終三点
// =========================
cond1 = emaUpS and emaUpM and emaUpL
cond2 = goldenOrder
cond3 = above26_2days
cond4 = macdGCAboveZero
cond5 = volumeMouOK
cond6 = candleOK
cond7 = pullbackOK
cond8 = pullbackRouteOK
all8_strict = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8
final3 = pinbar and macdGCAboveZero and volumeStrongOK
kaku = all8_strict and final3
// =========================
// Display (統一ラベル)
// =========================
showKakuNow = showKaku and kaku
showMouPull = showMou and mou_pullback and not kaku
showMouBrk = showMou and mou_breakout and not kaku
plotshape(showMouPull, title="MOU_PULLBACK", style=shape.labelup, text="猛",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showMouBrk, title="MOU_BREAKOUT", style=shape.labelup, text="猛B",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showKakuNow, title="KAKU", style=shape.labelup, text="確",
color=color.new(color.yellow, 0), textcolor=color.black, location=lblLoc, size=size.small)
// =========================
// Alerts
// =========================
alertcondition(mou, title="MNO_MOU", message="MNO: MOU triggered")
alertcondition(mou_breakout, title="MNO_MOU_BREAKOUT", message="MNO: MOU Breakout triggered")
alertcondition(mou_pullback, title="MNO_MOU_PULLBACK", message="MNO: MOU Pullback triggered")
alertcondition(kaku, title="MNO_KAKU", message="MNO: KAKU triggered")
// =========================
// Debug table (optional)
// =========================
var table t = table.new(position.top_right, 2, 14, border_width=1, border_color=color.new(color.white, 60))
fRow(_name, _cond, _r) =>
bg = _cond ? color.new(color.lime, 70) : color.new(color.red, 80)
tx = _cond ? "OK" : "NO"
table.cell(t, 0, _r, _name, text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, _r, tx, text_color=color.white, bgcolor=bg)
if showDebugTbl and barstate.islast
// ❗ colspanは使えないので2セルでヘッダーを作る
table.cell(t, 0, 0, "MNO Debug", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, 0, "", text_color=color.white, bgcolor=color.new(color.black, 0))
fRow("BaseTrend", baseTrendOK, 1)
fRow("MOU Pullback", mou_pullback, 2)
fRow("MOU Breakout", mou_breakout, 3)
fRow("Break confirm", breakConfirm, 4)
fRow("Break big body", bigBodyOK, 5)
fRow("Break close high", closeNearHighOK, 6)
fRow("Break vol strong", volumeStrongOK, 7)
fRow("Break MACD", macdBreakOK, 8)
fRow("KAKU all8", all8_strict, 9)
fRow("KAKU final3", final3, 10)
fRow("MOU any", mou, 11)
fRow("KAKU", kaku, 12)
Thursday highlight//@version=5
indicator("Thursday highlight", overlay=true)
bgcolor(dayofweek==dayofweek.thursday ? color.new(color.blue,90):na)






















