Updated
[blackcat] L1 Enhanced Awesome Oscillator

Level: 1
Background
The awesome oscillator is just that, an oscillator by Bill Williams. In contrast to the slow stochastics, which ranges from +100 to -100, the fantastic oscillator is limitless. On the surface, one might think that the fantastic oscillator is made up of a complicated algorithm developed by a Whiz Kid from M.I.T. You will be surprised to learn that the indicator is a basic calculation of two simple moving averages. I made some improvements on it by introducing some novel moving average functions and choppiness index as L1 Enhanced Awesome Oscillator.
Function
Yellow bars for bull and fuchsia bars for bear with candles. Buying and selling signal is provided. Divergence signal is provided. Choppiness index is used as a green background color, which indicates trends when it under green color. The choppiness index is used to filter out entry signals.
Key Signal
yellow candle --> bull
fuchsia candle --> bear
yellow DIV label --> bottom divergence
fuchsia DIV label --> top divergence
red SELL label --> short entry
green BUY label --> long entry
Remarks
Feedbacks are appreciated.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Background
The awesome oscillator is just that, an oscillator by Bill Williams. In contrast to the slow stochastics, which ranges from +100 to -100, the fantastic oscillator is limitless. On the surface, one might think that the fantastic oscillator is made up of a complicated algorithm developed by a Whiz Kid from M.I.T. You will be surprised to learn that the indicator is a basic calculation of two simple moving averages. I made some improvements on it by introducing some novel moving average functions and choppiness index as L1 Enhanced Awesome Oscillator.
Function
Yellow bars for bull and fuchsia bars for bear with candles. Buying and selling signal is provided. Divergence signal is provided. Choppiness index is used as a green background color, which indicates trends when it under green color. The choppiness index is used to filter out entry signals.
Key Signal
yellow candle --> bull
fuchsia candle --> bear
yellow DIV label --> bottom divergence
fuchsia DIV label --> top divergence
red SELL label --> short entry
green BUY label --> long entry
Remarks
Feedbacks are appreciated.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Release Notes
Add alerts as requested by @jimmylegsRelease Notes
OVERVIEWThe [blackcat] L1 Enhanced Awesome Oscillator is a comprehensive technical analysis tool that combines the classic Awesome Oscillator with advanced features to provide more reliable trading signals. 📈
FEATURES
• Enhanced Awesome Oscillator calculation with multiple smoothing levels
• Built-in Choppiness Index for trend strength validation
• Smart signal filtering using multiple timeframes
• Visual alerts with customizable colors and labels
• Automatic alert generation for buy/sell signals
HOW TO USE
Add the indicator to your chart
Adjust parameters:
• Length: Controls the Choppiness Index period
• Threshold: Sets the sensitivity level for trend detection
Monitor the following visual cues:
• Yellow bars indicate upward momentum
• Fuchsia bars indicate downward momentum
• Green background suggests bullish conditions
• Red background suggests bearish conditions
SIGNAL INTERPRETATION
• BUY Signal: Appears when:
BBD crosses above zero
Trend is confirmed by Choppiness Index
Multiple timeframe alignment occurs
• SELL Signal: Appears when:
BBD crosses below zero
Trend is confirmed by Choppiness Index
Multiple timeframe alignment occurs
LIMITATIONS
• Works best in trending markets
• May produce false signals during choppy market conditions
• Requires proper parameter tuning for optimal results
NOTES
• The indicator uses hlc3 as the source price
• Default settings are optimized for most market conditions
• Backtesting recommended before live trading
Release Notes
█ OVERVIEWL1 Enhanced Awesome Oscillator turns the classic Awesome Oscillator into a two-way, risk-aware signal system: a choppiness gate keeps entries away from dead ranges, a position state machine removes duplicate and contradictory signals, and ATR based take-profit and stop-loss levels close the trading loop. Every added filter can be switched off to recover the original behaviour.
█ CONCEPTS
Three layers work together:
• Momentum core: the Awesome Oscillator is measured against its own smoothed average, so the histogram (BBD) reads momentum acceleration instead of the raw distance between two averages.
• Choppiness gate: a choppiness style filter blocks entries when the market is range bound, so a turn only counts when the market is actually tradable.
• Trade state machine: entries and exits are edge triggered, mutually exclusive on the same bar and separated by a configurable cooldown, so one bar never produces long and short at the same time.
█ HOW TO USE
1 — Add the indicator to any chart; it opens in its own pane below the price chart.
2 — Read the green E label (long entry) and the red S label (short entry); orange XL / XS marks a signal exit, SL / TP marks a risk exit.
3 — Check the dashboard in the top-right corner for position state, filter status, ATR and the current TP/SL levels.
4 — Create alerts from the built-in alert conditions; every alert is confirmed on bar close.
Input Parameters
• Awesome Oscillator: source, fast and slow SMA length (5 / 13), smoothing (3), BBDA signal length (5).
• Choppiness Filter: length (8), threshold (18), DEA length (144), DEA signal length (3), Use Choppiness Filter on or off.
• Signal Governance: turn-around lookback (4), Enable Short Signals, Exit Trigger (Reverse Signal / Momentum Flip / Both), Same-bar Exclusivity, Cooldown Bars (3).
• Risk Management: Track TP/SL, ATR Length (14), Stop Loss in ATR (2.0), Take Profit in ATR (3.0).
• Re-entry: Enable Re-entry (off by default), Anchor Window (1), Breakout Source (Close or High/Low).
• HTF Direction Gate: Enable (off by default), HTF Timeframe (240), HTF EMA Length (50).
• Visual: candles, BBDA line, labels, background tint, dashboard.
█ FEATURES
• Two-way signals governed by a position state machine, cooldown and same-bar exclusivity
• ATR based TP/SL that also force an exit when the level is touched (SL / TP events)
• Optional re-entry (RL / RS) anchored on the extreme of the exit bar
• Optional higher-timeframe direction gate that does not repaint
• Dashboard, position background, six alert conditions plus dynamic alert messages
█ SIGNALS
Visual Elements
• Yellow and fuchsia candles: BBD rising and falling
• Aqua line: BBDA signal line; gray line: BBD; red and teal lines: stop-loss and take-profit
• Green E and red S: long and short entry; teal RL and maroon RS: re-entry
• Orange XL, XS, SL, TP: exit events, signal driven or risk driven
• Background tint: green while long, red while short, no tint when flat
█ IMPLEMENTATION NOTES
Open source under MPL 2.0. Built on ta.sma, ta.highest and ta.lowest, ta.atr, and request.security reading the already closed higher-timeframe bar, so the HTF gate does not repaint. Signals are evaluated on the confirmed bar and alerts use freq_once_per_bar_close.
█ LIMITATIONS
• Momentum reversal logic lags in fast, news driven moves
• The choppiness gate needs its DEA length, so the first bars of a short chart show no signals
• TP/SL levels are references drawn in the indicator pane, not broker orders
• Ranging markets still generate exits; use the HTF gate or a longer cooldown to tame them
█ NOTES
• Version 2 of the original L1 Enhanced Awesome Oscillator by blackcat1402
• Feedback welcome in the comments; reuse and modification allowed with attribution
═════════════════════════════════════════════════════════════════════════
For questions or feedback, use comments section below.
Feel free to use and modify — attribution appreciated.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.