PROTECTED SOURCE SCRIPT
Atualizado Ramen & OJ V1

Ramen & OJ V1 — Strategy Overview
Ramen & OJ V1 is a mechanical price-action system built around two entry archetypes—Engulfing and Momentum—with trend gates, session controls, risk rails, and optional interval take-profits. It’s designed to behave the same way you’d trade it manually: wait for a qualified impulse, enter with discipline (optionally on a measured retracement), and manage the position with clear, rules-based exits.
Core Idea (What the engine does)
At its heart, the strategy looks for a decisive candle, then trades in alignment with your defined trend gates and flattens when that bias is no longer valid.
Entry Candle Type
Engulfing: The body of the current candle swallows the prior candle’s body (classic momentum shift).
Momentum: A simple directional body (close > open for longs, close < open for shorts).
Body Filter (lookback): Optional guard that requires the current body to be at least as large as the max body from the last N bars. This keeps you from chasing weak signals.
Primary MA (Entry/Exit Role):
Gate (optional): Require price to be above the Primary MA for longs / below for shorts.
Exit (always): Base exit occurs when price closes back across the Primary MA against your position.
Longs: qualifying bullish candle + pass all enabled filters.
Shorts: mirror logic.
Entries (Impulse vs. Pullback)
You choose how aggressive to be:
Market/Bars-Close Entry: Fire on the bar that confirms the signal (respecting filters and sessions).
Retracement Entry (optional): Instead of chasing the close, place a limit around a configurable % of the signal candle’s range (e.g., 50%). This buys the dip/sells the pop with structure, often improving average entry and risk.
Flip logic is handled: when an opposite, fully-qualified signal appears while in a position, the strategy closes first and then opens the new direction per rules.
Exits & Trade Management
Primary Exit: Price closing back across the Primary MA against your position.
Interval Take-Profit (optional):
Pre-Placed (native): Automatically lays out laddered limit targets every X ticks with OCO behavior. Each rung can carry its own stop (per-rung risk). Clean, broker-like behavior in backtests.
Manual (legacy): Closes slices as price steps through the ladder levels intrabar. Useful for platforms/brokers that need incremental closes rather than bracketed OCOs.
Per-Trade Stop: Choose ticks or dollars, and whether the $ stop is per position or per contract. When pre-placed TP is on, each rung uses a coordinated OCO stop; otherwise a single hard stop is attached.
Risk Rails (Session P&L Controls)
Session Soft Lock: When a session profit target or loss limit is hit, the strategy stops taking new trades but does not force-close open positions.
Session Hard Lock: On reaching your session P&L limit, all orders are canceled and the strategy flattens immediately. No new orders until the next session.
These rails help keep good days good and bad days survivable.
Filters & How They Work Together
1) Trend & Bias
Primary MA Gate (optional): Only long above / only short below. This keeps signals aligned with your primary bias.
Primary MA Slope Filter (optional): Require a minimum up/down slope (in degrees over a defined bar span). It’s a simple way to force impulse alignment—green light only when the MA is actually moving up for longs (or down for shorts).
Secondary MA Filter (optional): An additional trend gate (SMA/EMA, often a 200). Price must be on the correct side of this higher-timeframe proxy to trade. Great for avoiding countertrend picks.
How to combine:
Use Secondary MA as the “big picture” bias, Primary MA gate as your local regime check, and Slope to ensure momentum in that regime. That three-layer stack cuts a lot of chop.
2) Volatility/Exhaustion
CCI Dead Zone Filter (optional): Trades only when CCI is inside a specified band (default ±200). This avoids entries when price is extremely stretched; think of it as a no-chase rule.
TTM Squeeze Filter (optional): When enabled, the strategy avoids entries during a squeeze (Bollinger Bands inside Keltner Channels). You’re effectively waiting for the release, not the compression itself. This plays nicely with momentum entries and the slope gate.
How to combine:
If you want only the clean breaks, enable Slope + Squeeze; if you want structure but fewer chases, add CCI Dead Zone. You’ll filter out a lot of low-quality “wiggle” trades.
3) Time & Market Calendar
Sessions: Up to two session windows (America/Chicago by default), with background highlights.
Good-Till-Close (GTC): When ON, trades can close outside the session window; when OFF, all positions are flattened at session end and pending orders canceled.
Market-Day Filters: Skip US listed holidays and known non-full Globex days (e.g., Black Friday, certain eves). Cleaner logs and fewer backtest artifacts.
How to combine:
Run your A-setup window (e.g., cash open hour) with GTC ON if you want exits to obey system rules even after the window, or GTC OFF if you want the book flat at the bell, no exceptions.
Practical Profiles (mix-and-match presets)
Trend Rider: Primary MA gate ON, Slope filter ON, Secondary MA ON, Retracement ON (50%).
Goal: Only take momentum that’s already moving, buy the dip/sell the pop back into trend.
Structure-First Pullback: Primary MA gate ON, Secondary MA ON, CCI Dead Zone ON, Retracement 38–62%.
Goal: Filter extremes, use measured pullbacks for better R:R.
Break-Only Mode: Slope ON + Squeeze filter ON (avoid compression), Body filter ON with short lookback.
Goal: Only catch clean post-compression impulses.
Session Scalper: Tight session window, GTC OFF, Interval TP ON (small slices, short rungs), per-trade tick stop.
Goal: Quick hits in a well-defined window, always flat after.
Automation Notes
The system is built with intrabar awareness (calc_on_every_tick=true) and supports bracket-style behavior via pre-placed interval TP rungs. For webhook automation (e.g., TradersPost), keep chart(s) open and ensure alerts are tied to your order events or signal conditions as implemented in your alert templates. Always validate live routing with a small-size shakedown before scaling.
Tips, Caveats & Good Hygiene
Intrabar vs. Close: Backtests can fill intrabar where your broker might not. The pre-placed mode helps emulate OCO behavior but still depends on feed granularity.
Slippage & Fees: Set realistic slippage/commission in Strategy Properties to avoid fantasy equity curves.
Session Consistency: Use the correct timezone and verify that your broker’s session aligns with your chart session settings.
Don’t Over-stack Filters: More filters ≠ better performance. Start with trend gates, then add one volatility filter if needed.
Disclosure
This script is for educational purposes only and is not financial advice. Markets carry risk; only trade capital you can afford to lose. Test thoroughly on replay and paper before using any automated routing.
TL;DR
Identify a decisive candle → pass trend/vol filters → (optionally) pull back to a measured limit → scale out on pre-planned rungs → exit on Primary MA break or session rule. Clear, mechanical, repeatable.
Ramen & OJ V1 is a mechanical price-action system built around two entry archetypes—Engulfing and Momentum—with trend gates, session controls, risk rails, and optional interval take-profits. It’s designed to behave the same way you’d trade it manually: wait for a qualified impulse, enter with discipline (optionally on a measured retracement), and manage the position with clear, rules-based exits.
Core Idea (What the engine does)
At its heart, the strategy looks for a decisive candle, then trades in alignment with your defined trend gates and flattens when that bias is no longer valid.
Entry Candle Type
Engulfing: The body of the current candle swallows the prior candle’s body (classic momentum shift).
Momentum: A simple directional body (close > open for longs, close < open for shorts).
Body Filter (lookback): Optional guard that requires the current body to be at least as large as the max body from the last N bars. This keeps you from chasing weak signals.
Primary MA (Entry/Exit Role):
Gate (optional): Require price to be above the Primary MA for longs / below for shorts.
Exit (always): Base exit occurs when price closes back across the Primary MA against your position.
Longs: qualifying bullish candle + pass all enabled filters.
Shorts: mirror logic.
Entries (Impulse vs. Pullback)
You choose how aggressive to be:
Market/Bars-Close Entry: Fire on the bar that confirms the signal (respecting filters and sessions).
Retracement Entry (optional): Instead of chasing the close, place a limit around a configurable % of the signal candle’s range (e.g., 50%). This buys the dip/sells the pop with structure, often improving average entry and risk.
Flip logic is handled: when an opposite, fully-qualified signal appears while in a position, the strategy closes first and then opens the new direction per rules.
Exits & Trade Management
Primary Exit: Price closing back across the Primary MA against your position.
Interval Take-Profit (optional):
Pre-Placed (native): Automatically lays out laddered limit targets every X ticks with OCO behavior. Each rung can carry its own stop (per-rung risk). Clean, broker-like behavior in backtests.
Manual (legacy): Closes slices as price steps through the ladder levels intrabar. Useful for platforms/brokers that need incremental closes rather than bracketed OCOs.
Per-Trade Stop: Choose ticks or dollars, and whether the $ stop is per position or per contract. When pre-placed TP is on, each rung uses a coordinated OCO stop; otherwise a single hard stop is attached.
Risk Rails (Session P&L Controls)
Session Soft Lock: When a session profit target or loss limit is hit, the strategy stops taking new trades but does not force-close open positions.
Session Hard Lock: On reaching your session P&L limit, all orders are canceled and the strategy flattens immediately. No new orders until the next session.
These rails help keep good days good and bad days survivable.
Filters & How They Work Together
1) Trend & Bias
Primary MA Gate (optional): Only long above / only short below. This keeps signals aligned with your primary bias.
Primary MA Slope Filter (optional): Require a minimum up/down slope (in degrees over a defined bar span). It’s a simple way to force impulse alignment—green light only when the MA is actually moving up for longs (or down for shorts).
Secondary MA Filter (optional): An additional trend gate (SMA/EMA, often a 200). Price must be on the correct side of this higher-timeframe proxy to trade. Great for avoiding countertrend picks.
How to combine:
Use Secondary MA as the “big picture” bias, Primary MA gate as your local regime check, and Slope to ensure momentum in that regime. That three-layer stack cuts a lot of chop.
2) Volatility/Exhaustion
CCI Dead Zone Filter (optional): Trades only when CCI is inside a specified band (default ±200). This avoids entries when price is extremely stretched; think of it as a no-chase rule.
TTM Squeeze Filter (optional): When enabled, the strategy avoids entries during a squeeze (Bollinger Bands inside Keltner Channels). You’re effectively waiting for the release, not the compression itself. This plays nicely with momentum entries and the slope gate.
How to combine:
If you want only the clean breaks, enable Slope + Squeeze; if you want structure but fewer chases, add CCI Dead Zone. You’ll filter out a lot of low-quality “wiggle” trades.
3) Time & Market Calendar
Sessions: Up to two session windows (America/Chicago by default), with background highlights.
Good-Till-Close (GTC): When ON, trades can close outside the session window; when OFF, all positions are flattened at session end and pending orders canceled.
Market-Day Filters: Skip US listed holidays and known non-full Globex days (e.g., Black Friday, certain eves). Cleaner logs and fewer backtest artifacts.
How to combine:
Run your A-setup window (e.g., cash open hour) with GTC ON if you want exits to obey system rules even after the window, or GTC OFF if you want the book flat at the bell, no exceptions.
Practical Profiles (mix-and-match presets)
Trend Rider: Primary MA gate ON, Slope filter ON, Secondary MA ON, Retracement ON (50%).
Goal: Only take momentum that’s already moving, buy the dip/sell the pop back into trend.
Structure-First Pullback: Primary MA gate ON, Secondary MA ON, CCI Dead Zone ON, Retracement 38–62%.
Goal: Filter extremes, use measured pullbacks for better R:R.
Break-Only Mode: Slope ON + Squeeze filter ON (avoid compression), Body filter ON with short lookback.
Goal: Only catch clean post-compression impulses.
Session Scalper: Tight session window, GTC OFF, Interval TP ON (small slices, short rungs), per-trade tick stop.
Goal: Quick hits in a well-defined window, always flat after.
Automation Notes
The system is built with intrabar awareness (calc_on_every_tick=true) and supports bracket-style behavior via pre-placed interval TP rungs. For webhook automation (e.g., TradersPost), keep chart(s) open and ensure alerts are tied to your order events or signal conditions as implemented in your alert templates. Always validate live routing with a small-size shakedown before scaling.
Tips, Caveats & Good Hygiene
Intrabar vs. Close: Backtests can fill intrabar where your broker might not. The pre-placed mode helps emulate OCO behavior but still depends on feed granularity.
Slippage & Fees: Set realistic slippage/commission in Strategy Properties to avoid fantasy equity curves.
Session Consistency: Use the correct timezone and verify that your broker’s session aligns with your chart session settings.
Don’t Over-stack Filters: More filters ≠ better performance. Start with trend gates, then add one volatility filter if needed.
Disclosure
This script is for educational purposes only and is not financial advice. Markets carry risk; only trade capital you can afford to lose. Test thoroughly on replay and paper before using any automated routing.
TL;DR
Identify a decisive candle → pass trend/vol filters → (optionally) pull back to a measured limit → scale out on pre-planned rungs → exit on Primary MA break or session rule. Clear, mechanical, repeatable.
Notas de Lançamento
(<b>, <i>, <u>, <br>, <hr>, <ul>, <li>, <code>), so it should paste cleanly into the Publish dialog:<hr> <b>Ramen & OJ V1 — Session Trend Strategy with Chop Gate & Native Interval TPs (Protected)</b><br>
<b>What it is (originality & usefulness)</b><br>
Ramen & OJ V1 is a session-oriented <b>trend strategy</b> combining:
<ul> <li><b>Primary Supertrend</b> for entries/exits,</li> <li>optional <b>Secondary Supertrend</b> as a trend gate,</li> <li>a <b>Chop Gate</b> that fuses <i>Kaufman-style Efficiency Ratio (ER)</i> with an <i>ATR Percentile Rank</i> to stand down in choppy/low-volatility regimes,</li> <li><b>CCI dead-zone</b> to avoid extended markets,</li> <li><b>US session & holiday gating</b> with optional session <b>P&L soft/hard locks</b>, and</li> <li><b>native pre-placed interval take-profits</b> (laddered, tick-based) that auto-reseat when TP settings change.</li> </ul> This design aims to <b>avoid low-quality entries during chop</b>, align trades with session trend, and make exits systematic via runged TPs. <hr>
<b>How it works (high level)</b>
<ol> <li><b>Trend + Entry Candle</b><br> Primary Supertrend sets the trade side. Entry trigger can be <b>Engulfing</b> or <b>Momentum</b> candle (optional body filter).<br> <b>Closing Confirmation</b> (optional): Long requires <i>close > prior high</i>; Short requires <i>close < prior low</i>. </li> <li><b>Chop Gate (original component)</b><br> <b>ER filter</b> compares directional move to summed bar-to-bar movement; low ER ⇒ chop.<br> <b>ATR Percentile</b> ranks ATR over a lookback; low rank ⇒ muted realized vol.<br> If either test flags, new entries are blocked. </li> <li><b>Secondary ST Gate (optional)</b><br> Longs only if <code>close > Secondary ST</code>; shorts only if <code>close < Secondary ST</code>. </li> <li><b>Sessions & Day Filters</b><br> Strict trading windows (America/Chicago, auto-DST) and known <b>US holiday/short Globex</b> days blocked.<br> Optional per-session <b>P&L soft/hard locks</b>. </li> <li><b>Orders & Exits</b><br> Market entries on bar close, or <b>Retracement</b> limit intrabar at a % of the signal bar.<br> <b>Primary ST cross</b> closes positions.<br> <b>Interval TPs (native)</b> place pre-layered exits every <i>N</i> ticks with per-rung OCO SL (optional). </li> </ol> <hr>
<b>Defaults & risk/capital setup (for publication)</b>
<ul> <li><b>Account size:</b> <b>$50,000</b> to simulate a typical <b>prop-firm 50K account</b>.</li> <li><b>Position size:</b> strategy defaults to <b>5 micro contracts</b> (adjust to your market’s micro symbol).</li> <li><b>Commission & slippage:</b> set realistic values for your broker/product (keep them enabled in backtests).</li> <li><b>Risk guidance:</b> size trades/stops so worst-case per-trade risk generally stays <b>≤ 5–10%</b> of equity.</li> <li><b>Dataset:</b> prefer samples with <b>100+ trades</b> where feasible; explain exceptions if the market/timeframe limits sample size.</li> <li>Use these same Properties in screenshots to avoid confusion.</li> </ul> <hr>
<b>Inputs to tune</b>
<ul> <li><b>Entry candle</b> type; optional <b>body filter</b> & lookback.</li> <li><b>Closing Confirmation</b> toggle.</li> <li><b>Primary/Secondary Supertrend</b> parameters.</li> <li><b>Chop Gate</b>: ER length & threshold; ATR length, percentile lookback & min percentile.</li> <li><b>CCI dead-zone</b> bounds.</li> <li><b>Sessions</b> (one/two windows), Good-Till-Close, and holiday blocking.</li> <li><b>Retracement %</b> for limit entries.</li> <li><b>Interval TPs</b>: contracts per slice, tick interval, max rungs, and per-rung SL.</li> <li><b>Per-trade SL</b> in ticks or dollars; <b>session P&L locks</b>.</li> </ul> <hr>
<b>Usage & chart guidelines</b>
<ul> <li>Use on <b>standard candles</b> only (not Heikin Ashi, Renko, Kagi, Range, P&F).</li> <li>Publish with a <b>clean chart</b> (only this strategy visible), showing symbol/timeframe/indicator name.</li> <li>Start with defaults; raise <b>ER threshold</b> and/or <b>ATR percentile min</b> to be more selective in chop; enable <b>Closing Confirmation</b> for stricter breaks; adjust <b>Interval TPs</b> for your product’s tick value.</li> </ul> <hr>
<b>Notes & limitations</b>
<ul> <li>No <code>request.security()</code> lookahead or future data is used.</li> <li>Market entries are evaluated on <b>bar close</b>; with <b>Retracement</b> enabled, fills may occur <b>intrabar</b> via limit orders.</li> <li>Backtests are approximations; <b>fills, slippage, gaps, and latency</b> can differ in live trading.</li> <li>This strategy is for <b>research/education</b>. It is <b>not financial advice</b> and <b>does not guarantee</b> performance. Past results do not guarantee future returns.</li> </ul> <hr>
<b>Why Protected (not invite-only)</b><br>
The script integrates an original <b>Chop Gate fusion</b>, a <b>session/holiday/P&L framework</b>, and <b>native interval TP management</b> that auto-reseats. Protecting the source preserves the design while allowing free use in the Public Library (no access control).
<hr>
<b>Credits / reuse</b>
<ul> <li>Supertrend (O. Seban concept), <b>CCI</b> (D. Lambert), <b>TTM Squeeze</b> idea (J. Carter) used as components/filters only.</li> <li>Built with TradingView built-ins; no third-party open-source code copied.</li> <li>All integration logic and the <b>ER + ATR percentile Chop Gate</b> are original to this script.</li> </ul> <hr>
<b>Publishing checklist</b>
<ul> <li>English title, ASCII, no excessive ALL-CAPS.</li> <li>Clean chart; show timeframe/symbol/indicator name.</li> <li>Realistic commission + slippage.</li> <li>Description explains originality, logic, usage, defaults, and limitations.</li> <li>No performance/accuracy claims; no promises about future results.</li> <li><b>Protected</b> (free to use; source not visible).</li> </ul>
Notas de Lançamento
No new updates for this version.Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.