OPEN-SOURCE SCRIPT
Super-AO with Risk Management Strategy Template - 11-29-25

Super-AO Strategy with Advanced Risk Management Template
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
Welcome to the Super-AO Strategy. This is more than just a buy/sell indicator; it is a complete, open-source Risk Management (RM) Template designed for the Pine Script community.
At its core, this script implements a robust swing-trading strategy combining the SuperTrend (for macro direction) and the Awesome Oscillator (for momentum). However, the real power lies under the hood: a custom-built Risk Management Engine that handles trade states, prevents repainting, and manages complex exit conditions like Staged Take Profits and Advanced Adaptive Trailing Stops (AATS).
We are releasing this code to help traders transition from simple indicators to professional-grade strategy structures.
2. Quick Action Guide (TL;DR)
Best Timeframe: 4 Hours (H4) and above. Designed for Swing Trading.
Best Assets: "Well-behaved" assets with clear liquidity (Major Forex pairs, BTC, ETH, Indices).
Strategy Type: Trend Following + Momentum Confirmation.
Key Feature: The Risk Management Engine is modular. You can strip out the "Super-AO" logic and insert your own strategy logic into the template easily.
Repainting: Strictly Non-Repainting. The engine calculates logic based on confirmed candle closes.
3. Detailed Report: How It Works
A. The Strategy Logic: Super-AO
The entry logic is based on the convergence of two classic indicators:
SuperTrend: Determines the overall trend bias (Green/Red).
Awesome Oscillator (AO): Measures market momentum.
The Signal:
LONG (+2): SuperTrend is Green AND AO is above the Zero Line AND AO is Rising.
SHORT (-2): SuperTrend is Red AND AO is below the Zero Line AND AO is Falling.
By requiring momentum to agree with the trend, this system filters out many false signals found in ranging markets.
B. The Risk Management (RM) Engine
This script features a proprietary State Machine designed by Signal Lynx. Unlike standard strategies that simply fire orders, this engine separates the Signal from the Execution.
Logic Injection: The engine listens for a specific integer signal: +2 (Buy) or -2 (Sell). This makes the code a Template. You can delete the Super-AO section, write your own logic, and simply pass a +2 or -2 to the RM_EngineInput variable. The engine handles the rest.
Trade States: The engine tracks the state of the trade (Entry, In-Trade, Exiting) to prevent signal spamming.
Aggressive vs. Conservative:
Conservative Mode: Waits for a full trend reversal before taking a new trade.
Aggressive Mode: Allows for re-entries if the trend is strong and valid conditions present themselves again (Pyramiding Type 1).
C. Advanced Exit Protocols
The strategy does not rely on a single exit point. It employs a "Layered Defense" approach:
Hard Stop Loss: A fixed percentage safety net.
Staged Take Profits (Scaling Out): The script allows you to set 3 distinct Take Profit levels. For example, you can close 10% of your position at TP1, 10% at TP2, and let the remaining 80% ride the trend.
Trailing Stop: A standard percentage-based trailer.
Advanced Adaptive Trailing Stop (AATS): This is a highly sophisticated volatility stop. It calculates market structure using Hirashima Sugita (HSRS) levels and Bollinger Bands to determine the "floor" and "ceiling" of price action.
If volatility is high: The stop loosens to prevent wicking out.
If volatility is low: The stop tightens to protect profit.
D. Repainting Protection
Many Pine Script strategies look great in backtesting but fail in live trading because they rely on "real-time" price data that disappears when the candle closes.
This Risk Management engine explicitly pulls data from the previous candle close (close[1], high[1], low[1]) for its calculations. This ensures that the backtest results you see match the reality of live execution.
4. For Developers & Modders
We encourage you to tear this code apart!
Look for the section titled // Super-AO Strategy Logic.
Replace that block with your own RSI, MACD, or Price Action logic.
Ensure your logic outputs a 2 for Buy and -2 for Sell.
Connect it to RM_EngineInput.
You now have a fully functioning Risk Management system for your custom strategy.
5. About Signal Lynx
Automation for the Night-Shift Nation 🌙
This code has been in action since 2022 and is a known performer in PineScript v5. We provide this open source to help the community build better, safer automated systems.
If you are looking to automate your strategies, please take a look at Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source). If you make beneficial modifications, please release them back to the community!
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
Welcome to the Super-AO Strategy. This is more than just a buy/sell indicator; it is a complete, open-source Risk Management (RM) Template designed for the Pine Script community.
At its core, this script implements a robust swing-trading strategy combining the SuperTrend (for macro direction) and the Awesome Oscillator (for momentum). However, the real power lies under the hood: a custom-built Risk Management Engine that handles trade states, prevents repainting, and manages complex exit conditions like Staged Take Profits and Advanced Adaptive Trailing Stops (AATS).
We are releasing this code to help traders transition from simple indicators to professional-grade strategy structures.
2. Quick Action Guide (TL;DR)
Best Timeframe: 4 Hours (H4) and above. Designed for Swing Trading.
Best Assets: "Well-behaved" assets with clear liquidity (Major Forex pairs, BTC, ETH, Indices).
Strategy Type: Trend Following + Momentum Confirmation.
Key Feature: The Risk Management Engine is modular. You can strip out the "Super-AO" logic and insert your own strategy logic into the template easily.
Repainting: Strictly Non-Repainting. The engine calculates logic based on confirmed candle closes.
3. Detailed Report: How It Works
A. The Strategy Logic: Super-AO
The entry logic is based on the convergence of two classic indicators:
SuperTrend: Determines the overall trend bias (Green/Red).
Awesome Oscillator (AO): Measures market momentum.
The Signal:
LONG (+2): SuperTrend is Green AND AO is above the Zero Line AND AO is Rising.
SHORT (-2): SuperTrend is Red AND AO is below the Zero Line AND AO is Falling.
By requiring momentum to agree with the trend, this system filters out many false signals found in ranging markets.
B. The Risk Management (RM) Engine
This script features a proprietary State Machine designed by Signal Lynx. Unlike standard strategies that simply fire orders, this engine separates the Signal from the Execution.
Logic Injection: The engine listens for a specific integer signal: +2 (Buy) or -2 (Sell). This makes the code a Template. You can delete the Super-AO section, write your own logic, and simply pass a +2 or -2 to the RM_EngineInput variable. The engine handles the rest.
Trade States: The engine tracks the state of the trade (Entry, In-Trade, Exiting) to prevent signal spamming.
Aggressive vs. Conservative:
Conservative Mode: Waits for a full trend reversal before taking a new trade.
Aggressive Mode: Allows for re-entries if the trend is strong and valid conditions present themselves again (Pyramiding Type 1).
C. Advanced Exit Protocols
The strategy does not rely on a single exit point. It employs a "Layered Defense" approach:
Hard Stop Loss: A fixed percentage safety net.
Staged Take Profits (Scaling Out): The script allows you to set 3 distinct Take Profit levels. For example, you can close 10% of your position at TP1, 10% at TP2, and let the remaining 80% ride the trend.
Trailing Stop: A standard percentage-based trailer.
Advanced Adaptive Trailing Stop (AATS): This is a highly sophisticated volatility stop. It calculates market structure using Hirashima Sugita (HSRS) levels and Bollinger Bands to determine the "floor" and "ceiling" of price action.
If volatility is high: The stop loosens to prevent wicking out.
If volatility is low: The stop tightens to protect profit.
D. Repainting Protection
Many Pine Script strategies look great in backtesting but fail in live trading because they rely on "real-time" price data that disappears when the candle closes.
This Risk Management engine explicitly pulls data from the previous candle close (close[1], high[1], low[1]) for its calculations. This ensures that the backtest results you see match the reality of live execution.
4. For Developers & Modders
We encourage you to tear this code apart!
Look for the section titled // Super-AO Strategy Logic.
Replace that block with your own RSI, MACD, or Price Action logic.
Ensure your logic outputs a 2 for Buy and -2 for Sell.
Connect it to RM_EngineInput.
You now have a fully functioning Risk Management system for your custom strategy.
5. About Signal Lynx
Automation for the Night-Shift Nation 🌙
This code has been in action since 2022 and is a known performer in PineScript v5. We provide this open source to help the community build better, safer automated systems.
If you are looking to automate your strategies, please take a look at Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source). If you make beneficial modifications, please release them back to the community!
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Free Scripts supporting Automation for the Night-Shift Nation. 🌙
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Free Scripts supporting Automation for the Night-Shift Nation. 🌙
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.