OPEN-SOURCE SCRIPT

Alpha - Combined Breakout

355
This Pine Script indicator, "Alpha - Combined Breakout," is a combination between Smart Money Breakout Signals [AlgoAlpha] and UT Bot Alert, The UT Bot Alert indicator was initially developer by Yo_adriiiiaan
The idea of original code belongs HPotter.

This Indicator helps you identify potential trading opportunities by combining two distinct strategies: Smart Money Breakout and a modified UT Bot (likely a variation of the Ultimate Trend Bot). It provides visual signals, draws lines for potential take profit (TP) and stop loss (SL) levels, and includes a dashboard to track performance metrics.

Tutorial:
Understanding and Using the "Alpha - Combined Breakout" Indicator
This indicator is designed for traders looking for confirmation of market direction and potential entry/exit points by blending structural analysis with a trend-following oscillator.

How it Works (General Concept)
The indicator combines two main components:

Smart Money Breakout: This part identifies significant breaks in market structure, which "smart money" traders often use to gauge shifts in supply and demand. It looks for higher highs/lows or lower highs/lows and flags when these structural points are broken.

UT Bot: This is a trend-following component that generates buy and sell signals based on price action relative to an Average True Range (ATR) based trailing stop.

You can choose to use these signals independently or combined to generate trading alerts and visual cues on your chart. The dashboard provides a quick overview of how well the signals are performing based on your chosen settings and display mode.

Parameters and What They Do
Let's break down each input parameter:

1. Smart Money Inputs
These settings control how the indicator identifies market structure and breakouts.

swingSize (Market Structure Time-Horizon):

What it does: This integer value defines the number of candles used to identify significant "swing" (pivot) points—highs and lows.

Effect: A larger swingSize creates a smoother market structure, focusing on longer-term trends. This means signals might appear less frequently and with some delay but could be more reliable for higher timeframes or broader market movements. A smaller swingSize will pick up more minor market structure changes, leading to more frequent but potentially noisier signals, suitable for lower timeframes or scalping.

Analogy: Think of it like a zoom level on your market structure map. Higher values zoom out, showing only major mountain ranges. Lower values zoom in, showing every hill and bump.

bosConfType (BOS Confirmation Type):

What it does: This string input determines how a Break of Structure (BOS) is confirmed. You have two options:

'Candle Close': A breakout is confirmed only if a candle's closing price surpasses the previous swing high (for bullish) or swing low (for bearish).

'Wicks': A breakout is confirmed if any part of the candle (including its wick) surpasses the previous swing high or low.

Effect: 'Candle Close' provides stronger, more conservative confirmation, as it implies sustained price movement beyond the structure. 'Wicks' provides earlier, more aggressive signals, as it captures momentary breaches of the structure.

Analogy: Imagine a wall. 'Candle Close' means the whole person must get over the wall. 'Wicks' means even a finger touching over the top counts as a breach.

choch (Show CHoCH):

What it does: A boolean (true/false) input to enable or disable the display of "Change of Character" (CHoCH) labels. CHoCH indicates the first structural break against the current dominant trend.

Effect: When true, it helps identify early signs of a potential trend reversal, as it marks where the market's "character" (its tendency to make higher highs/lows or lower lows/highs) first changes.

BULL (Bullish Color) & BEAR (Bearish Color):

What they do: These color inputs allow you to customize the visual appearance of bullish and bearish signals and lines drawn by the Smart Money component.

Effect: Purely cosmetic, helps with visual identification on the chart.

sm_tp_sl_multiplier (SM TP/SL Multiplier (ATR)):

What it does: A float value that acts as a multiplier for the Average True Range (ATR) to calculate the Take Profit (TP) and Stop Loss (SL) levels specifically when you're in "Smart Money Only" mode. It uses the ATR calculated by the UT Bot's nLoss_ut as its base.

Effect: A higher multiplier creates wider TP/SL levels, potentially leading to fewer trades but larger wins/losses. A lower multiplier creates tighter TP/SL levels, potentially leading to more frequent but smaller wins/losses.

2. UT Bot Alerts Inputs
These parameters control the behavior and sensitivity of the UT Bot component.

a_ut (UT Key Value (Sensitivity)):

What it does: This integer value adjusts the sensitivity of the UT Bot.

Effect: A higher value makes the UT Bot less sensitive to price fluctuations, resulting in fewer and potentially more reliable signals. A lower value makes it more sensitive, generating more signals, which can include more false signals.

Analogy: Like a noise filter. Higher values filter out more noise, keeping only strong signals.

c_ut (UT ATR Period):

What it does: This integer sets the look-back period for the Average True Range (ATR) calculation used by the UT Bot. ATR measures market volatility.

Effect: This period directly influences the calculation of the nLoss_ut (which is a_ut * xATR_ut), thus defining the distance of the trailing stop loss and take profit levels. A longer period makes the ATR smoother and less reactive to sudden price spikes. A shorter period makes it more responsive.

h_ut (UT Signals from Heikin Ashi Candles):

What it does: A boolean (true/false) input to determine if the UT Bot calculations should use standard candlestick data or Heikin Ashi candlestick data.

Effect: Heikin Ashi candles smooth out price action, often making trends clearer and reducing noise. Using them for UT Bot signals can lead to smoother, potentially delayed signals that stay with a trend longer. Standard candles are more reactive to raw price changes.

3. Line Drawing Control Buttons
These crucial boolean inputs determine which type of signals will trigger the drawing of TP/SL/Entry lines and flags on your chart. They act as a priority system.

drawLinesUtOnly (Draw Lines: UT Only):

What it does: If checked (true), lines and flags will only be drawn when the UT Bot generates a buy/sell signal.

Effect: Isolates UT Bot signals for visual analysis.

drawLinesSmartMoneyOnly (Draw Lines: Smart Money Only):

What it does: If checked (true), lines and flags will only be drawn when the Smart Money Breakout logic generates a bullish/bearish breakout.

Effect: Overrides drawLinesUtOnly if both are checked. Isolates Smart Money signals.

drawLinesCombined (Draw Lines: UT & Smart Money (Combined)):

What it does: If checked (true), lines and flags will only be drawn when both a UT Bot signal AND a Smart Money Breakout signal occur on the same bar.

Effect: Overrides both drawLinesUtOnly and drawLinesSmartMoneyOnly if checked. Provides the strictest entry criteria for line drawing, looking for strong confluence.

Dashboard Metrics Explained
The dashboard provides performance statistics based on the lines drawing control button selected. For example, if "Draw Lines: UT Only" is active, the dashboard will show stats only for UT Bot signals.

Total Signals: The total number of buy or sell signals generated by the selected drawing mode.

TP1 Win Rate: The percentage of signals where the price reached Take Profit 1 (TP1) before hitting the Stop Loss.

TP2 Win Rate: The percentage of signals where the price reached Take Profit 2 (TP2) before hitting the Stop Loss.

TP3 Win Rate: The percentage of signals where the price reached Take Profit 3 (TP3) before hitting the Stop Loss. (Note: TP1, TP2, TP3 are in order of distance from entry, with TP3 being furthest.)

SL before any TP rate: This crucial metric shows the number of times the Stop Loss was hit / the percentage of total signals where the stop loss was triggered before any of the three Take Profit levels were reached. This gives you a clear picture of how often a trade resulted in a loss without ever moving into profit target territory.

Short Tutorial: How to Use the Indicator
Add to Chart: Open your TradingView chart, go to "Indicators," search for "Alpha - Combined Breakout," and add it to your chart.

Access Settings: Once added, click the gear icon next to the indicator name on your chart to open its settings.

Choose Your Signal Mode:

For UT Bot only: Uncheck "Draw Lines: Smart Money Only" and "Draw Lines: UT & Smart Money (Combined)". Ensure "Draw Lines: UT Only" is checked.

For Smart Money only: Uncheck "Draw Lines: UT Only" and "Draw Lines: UT & Smart Money (Combined)". Ensure "Draw Lines: Smart Money Only" is checked.

For Combined Signals: Check "Draw Lines: UT & Smart Money (Combined)". This will override the other two.

Adjust Parameters:

Start with default settings. Observe how the signals appear on your chosen asset and timeframe.

Refine Smart Money: If you see too many "noisy" market structure breaks, increase swingSize. If you want earlier breakouts, try "Wicks" for bosConfType.

Refine UT Bot: Adjust a_ut (Sensitivity) to get more or fewer UT Bot signals. Change c_ut (ATR Period) if you want larger or smaller TP/SL distances. Experiment with h_ut to see if Heikin Ashi smoothing suits your trading style.

Adjust TP/SL Multiplier: If using "Smart Money Only" mode, fine-tune sm_tp_sl_multiplier to set appropriate risk/reward levels.

Interpret Signals & Lines:

Buy/Sell Flags: These indicate the presence of a signal based on your selected drawing mode.

Entry Line (Blue Solid): This is where the signal was generated (usually the close price of the signal candle).

SL Line (Red/Green Solid): Your calculated stop loss level.

TP Lines (Dashed): Your three calculated take profit levels (TP1, TP2, TP3, where TP3 is the furthest target).

Smart Money Lines (BOS/CHoCH): These lines indicate horizontal levels where market structure breaks occurred. CHoCH labels might appear at the first structural break against the prior trend.

Monitor Dashboard: Pay attention to the dashboard in the top right corner. This dynamically updates to show the win rates for each TP and, crucially, the "SL before any TP rate." Use these statistics to evaluate the effectiveness of the indicator's signals under your current settings and chosen mode.
*

Set Alerts (Optional): You can set up alerts for any of the specific signals (UT Bot Long/Short, Smart Money Bullish/Bearish, or the "Line Draw" combined signals) to notify you when they occur, even if you're not actively watching the chart.

By following this tutorial, you'll be able to effectively use and customize the "Alpha - Combined Breakout" indicator to suit your trading strategy.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。