Corak carta
ORB Strategy: Extensions & Custom SL (EOD & Live Lines)That's a great request. Since you've now built a complex Pine Script Strategy with several user-configurable risk management, targeting, and exit options, the description should focus on the systematic rules used for entering, managing, and exiting trades.
Here is a clear, written description of the trading strategy you have built:
Trading Strategy Description: ORB Extension Breakout with Custom Stop, Live Tracking, and EOD Exit
This strategy is a systematic, momentum-based system designed for intraday trading. It operates on the principle of an Opening Range Breakout (ORB), utilizing the initial market consolidation to project high-probability targets, while offering multiple methods for managing risk and enforcing a mandatory end-of-day closure.
1. Market Identification (The Opening Range)
The strategy first defines the market's initial boundaries and volatility:
Session Window: The strategy calculates the Opening Range (OR) over a user-defined time period (default: 9:30 AM to 10:30 AM New York Time).
ORB Levels: Two key price levels are established and locked once the time window closes:
Wick High/Low: The absolute highest and lowest prices of the session. These serve as the entry trigger lines.
Body High/Low (Shaded Range): The highest and lowest open/close prices of the session. The height of this range is used as the basis for calculating all targets and stops.
2. Entry Rule (The Breakout)
The strategy waits passively for a breakout that confirms direction and ensures the move has not yet reached its immediate target.
Trigger Condition: A trade is signaled when a candle closes either:
Above the Wick High (for a Long entry).
Below the Wick Low (for a Short entry).
Constraint (Fresh Breakout): The entry is invalidated if the breakout candle's price action (High for Long, Low for Short) has already touched or surpassed the projected Take Profit (0.5 Extension) level before the candle closes.
Execution: The entry is a Market Order executed on the candle that meets the trigger conditions, subject to a user-defined Entry Delay (default 0 bars).
Direction Control: The user can select to trade Long Only, Short Only, or Both.
3. Exit and Risk Management
All trades are placed with simultaneous Take Profit and Stop Loss orders (a bracket order) upon entry.
A. Take Profit (TP)
The Take Profit is set at the 0.5 Extension of the Shaded Range (Body Range).
Calculation: The distance from the Body High/Low to the TP level is exactly 50% of the total height of the Shaded Range.
B. Stop Loss (SL)
The Stop Loss is dynamically calculated based on a user-selected method for risk control:
Range 0.5 (Body Range): The SL is placed an equal distance (0.5 times the Body Range height) outside the opposite side of the Body Range.
ATR Multiple: The Stop Loss distance is calculated as a user-defined Multiplier times the Average True Range (ATR).
Recent Swing Low/High: The Stop Loss is placed based on a structural low (for Long) or high (for Short) within a user-defined lookback period.
C. End-of-Day (EOD) Exit
Any open position is forced closed at the market price if it is still open when the user-defined closing time (default: 16:00 HHMM) is reached. This prevents carrying intraday risk overnight.
4. Visualization
The strategy includes comprehensive visual cues for analysis:
ORB Drawing: Displays the Wick High/Low and the shaded Body Range.
Breakout Signals: Highlights the specific bar where the validated entry signal occurs.
Closed Trades: Draws persistent lines for the Entry and Exit prices of the last few closed trades.
Live Open Trades: Draws persistent lines for the current Entry Price, active Take Profit Level, and active Stop Loss Level for any open position.
DR/IDR Break .5 TPDR/IDR Extension Breakout with Custom Stop
This strategy is a systematic, counter-trend, and momentum-based system designed for intraday trading. It operates on the principle of an Opening Range Breakout (ORB), utilizing the initial market consolidation to project high-probability targets, while offering multiple methods for managing risk.
1. Market Identification (The Opening Range)
The strategy begins by defining the market's initial boundaries and volatility:
Session Window: The strategy calculates the Opening Range (OR) over a user-defined time period (default: 9:30 AM to 10:30 AM New York Time).
ORB Levels: Two key price levels are established and locked once the time window closes:
Wick High/Low: The absolute highest and lowest prices of the session. These serve as the entry trigger lines.
Body High/Low (Shaded Range): The highest and lowest open/close prices of the session. The height of this range is used to calculate the Take Profit and Stop Loss levels.
2. Entry Rule (The Breakout)
The strategy is passive until the range is violated, looking for a strong move out of the consolidation area.
Trigger Condition: A trade is signaled when a candle closes either:
Above the Wick High (for a Long entry).
Below the Wick Low (for a Short entry).
Execution: The entry is a Market Order executed on the candle that meets the trigger condition, subject to a user-defined Entry Delay (default 0 bars, meaning the entry is taken immediately upon the breakout candle's close).
Direction Control: The user can select to trade Long Only, Short Only, or Both.
3. Exit and Risk Management
All trades are placed with simultaneous Take Profit and Stop Loss orders (a bracket order) once the entry is filled.
A. Take Profit (TP)
The Take Profit is set at the 0.5 Extension of the Shaded Range (Body Range).
Calculation: The distance from the Body High/Low to the TP level is exactly 50% of the total height of the Shaded Range.
B. Stop Loss (SL)
The Stop Loss is dynamically calculated based on a user-selected method for risk control:
Range 0.5 (Body Range): The Stop Loss is placed an equal distance (0.5 times the Body Range height) outside the opposite side of the Body Range.
Example (Long): If entry is above the Wick High, the SL is set 0.5 times the Body Range height below the Body Low.
ATR Multiple: The Stop Loss distance is determined by the asset's recent volatility.
Calculation: The distance is calculated as a user-defined Multiplier (default 2.0) times the Average True Range (ATR).
Recent Swing Low/High: The Stop Loss is placed based on a structural level defined by recent price action.
Long Entry: SL is placed at the Lowest Swing Low within a user-defined lookback period.
Short Entry: SL is placed at the Highest Swing High within a user-defined lookback period.
Summary of Workflow
The market sets the Wick and Body boundaries (e.g., 9:30–10:30 AM).
Price breaks and closes beyond a Wick boundary, triggering a signal.
The trade enters after the specified delay.
A bracket order is placed: TP is fixed at the 0.5 Extension, and SL is set based on the user's chosen risk method.
The trade is closed upon reaching either the TP or the SL level.
Capitulation Detector StrategyA multi-factor capitulation detector designed to identify exhaustion points in extended trends. It focuses on fading capitulation moves after multi-leg trends with extreme volume and price extension.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE CONCEPT
Capitulation occurs when the last holders give up — panic selling into lows or euphoric buying into highs. These moments create asymmetric opportunities because:
Sentiment becomes maximally skewed
Weak hands are flushed out
Price deviates far from equilibrium
The "fuel" for continuation is exhausted
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE 6 FACTORS
Trend Persistence — Price stays on one side of 38 EMA for 12+ bars, confirming a sustained directional move
Acceleration — Price stays on one side of 5 EMA for 3+ bars, showing the move is accelerating into exhaustion
Volume Spike — Current bar volume ≥ 2x the 20-bar average
Body Expansion — Candle body ≥ 1.5x average, showing conviction/panic in the move
Extension — Price is 2+ ATR away from the 38 EMA, indicating overextension from equilibrium
Multi-Leg Structure — At least 3 consecutive lower lows (for longs) or higher highs (for shorts)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SIGNAL LOGIC
Bullish Capitulation: 4+ factors align + price below 38 EMA + down candle + volume spike
Bearish Capitulation: 4+ factors align + price above 38 EMA + up candle + volume spike
The strategy enters counter-trend, fading the exhaustion move.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXIT OPTIONS
ATR-based stop loss (default: 2 ATR)
ATR-based take profit (default: 3 ATR)
Optional trailing stop
Time filter for session-specific trading
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BEST PRACTICES
Works best on liquid instruments with clean trends
More reliable after 3+ legs in the trend
Higher conviction when daily AND intraday timeframes align
"The bigger and more extended, the better"
Consider VWAP as additional confirmation (not coded here)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS GUIDE
Min Score: Increase for fewer, higher-quality signals
Volume Spike Multiplier: 2x; increase for stricter filter
Extension ATR: Higher values = more overextended setups only
Trend Bars Min: Higher values = longer established trends required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
Bullish Capitulation (potential long)
Bearish Capitulation (potential short)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
This is a counter-trend strategy — inherently higher risk than trend-following. Always use proper position sizing and risk management. Backtest thoroughly on your specific instruments and timeframes.
MNO_2Step_Strategy_MOU_KAKU (Publish-Clear)//@version=5
strategy("MNO_2Step_Strategy_MOU_KAKU (Publish-Clear)", overlay=true, pyramiding=0,
max_labels_count=500, max_lines_count=500,
initial_capital=100000,
default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// =========================
// 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")
showMouLabels = input.bool(true, "Show MOU/MOU-B labels")
showKakuLabels = input.bool(true, "Show KAKU labels")
showDebugTbl = input.bool(true, "Show debug table (last bar)")
showStatusLbl = input.bool(true, "Show status label (last bar always)")
locChoice = input.string("Below Bar", "Label location", options= )
lblLoc = locChoice == "Below Bar" ? location.belowbar : location.abovebar
// =========================
// 必ず決済が起きる設定(投稿クリア用)
// =========================
enableTPSL = input.bool(true, "Enable TP/SL")
tpPct = input.float(2.0, "Take Profit (%)", step=0.1, minval=0.1) // ←投稿クリア向けに近め
slPct = input.float(1.0, "Stop Loss (%)", step=0.1, minval=0.1) // ←投稿クリア向けに近め
maxHoldBars = input.int(30, "Max bars in trade (force close)", minval=1)
entryMode = input.string("MOU or KAKU", "Entry trigger", options= )
// ✅ 保険:トレード0件を避ける(投稿クリア用)
// 1回でもクローズトレードができたら自動で沈黙
publishAssist = input.bool(true, "Publish Assist (safety entry if 0 trades)")
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
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
// =========================
// Entry (strategy)
// =========================
entrySignal = entryMode == "KAKU only" ? kaku : (mou or kaku)
canEnter = strategy.position_size == 0
newEntryKaku = canEnter and kaku and entrySignal
newEntryMouB = canEnter and (not kaku) and mou_breakout and entrySignal
newEntryMou = canEnter and (not kaku) and mou_pullback and entrySignal
// --- Publish Assist(保険エントリー) ---
// 条件が厳しすぎて「トレード0件」だと投稿時に警告が出る。
// closedtradesが0の間だけ、軽いEMAクロスで1回だけ拾う(その後は沈黙)。
assistFast = ta.ema(close, 5)
assistSlow = ta.ema(close, 20)
assistEntry = publishAssist and strategy.closedtrades == 0 and canEnter and ta.crossover(assistFast, assistSlow)
// 実エントリー
if newEntryKaku or newEntryMouB or newEntryMou or assistEntry
strategy.entry("LONG", strategy.long)
// ラベル(視認)
if showMouLabels and newEntryMou
label.new(bar_index, low, "猛(IN)", style=label.style_label_up, color=color.new(color.lime, 0), textcolor=color.black)
if showMouLabels and newEntryMouB
label.new(bar_index, low, "猛B(IN)", style=label.style_label_up, color=color.new(color.lime, 0), textcolor=color.black)
if showKakuLabels and newEntryKaku
label.new(bar_index, low, "確(IN)", style=label.style_label_up, color=color.new(color.yellow, 0), textcolor=color.black)
if assistEntry
label.new(bar_index, low, "ASSIST(IN)", style=label.style_label_up, color=color.new(color.aqua, 0), textcolor=color.black)
// =========================
// Exit (TP/SL + 強制クローズ)
// =========================
inPos = strategy.position_size > 0
tpPx = inPos ? strategy.position_avg_price * (1.0 + tpPct/100.0) : na
slPx = inPos ? strategy.position_avg_price * (1.0 - slPct/100.0) : na
if enableTPSL
strategy.exit("TP/SL", from_entry="LONG", limit=tpPx, stop=slPx)
// 最大保有バーで強制決済(これが「レポート無し」回避の最後の保険)
var int entryBar = na
if strategy.position_size > 0 and strategy.position_size == 0
entryBar := bar_index
if strategy.position_size == 0
entryBar := na
forceClose = inPos and not na(entryBar) and (bar_index - entryBar >= maxHoldBars)
if forceClose
strategy.close("LONG")
// =========================
// 利確/損切/強制クローズのラベル
// =========================
closedThisBar = (strategy.position_size > 0) and (strategy.position_size == 0)
avgPrev = strategy.position_avg_price
tpPrev = avgPrev * (1.0 + tpPct/100.0)
slPrev = avgPrev * (1.0 - slPct/100.0)
hitTP = closedThisBar and high >= tpPrev
hitSL = closedThisBar and low <= slPrev
// 同一足TP/SL両方は厳密に判断できないので、表示は「TP優先」で簡略(投稿ギリギリ版)
if hitTP
label.new(bar_index, high, "利確", style=label.style_label_down, color=color.new(color.lime, 0), textcolor=color.black)
else if hitSL
label.new(bar_index, low, "損切", style=label.style_label_up, color=color.new(color.red, 0), textcolor=color.white)
else if closedThisBar and forceClose
label.new(bar_index, close, "時間決済", style=label.style_label_left, color=color.new(color.gray, 0), textcolor=color.white)
// =========================
// Signals (猛/猛B/確)
// =========================
plotshape(showMouLabels and mou_pullback and not kaku, title="MOU_PULLBACK", style=shape.labelup, text="猛",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showMouLabels and mou_breakout and not kaku, title="MOU_BREAKOUT", style=shape.labelup, text="猛B",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showKakuLabels and kaku, 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")
alertcondition(assistEntry, title="MNO_ASSIST_ENTRY", message="MNO: ASSIST ENTRY (publish safety)")
// =========================
// Status label(最終足に必ず表示)
// =========================
var label status = na
if showStatusLbl and barstate.islast
label.delete(status)
statusTxt =
"MNO RUNNING " +
"ClosedTrades: " + str.tostring(strategy.closedtrades) + " " +
"BaseTrend: " + (baseTrendOK ? "OK" : "NO") + " " +
"MOU: " + (mou ? "YES" : "no") + " (猛=" + (mou_pullback ? "Y" : "n") + " / 猛B=" + (mou_breakout ? "Y" : "n") + ") " +
"KAKU: " + (kaku ? "YES" : "no") + " " +
"VolRatio: " + (na(volRatio) ? "na" : str.tostring(volRatio, format.mintick)) + " " +
"Pull%: " + (na(pullbackPct) ? "na" : str.tostring(pullbackPct, format.mintick)) + " " +
"Pos: " + (inPos ? "IN" : "OUT")
status := label.new(bar_index, high, statusTxt, style=label.style_label_left, textcolor=color.white, color=color.new(color.black, 0))
// =========================
// Debug table(最終足のみ)
// =========================
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
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("AssistEntry", assistEntry, 11)
fRow("ClosedTrades>0", strategy.closedtrades > 0, 12)
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).
Strategia S&P 500 vs US10Y YieldThis 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.
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.
Keltner Channels Strategy NewThe strategy is chenging the same as an original copy, but this one is for tests, so I will publish it and check results
Double&Triple Pattern[TS_Indie]📌 Description – Double & Triple Pattern Indicator
The Double & Triple Pattern Indicator is developed to help traders systematically and clearly identify Double Top, Double Bottom, Triple Top, and Triple Bottom chart patterns.
⚙️ Core Logic & Working Mechanism
The Double & Triple Pattern Indicator is built on the concept of price swing formation, based on the logic of Trend Entry_0 , which focuses on structured market analysis and price action behavior.
The indicator detects three main swing points (Swing 1, Swing 2, and Swing 3). A Fibonacci Box is then created using Swing A and Swing B as reference points to define the swing detection zone.
When all three swings remain inside the defined Fibonacci Box, the structure is considered a valid Price Action setup.
The indicator then plots key lines on the chart:
➩ Break Line – used to confirm the signal (confirmation)
➩ Cancel Line – used to invalidate the price action if price moves against the conditions
➛ When price breaks the Break Line , the structure is confirmed and a Pending Order is placed at Swing B , with the Stop Loss set at Swing 1.
➛ If price breaks the Cancel Line first, the price action structure is immediately invalidated.
⚙️ Fibonacci Entry Zone & Change SL Settings
➩ When Fibo Entry Zone is set to 0, the Pending Order is placed directly at Swing B.
➩ When the value is greater than 0, the Pending Order is calculated using Fibonacci levels drawn from Swing B to the Stop Loss level.
➩ Change SL allows switching the Stop Loss reference between Swing 1 and Swing A.
⚙️ Min & Max Control for Swing Size : xATR
When enabling Control Size Swing : xATR , the indicator filters Swing B based on the defined Min and Max range.
This allows traders to selectively test larger or smaller swing-based price actions , depending on their trading strategy.
⭐ Pending Order Cancellation Conditions
A Pending Order will be canceled under the following conditions:
1.A new Price Action signal appears on either the Buy or Sell side.
2.When Time Session is enabled, the Pending Order is canceled once price exits the selected session.
🕹 Order Management Rule
When there is an active open position, the indicator restricts the creation of new Pending Orders to prevent overlapping positions.
💡 Double Pattern Example
💡 Triple Pattern Example
⚠️ Disclaimer
This indicator is designed for technical analysis purposes only and does not constitute investment advice.
Users should apply proper risk management and make decisions at their own discretion.
🥂 Community Sharing
If you find parameter settings that work well or produce strong statistical results, feel free to share them with the community so we can improve and develop this indicator together.
Ichimoku Kijun OPTIMISED FOR 15MIN EURUSDWhen to Enter a Trade (The Kijun Bounce)
We only enter when the market is clearly trending and we get a good pullback to the Kijun-sen (the red line).
Market Quality Check (Anti-Chop):
The price must be completely outside the Ichimoku Cloud (Kumo). This ensures we are not trading in a choppy, sideways market.
Buy (Long) Entry:
The price (low of the candle) drops down and touches the Kijun-sen (red line).
The candle then closes above the Kijun-sen, confirming the trend is holding and the bounce is real.
Sell (Short) Entry:
The price (high of the candle) rises up and touches the Kijun-sen (red line).
The candle then closes below the Kijun-sen, confirming the downtrend is holding and the rejection is real.
How to Manage Risk and Exit
We use a fixed profit target (Take Profit) and a dynamic Stop Loss (Trailing Stop) that follows the Kijun-sen.
Risk per Trade:
We risk 1.0 percent of the total account equity per trade.
The initial Stop Loss distance is limited to 1.0 times the ATR, and is strictly capped at 1.0 percent of the price to prevent any single catastrophic loss.
Take Profit (TP):
The fixed profit target is set to a 1.5 Risk to Reward ratio (1.5 R:R) . This means the profit target is 1.5 times the size of the initial stop loss.
Stop Loss (SL):
The Stop Loss is a Trailing Stop that automatically moves with the Kijun-sen (red line).
The Stop Loss will trail slightly below the Kijun-sen for a Buy trade, and slightly above the Kijun-sen for a Sell trade, protecting profits dynamically as the trend continues.
Understanding the Trade Signals
🟢🟡 The Round Dots (Entry Signals)
The small, round dots are placed directly on the candle where the strategy decided to enter a trade. The color tells you the direction:
Lime Green Dot: Signals a confirmed Long (Buy) Entry. This happens on the candle where the price successfully bounced off the Kijun-sen (red line) and closed higher, and the market was outside the Kumo (the cloud).
Red Dot: Signals a confirmed Short (Sell) Entry. This happens on the candle where the price was successfully rejected by the Kijun-sen (red line) and closed lower, and the market was outside the Kumo.
⬆️⬇️ The Arrows (Exit Signals)
The arrows appear at the exact price level where the trade was closed (exited). The direction of the arrow indicates where the exit occurred relative to the market action, but the color is more important for determining the result:
Exit Arrow (Often Green/Red): This signals a trade was closed for one of two reasons:
Take Profit (Limit Hit): The trade moved in your favor and hit the fixed 1.5 R:R profit target. This is a successful, profitable exit.
Stop Loss (Trailing Stop Hit): The market reversed against the position, and the trade was closed by the dynamic Kijun-sen Trailing Stop. This is a risk-controlled loss or a break-even exit.
The size of these arrows is the default setting used by the strategy.exit() function in Pine Script to clearly mark the exit price on the chart.
In Summary
The dots tell you when to get in (Entry) based on the Kijun Reversion rule, and the arrows tell you when you got out (Exit) due to hitting either the target profit or the trailing stop loss.
N1E_UTBOATN1E_UTBOAT
ATR trailing stop
Optional Heikin Ashi source
Buy/Sell signals based on a crossover of price vs ATR trailing stop
Strategy long/short entries
Reversal WaveThis is the type of quantitative system that can get you hated on investment forums, now that the Random Walk Theory is back in fashion. The strategy has simple price action rules, zero over-optimization, and is validated by a historical record of nearly a century on both Gold and the S&P 500 index.
Recommended Markets
SPX (Weekly, Monthly)
SPY (Monthly)
Tesla (Weekly)
XAUUSD (Weekly, Monthly)
NVDA (Weekly, Monthly)
Meta (Weekly, Monthly)
GOOG (Weekly, Monthly)
MSFT (Weekly, Monthly)
AAPL (Weekly, Monthly)
System Rules and Parameters
Total capital: $10,000
We will use 10% of the total capital per trade
Commissions will be 0.1% per trade
Condition 1: Previous Bearish Candle (isPrevBearish) (the closing price was lower than the opening price).
Condition 2: Midpoint of the Body The script calculates the exact midpoint of the body of that previous bearish candle.
• Formula: (Previous Open + Previous Close) / 2.
Condition 3: 50% Recovery (longCondition) The current candle must be bullish (green) and, most importantly, its closing price must be above the midpoint calculated in the previous step.
Once these parameters are met, the system executes a long entry and calculates the exit parameters:
Stop Loss (SL): Placed at the low of the candle that generated the entry signal.
Take Profit (TP): Calculated by projecting the risk distance upward.
• Calculation: Entry Price + (Risk * 1).
Risk:Reward Ratio of 1:1.
About the Profit Factor
In my experience, TradingView calculates profits and losses based on the percentage of movement, which can cause returns to not match expectations. This doesn’t significantly affect trending systems, but it can impact systems with a high win rate and a well-defined risk-reward ratio. It only takes one large entry candle that triggers the SL to translate into a major drop in performance.
For example, you might see a system with a 60% win rate and a 1:1 risk-reward ratio generating losses, even though commissions are under control relative to the number of trades.
My recommendation is to manually calculate the performance of systems with a well-defined risk-reward ratio, assuming you will trade using a fixed amount per trade and limit losses to a fixed percentage.
Remember that, even if candles are larger or smaller in size, we can maintain a fixed loss percentage by using leverage (in cases of low volatility) or reducing the capital at risk (when volatility is high).
Implementing leverage or capital reduction based on volatility is something I haven’t been able to incorporate into the code, but it would undoubtedly improve the system’s performance dramatically, as it would fix a consistent loss percentage per trade, preventing losses from fluctuating with volatility swings.
For example, we can maintain a fixed loss percentage when volatility is low by using the following formula:
Leverage = % of SL you’re willing to risk / % volatility from entry point to exit or SL
And if volatility is high and exceeds the fixed percentage we want to expose per trade (if SL is hit), we could reduce the position size.
For example, imagine we only want to risk 15% per SL on Tesla, where volatility is high and would cause a 23.57% loss. In this case, we subtract 23.57% from 15% (the loss percentage we’re willing to accept per trade), then subtract the result from our usual position size.
23.57% - 15% = 8.57%
Suppose I use $200 per trade.
To calculate 8.57% of $200, simply multiply 200 by 8.57/100. This simple calculation shows that 8.57% equals about $17.14 of the $200. Then subtract that value from $200:
$200 - $17.14 = $182.86
In summary, if we reduced the position size to $182.86 (from the usual $200, where we’re willing to lose 15%), no matter whether Tesla moves up or down 23.57%, we would still only gain or lose 15% of the $200, thus respecting our risk management.
Final Notes
The code is extremely simple, and every step of its development is detailed within it.
If you liked this strategy, which complements very well with others I’ve already published, stay tuned. Best regards.
MACD Zero-Line Strategy (Long Only)Strategy to Open order when Mac-D Signal Cross up 0, Sell when it cross down 0
specific breakout FiFTOStrategy Description: 10:14 Breakout Only
Overview This is a time-based intraday trading strategy designed to capture momentum bursts that occur specifically after the 10:14 AM candle closes. It operates on the logic that if price breaks the high of this specific candle within a short window, a trend continuation is likely.
Core Logic & Rules
The Setup Candle (10:14 AM)
The strategy waits specifically for the minute candle at 10:14 to complete.
Once this candle closes, the strategy records its High price.
Defining the Entry Level
It calculates a trigger price by taking the 10:14 High and adding a user-defined Buffer (e.g., +1 point).
Formula: Entry Level = 10:14 High + Buffer
The "Active Window" (Expiry)
The trade setup does not remain open all day. It has a strict time limit.
By default, the setup is valid from 10:15 to 10:20.
If the price does not break the Entry Level by the expiry time (default 10:20), the setup is cancelled and no trade is taken for the day.
Entry Trigger
If a candle closes above the Entry Level while the window is open, a Long (Buy) position is opened immediately.
Exits (Risk Management)
Stop Loss: A fixed number of points below the entry price.
Target: A fixed number of points above the entry price.
Visual & Automation Features
Visual Boxes: Upon entry, the strategy draws a "Long Position" style visual on the chart. A green box highlights the profit zone, and a red box highlights the loss zone. These boxes extend automatically until the trade closes.
JSON Alerts: The strategy is pre-configured to send data-rich alerts for automation (e.g., Telegram bots).
Entry Alert: Includes Symbol, Entry Price, SL, and TP.
Exit Alerts: Specific messages for "Target Hit" or "SL Hit".
Summary of User Inputs
Entry Buffer: Extra points added to the high to filter false breaks.
Fixed Stop Loss: Risk per trade in points.
Fixed Target: Reward per trade in points.
Expiry Minute: The minute (10:xx) at which the setup becomes invalid if not triggered.
Indian Scalper 2025 – PSAR + SMA50 + RSI≤50 + High Volume (75%)Best 1-min / 2-min scalping strategy for NIFTY, BANKNIFTY, FINNIFTY & liquid stocks in 2025
✓ PSAR flip + SMA-50 trend filter
✓ RSI ≤50 (avoids chasing)
✓ Only high-volume candles (bright colour)
✓ Loud mobile alerts with price & SL
✓ 1:2+ RR with PSAR trailing
Works like magic 9:15–11:30 AM and 2–3:20 PM
Made with love for the Indian trading community ♥
The Flody SniperA trend-following sniper strategy that uses two EMAs (21/55) and RSI to confirm momentum.
It enters long when price crosses above the fast EMA during an uptrend and RSI shows strength.
It enters short when price crosses below the fast EMA during a downtrend and RSI shows weakness.
Pyramiding is enabled so the strategy can add more positions as the trend continues.
Positions close when momentum weakens or price breaks back through the fast EMA.
Center and Volume AnalyzerCenter and Volume Analyzer that utilizes the chart's Center of Gravity alongside the Rate of Change with Bollinger Bands with a basis for the midpoint. As always, none of this is investment or financial advice. Please do your own due diligence and research.
Nifty 10m Simple ORB TEST harish//@version=5
strategy("Nifty 10m Simple ORB TEST", overlay=true)
// 10m timeframe check
if timeframe.period != "10"
runtime.error("Use this on 10 minute timeframe")
// First 10m candle high/low (no PCR, no opposite logic – just test syntax)
newDay = ta.change(time("D")) != 0
var float dayHigh = na
var float dayLow = na
if newDay
dayHigh := na
dayLow := na
sessStart = 0915
sessEnd = 0925
hhmm = hour * 100 + minute
isFirst = na(dayHigh) and hhmm >= sessStart and hhmm < sessEnd
if isFirst
dayHigh := high
dayLow := low
// Plot first candle range
plot(dayHigh, "First High", color=color.green, style=plot.style_linebr)
plot(dayLow, "First Low", color=color.red, style=plot.style_linebr)
// Simple breakout entries just to test
longCond = not na(dayHigh) and close > dayHigh
shortCond = not na(dayLow) and close < dayLow
if longCond
strategy.entry("LONG", strategy.long)
if shortCond
strategy.entry("SHORT", strategy.short)
HARRISH DADE//@version=5
strategy("Nifty 15m ORB + 20 EMA + Volume - Signals Fixed", overlay=true,
initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=25,
process_orders_on_close=true)
// 15-minute timeframe check
if timeframe.period != "15"
runtime.error("Use this strategy on 15 minute timeframe only")
// ORB 9:15–9:30 High/Low
var float orbHigh = na
var float orbLow = na
newDay = ta.change(time("D")) != 0
if newDay
orbHigh := na
orbLow := na
sessStart = 0915
sessEnd = 0930
hhmm = hour * 100 + minute
inORB = hhmm >= sessStart and hhmm < sessEnd
if inORB
orbHigh := na(orbHigh) ? high : math.max(orbHigh, high)
orbLow := na(orbLow) ? low : math.min(orbLow, low)
// Plot ORB levels
plot(orbHigh, "ORB High", color=color.new(color.green, 0), linewidth=2)
plot(orbLow, "ORB Low", color=color.new(color.red, 0), linewidth=2)
// Trend filter - 20 EMA
emaLen = input.int(20, "EMA Length", minval=1)
ema20 = ta.ema(close, emaLen)
upTrend = close > ema20
dnTrend = close < ema20
plot(ema20, "EMA 20", color=color.orange, linewidth=2)
// Volume filter - Adaptive
volLen = input.int(20, "Volume MA Length", minval=1)
avgVol = ta.sma(volume, volLen)
volMult = input.float(1.5, "Volume Multiplier", step=0.1)
enoughVol = volume >= (avgVol * volMult)
// ORB complete check
orbLocked = not na(orbHigh) and not na(orbLow) and not inORB
// Entry conditions (for strategy)
longCond = orbLocked and ta.crossover(close, orbHigh) and upTrend and enoughVol
shortCond = orbLocked and ta.crossunder(close, orbLow) and dnTrend and enoughVol
// Risk Management
targetPts = input.float(40.0, "Target Points", step=1.0)
slPts = input.float(25.0, "Stoploss Points", step=1.0)
// STRATEGY ENTRIES
if longCond and strategy.position_size == 0
strategy.entry("LONG", strategy.long)
if shortCond and strategy.position_size == 0
strategy.entry("SHORT", strategy.short)
// STRATEGY EXITS
if strategy.position_size > 0
strategy.exit("LONG EXIT", from_entry="LONG",
limit=strategy.position_avg_price + targetPts,
stop=strategy.position_avg_price - slPts)
if strategy.position_size < 0
strategy.exit("SHORT EXIT", from_entry="SHORT",
limit=strategy.position_avg_price - targetPts,
stop=strategy.position_avg_price + slPts)
// **FIXED BUY/SELL SIGNALS** - No barstate.isconfirmed, direct conditions
plotshape(longCond, title="BUY", style=shape.triangleup, location=location.belowbar,
color=color.new(color.lime, 0), size=size.large, text="BUY", textcolor=color.white)
plotshape(shortCond, title="SELL", style=shape.triangledown, location=location.abovebar,
color=color.new(color.red, 0), size=size.large, text="SELL", textcolor=color.white)
// Debug table - shows if conditions met
if barstate.islast
var table debugTable = table.new(position.top_right, 2, 6, bgcolor=color.white, border_width=1)
table.cell(debugTable, 0, 0, "Condition", text_color=color.black, bgcolor=color.gray)
table.cell(debugTable, 1, 0, "Status", text_color=color.black, bgcolor=color.gray)
table.cell(debugTable, 0, 1, "ORB Locked", text_color=color.black)
table.cell(debugTable, 1, 1, str.tostring(orbLocked), text_color=orbLocked ? color.green : color.red)
table.cell(debugTable, 0, 2, "UpTrend", text_color=color.black)
table.cell(debugTable, 1, 2, str.tostring(upTrend), text_color=upTrend ? color.green : color.red)
table.cell(debugTable, 0, 3, "Enough Vol", text_color=color.black)
table.cell(debugTable, 1, 3, str.tostring(enoughVol), text_color=enoughVol ? color.green : color.red)
BTC Mon 8am Buy / Wed 2pm Sell (NY Time, Daily + Intraday)This strategy implements a fixed weekly time-based trading schedule for Bitcoin, using New York market hours as the reference clock. It is designed to test whether a consistent pattern exists between early-week accumulation and mid-week distribution in BTC price behavior.
Entry Rule — Monday 8:00 AM (NY Time)
The strategy enters a long position every Monday at exactly 08:00 AM Eastern Time, one hour after the U.S. equities market pre-open activity begins influencing global liquidity.
This timing attempts to capture early-week directional moves in Bitcoin, which sometimes occur as traditional markets come online.
Exit Rule — Wednesday 2:00 PM (NY Time)
The strategy closes the position every Wednesday at 2:00 PM Eastern Time, a point in the week where:
U.S. equity markets are still open
BTC often experiences mid-week volatility rotations
Liquidity is generally high
This exit removes exposure before later-week uncertainty and gives a consistent, measurable time window for each trade.
Timeframe Compatibility
Works on intraday charts (recommended 1h or lower) using precise time-based triggers.
Also runs on daily charts, where entries and exits occur on the Monday and Wednesday bars respectively (daily charts cannot show intraday timestamps).
All timestamps are synced to America/New_York regardless of the exchange’s native timezone.
Trading Frequency
Exactly one trade per week, preventing overtrading and allowing comparison of weekly performance across years of historical BTC price data.
Purpose of the Strategy
This is not a value-based or trend-following system, but a behavioral/time-cycle analysis tool.
It helps evaluate whether a repeating short-term edge exists based solely on:
Weekday timing
Liquidity cycles
Institutional market influence
BTC’s habitual early-week momentum patterns
It is ideal for:
Backtesting weekly BTC behavior
Studying time-based edges
Comparing alternative weekday/time combinations
Visualizing weekly P&L structure
Risk Notes
This strategy does not attempt to predict price direction and should not be assumed profitable without robust backtesting.
Time-based edges can appear, disappear, or invert depending on macro conditions.
There is no stop loss or risk management included by default, so the strategy reflects raw timing-based performance.
Volume Momentum Strategy [MA/VWAP Cross]Deconstructing the Volume Momentum Strategy: An Analysis of MA-VWAP Cross Mechanics
Introduction
The "Volume Momentum Strategy " is a technical trading algorithm programmed in Pine Script v6 for the TradingView platform. At its core, the strategy is a trend-following system that utilizes the interaction between a specific Moving Average (MA) and the Volume Weighted Average Price (VWAP) to generate trade signals. While the primary execution logic relies on price crossovers, the strategy incorporates a sophisticated secondary layer of analysis using the Commodity Channel Index (CCI) and Stochastic Oscillator. Uniquely, these secondary indicators are applied to volume data rather than price, serving as a gauge for market participation and momentum intensity.
The Core Engine: MA and VWAP Crossover
The primary engine driving the strategy's buy and sell decisions is the crossover relationship between a user-defined Moving Average and the VWAP.
1. The Anchor (VWAP): The strategy calculates the Volume Weighted Average Price based on the HLC3 (High, Low, Close divided by 3) source. VWAP serves as the dynamic benchmark for "fair value" throughout the trading session.
2. The Trigger (Moving Average): The script allows for flexibility in defining the "fast" line, offering options such as Simple (SMA), Exponential (EMA), or Hull Moving Averages.
3. The Signal:
o A Long (Buy) signal is generated when the chosen MA crosses over the VWAP. This suggests that short-term price momentum is exceeding the average volume-weighted price of the session, indicating bullish sentiment.
o A Short (Sell) signal is generated when the MA crosses under the VWAP, indicating bearish pressure where price is being pushed below the session's volume-weighted average.
The Role of CCI and Stochastic: Analyzing Volume Momentum
The prompt specifically inquires about how the CCI and Stochastic indicators fit into this process. In standard technical analysis, these oscillators are used to identify overbought or oversold price conditions. However, this strategy repurposes them to analyze Volume Momentum.
1. The Calculation
Instead of using close prices as the input source, the script passes volume data into both indicator functions:
• Volume CCI: Calculated as ta.cci(volume, cciLength). This measures the deviation of current volume from its statistical average.
• Volume Stochastic: Calculated as ta.stoch(volume, volume, volume, stochLength). This gauges the current volume relative to its recent range.
2. The "Volume Spike" Condition
The strategy combines these two indicators to define a specific market condition labeled isVolumeSpike. A volume spike is confirmed only when both conditions are met simultaneously:
• The Volume CCI must be greater than a defined threshold (default: 100).
• The Volume Stochastic must be greater than a defined threshold (default: 80).
3. Integration into the Process
It is critical to note how this script currently applies this "Volume Spike" logic:
• Visual Confirmation: In the current version of the code, the isVolumeSpike boolean is used strictly for visual feedback. When a spike is detected, the script paints the specific price bar yellow and plots a small triangle marker below the bar.
• Strategic Implication: While the code calculates these metrics, the variables long_condition and short_condition currently rely solely on the MA/VWAP crossover. The developer has left the volume logic as a visual overlay, noting in the comments that it serves as a "visual/alert" or a potential filter.
• Potential Alpha: Conceptually, this setup implies that a trader should look for the MA/VWAP crossover to occur coincidentally with—or shortly after—a "Volume Spike" (yellow bar). This would confirm that the price move is backed by significant institutional participation (volume) rather than just retail noise.
Risk Management and Time Constraints
The strategy wraps these technical signals in a robust risk management framework. It includes hard-coded time windows (start/stop trading times) and a "Close All" function to prevent holding positions overnight. Furthermore, it employs both percentage-based and dollar-based Stop Loss and Take Profit mechanisms, ensuring that every entry—whether generated by a high-momentum crossover or a standard trend move—has a predefined exit plan.
Conclusion
The "Volume Momentum Strategy" is a hybrid system. It executes trades based on the reliable trend signal of MA crossing VWAP but informs the trader with advanced volume analytics. By processing volume through the CCI and Stochastic calculations, it provides a "heads-up" display regarding the intensity of market participation, allowing the trader to distinguish between low-volume drifts and high-volume breakout moves.






















