OPEN-SOURCE SCRIPT

Breakout Detector (Previous MTF High Low Levels) [LuxAlgo]

ที่อัปเดต:
The Breakout Detector (Previous MTF High Low Levels) indicator highlights breakouts of previous high/low levels from a higher timeframe.

The indicator is able to: display take-profit/stop-loss levels based on a user selected Win/Loss ratio, detect false breakouts, and display a dashboard with various useful statistics.

Do note that previous high/low levels are subject to backpainting, that is they are drawn retrospectively in their corresponding location. Other elements in the script are not subject to backpainting.

🔶 USAGE

สแนปชอต

Breakouts occur when the price closes above a previous Higher Timeframe (HTF) High or below a previous HTF Low.

On the advent of a breakout, the closing price acts as an entry level at which a Take Profit (TP) and Stop Loss (SL) are placed. When a TP or SL level is reached, the SL/TP box border is highlighted.

สแนปชอต

When there is a breakout in the opposite direction of an active breakout, previous breakout levels stop being updated. Not reaching an SL/TP level will result in a partial loss/win,
which will result in the box being highlighted with a dotted border (default). This can also be set as a dashed or solid border.

สแนปชอต

สแนปชอต

Detection of False Breakouts (default on) can be helpful to avoid false positives, these can also be indicative of potential trend reversals.

สแนปชอต

This indicator contains visualization when a new HTF interval begins (thick vertical grey line) and a dashboard for reviewing the breakout results (both defaults enabled; and can be disabled).

As seen in the example above, the active, open breakout is colored green/red.

สแนปชอต

You can enable the setting 'Cancel TP/SL at the end of HTF', which will stop updating previous TP/SL levels on the occurrence of a new HTF interval.

🔶 DETAILS

🔹 Principles

สแนปชอต

  • Every time a new timeframe period starts, the previous high and low are detected of the higher timeframe. On that bar only there won't be a breakout detection.
  • A breakout is confirmed when the close price breaks the previous HTF high/low
  • A breakout in the same direction as the active breakout is ignored.
  • A breakout in the opposite direction stops previous breakout levels from being updated.
  • Take Profit/Stop Loss, partially or not, will be highlighted in an easily interpretable manner.


สแนปชอต

สแนปชอต

🔹 Set Higher Timeframe

There are 2 options for choosing a higher timeframe:

สแนปชอต

• Choose a specific higher timeframe (in this example, Weekly higher TF on a 4h chart)

สแนปชอต

• Choose a multiple of the current timeframe (in this example, 75 minutes TF on a 15 min chart - 15 x 5)

Do mind, that when using this option, non-standard TFs can give less desired timeframe changes.

สแนปชอต

🔹 Setting Win/Loss Levels

สแนปชอต
The Stop Loss (SL) / Take Profit (TP) setting has 2 options:

  • W%:L% : A fixed percentage is chosen, for TP and SL.
  • W:L : In this case L (Loss-part) is set through Loss Settings, W (Win-part) is calculated by multiplying L, for example W : L = 2 : 1, W will be twice as large as the L.


🔹 Loss Settings

สแนปชอต

The last drawing at the right is still active (colored green/red)

สแนปชอต

The Loss part can be:
  • A multiple of the Average True Range (ATR) of the last 200 bars.
  • A multiple of the Range Cumulative Mean (RCM).
  • The Latest Swing (with Length setting)


Range Cumulative Mean is the sum of the Candle Range (high - low) divided by its bar index.

🔹 False Breakouts

สแนปชอต

A False Breakout is confirmed when the price of the bar immediately after the breakout bar returns above/below the breakout level.

สแนปชอต

🔹 Dashboard

สแนปชอต

🔶 ALERTS

This publication provides several alerts

  • Bullish/Bearish Breakout: A new Breakout.
  • Bullish/Bearish False Breakout: False Breakout detected, 1 bar after the Breakout.
  • Bullish/Bearish TP: When the TP/profit level has been reached.
  • Bullish/Bearish Fail: When the SL/stop-loss level has been reached.

Note that when a new Breakout causes the previous Breakout to stop being updated, only an alert is provided of the new Breakout.

🔶 SETTINGS

🔹 Set Higher Timeframe

  • Option: HTF/Mult
  • HTF: When HTF is chosen as Option, set the Higher Timeframe (higher than current TF)
  • Mult: When Mult is chosen as Option, set the multiple of current TF (for example 3, curr. TF 15min -> 45min)


🔹 Set Win/Loss Level

  • SL/TP: W:L or W%:L%: Set the Win/Loss Ratio (Take Profit/Stop Loss)
    W : L: Set the Ratio of Win (TP) against Loss (SL). The L level is set at Loss Settings
    W% : L%: Set a fixed percentage of breakout price as SL/TP


🔹 Loss Settings

When W : L is chosen as SL/TP Option, this sets the Loss part (L)
  • Base:
    RCM: Range Cumulative Mean
    ATR: Average True Range of last 200 bars
    Last Swing: Last Swing Low when bullish breakout, last Swing High when bearish breakout
  • Multiple: x times RCM/ATR
  • Swing Length: Sets the 'left' period ('right' period is always 1)
  • Colours: colour of TP/SL box and border
  • Borders: Style border when breakout levels stop being updated, but TP/SL is not reached. (Default dotted dot, other option is dashed dsh or solid sol)


🔹 Extra

  • Show Timeframe Change: Show a grey vertical line when a new Higher Timeframe interval begins
  • Detect False Outbreak
  • Cancel TP/SL at end of HTF


🔹 Show Dashboard

  • Location: Location of the dashboard (Top Right or Bottom Right/Left)
  • Size: Text size (Tiny, Small, Normal)


See USAGE/DETAILS for more information
เอกสารเผยแพร่
Fixed issue preventing alerts from working
breakoutbreakoutsignalbreakouttradingfalsebreakoutluxalgomultitimeframepdhlPivot points and levelspriceactionreversalTrend Analysis

สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?


Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
และใน:

คำจำกัดสิทธิ์ความรับผิดชอบ