5ma + O’Neil & Minervini Buy Condition

5ma + O’Neil & Minervini Buy Condition is an original TradingView indicator that extends beyond a simple collection of standard moving averages by offering:
- Five Fully Independent Lines: Each of MA1–MA5 can be configured as SMA, EMA, WMA, or VWMA with its own period and data source. This level of customization unlocks unique combinations no existing script provides.
- Synergy of Multiple Timeframes: Default settings (10, 21, 50, 200, 325) reflect ultra‑short, short, medium, long, and volume‑weighted long‑term perspectives. The layered structure functions as a multi‑filter, sharpening entry signals and trend confirmation beyond any single MA.
- Integrated Buy Conditions: Built‑in O’Neil and Minervini buy filters use fixed SMA‑based rules (50 & 200 SMA rising within 15% of 52‑week high; 10 > 21 > 50 SMA rising within high/low thresholds), plus a combined condition highlighting when both methods align.
- Clean Visualization & Style Controls: Background coloring for each buy condition appears only in the Style tab under clearly named parameters (O’Neil Buy Condition, Minervini Buy Condition, Both Conditions). MA lines support transparent default colors and customizable line width for optimal readability without clutter.
Calculation & Logic
```
Buy Condition Logic
- O’Neil: Price > 50 SMA & 200 SMA (both rising) **and** within 15% of the 52‑week high.
- Minervini: 10 SMA > 21 SMA > 50 SMA (both short‑term SMAs rising) **and** within 25% of the 52‑week high **and** at least 25% above the 52‑week low.
- Combined: Both O’Neil and Minervini conditions true.
Usage Examples
1. Short‑Mid Cross: Observe MA1/MA2 crossover while MA3/MA4 confirm trend strength.
2. Volume‑Weighted Long‑Term: Use VWMA as MA5 to filter institutional‑strength pullbacks.
3. Multi‑Filter Entry: Look for purple background (Both Conditions) on daily chart as high‑confidence entry.
Why It’s Unique
- Not a Mash‑Up: Though built on standard MA formulas, the customizable layering and built‑in buy filters create a novel multi‑dimensional analysis tool.
- Trader‑Friendly: Detailed comments in the code explain parameter choices, calculation methods, and practical entry scenarios so that even Pine novices can understand the underlying mechanics.
- Publication‑Ready: Description and code demonstrate originality, add clear value, and comply with house‑rule requirements by explaining why and how components interact, not just listing features.
- Combined Custom MA & Buy Conditions: By integrating customizable moving averages with built-in buy filters, users can easily recognize O’Neil and Minervini recommended setups.
5ma + O’Neil & Minervini Buy Condition is an original TradingView indicator that extends beyond a simple collection of standard moving averages by offering:
- Five Fully Independent Lines: Each of MA1–MA5 can be configured as SMA, EMA, WMA, or VWMA with its own period and data source. This level of customization unlocks unique combinations no existing script provides.
- Synergy of Multiple Timeframes: Default settings (10, 21, 50, 200, 325) reflect ultra‑short, short, medium, long, and volume‑weighted long‑term perspectives. The layered structure functions as a multi‑filter, sharpening entry signals and trend confirmation beyond any single MA.
- Integrated Buy Conditions: Built‑in O’Neil and Minervini buy filters use fixed SMA‑based rules (50 & 200 SMA rising within 15% of 52‑week high; 10 > 21 > 50 SMA rising within high/low thresholds), plus a combined condition highlighting when both methods align.
- Clean Visualization & Style Controls: Background coloring for each buy condition appears only in the Style tab under clearly named parameters (O’Neil Buy Condition, Minervini Buy Condition, Both Conditions). MA lines support transparent default colors and customizable line width for optimal readability without clutter.
Calculation & Logic
Buy Condition Logic
- O’Neil: Price > 50 SMA & 200 SMA (both rising) **and** within 15% of the 52‑week high.
- Minervini: 10 SMA > 21 SMA > 50 SMA (both short‑term SMAs rising) **and** within 25% of the 52‑week high **and** at least 25% above the 52‑week low.
- Combined: Both O’Neil and Minervini conditions true.
Usage Examples
1. Short‑Mid Cross: Observe MA1/MA2 crossover while MA3/MA4 confirm trend strength.
2. Volume‑Weighted Long‑Term: Use VWMA as MA5 to filter institutional‑strength pullbacks.
3. Multi‑Filter Entry: Look for purple background (Both Conditions) on daily chart as high‑confidence entry.
4. No Buy Condition: When no Buy Condition is highlighted, entry is not recommended; consider closing existing positions.
Why It’s Unique
- Not a Mash‑Up: Though built on standard MA formulas, the customizable layering and built‑in buy filters create a novel multi‑dimensional analysis tool.
- Trader‑Friendly: Detailed comments in the code explain parameter choices, calculation methods, and practical entry scenarios so that even Pine novices can understand the underlying mechanics.
- Publication‑Ready: Description and code demonstrate originality, add clear value, and comply with house‑rule requirements by explaining why and how components interact, not just listing features.
- Combined Custom MA & Buy Conditions: By integrating customizable moving averages with built-in buy filters, users can easily recognize O’Neil and Minervini recommended setups.
5ma + O’Neil & Minervini Buy Condition is a purpose-built TradingView indicator that merges customizable moving averages with the O’Neil & Minervini buy frameworks into one cohesive analysis tool. This is not a simple parameter mashup—it provides distinct trend layers combined with proven entry rules, saving traders from manually assembling multiple scripts.
What It Does
・Five Independent MA Layers: MA1–MA5 each configurable as SMA, EMA, WMA, or VWMA with its own period and source, enabling multi-dimensional trend analysis.
・O’Neil Filter Built-In: Automatically checks 50 & 200 SMA trend and price proximity to the 52-week high (within 15%).
・Minervini Filter Built-In: Automatically enforces 10 > 21 > 50 SMA alignment and price distance from 52-week high (≤25%) and 52-week low (≥25%).
・Confluence Highlight: Purple background when both O’Neil and Minervini conditions align—a unique signal that no single built-in indicator offers.
・Minimal Chart Clutter: Only MA lines and color-coded buy conditions are shown; no extraneous drawings or unrelated indicators.
How It Works
1.Calculate MAs: Uses Pine v5 ta.sma, ta.ema, ta.wma, ta.vwma for custom MA1–MA5. Defaults of 10, 21, 50, 200, and 325 were chosen based on O’Neil and Minervini guidelines:
・10 & 21 SMAs: short‑term momentum and early entry signals, favored by Minervini for capturing acceleration patterns and volatility contractions.
・Why these? Minervini uses 10/21 to catch breakouts early; O’Neil monitors short-term swings via weekly equivalents.
・50 SMA: medium‑term trend filter, used by both O’Neil and Minervini to confirm overall trend direction.
・200 SMA: long‑term trend confirmation, a key O’Neil “rally line” and institutional benchmark.
・325 SMA: (approx. 50‑week) captures extended cyclical patterns and volume‑weighted dynamics, aligning with O’Neil’s 10‑week and 30‑week weekly SMAs for big‑picture timing.
2.O’Neil Buy Logic: Price > 50 & 200 SMA (both rising) AND price ≥ 85% of 52-week high.Show a green background when the O’Neil Buy Condition triggers.
3.Minervini Buy Logic: 10 SMA > 21 SMA > 50 SMA (short SMAs rising) AND price ≥ 75% of 52-week high AND price ≥ 125% of 52-week low.Show a blue background when the Minervini Buy Condition triggers.
4.Combined Signal: Both filters true triggers purple background.
How to Use
・Apply Script – Add “5ma + O’Neil & Minervini Buy Condition.”
・Adjust MAs (Optional) – Change MA1–MA5 periods/types; buy conditions remain fixed to proven values.
・Read Background:
・Green = O’Neil buy condition: price pulling back toward the 50 SMA (MA3) or 200 SMA (MA4) offers a buying opportunity; enter when price bounces off these support MAs. This condition reacts quickly to trend changes, often giving earlier entries compared to the Minervini filter.
・Blue = Minervini buy condition: watch for MA1 (10) crossing above MA2 (21) with both above MA3 (50); enter on the cross confirming short‑term momentum. This condition typically triggers later than O’Neil’s, helping filter out false breakouts and reduce whipsaws.
・Purple = Both conditions: for highest‑confidence entries, combine a bounce off MA3/MA4 with a MA1/MA2 cross under a purple background.
・No color = No buy condition: avoid new entries; consider tightening stops or closing positions.
・Style Customization – Use Style tab to tweak line colors, widths, transparency.
Calculation Logic
Why It’s Unique
・Not Just a Mashup: This is more than merging scripts—custom MA layers and buy frameworks co-exist because the MA trends filter entries that the O’Neil/Minervini rules verify, creating a feedback loop that neither component alone can achieve.
・Integrated Trend & Entry Logic: Moving averages identify support/resistance and momentum, while O’Neil & Minervini conditions provide objective entry criteria. Their integration ensures you only act when both trend direction and entry timing align.
・Actionable Filters: Integrates two legendary methods so traders can apply O’Neil and Minervini setups without manual coding.
・Clean & Educational: Detailed code comments guide Pine novices through logic; chart remains free of unrelated clutter.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.