HeWhoMustNotBeNamed

Auto Harmonic Pattern - UltimateX [Trendoscope]

IMPORTANT NOTE: (Read this before looking at any other thing on this indicator)

This indicator is created to supersede existing Auto-Harmonic-Pattern-Ultimate-Trendoscope invite only script. The script deviates a lot from the original Auto Harmonic Patterns Ultimate script in terms of number of available patterns, trading type and few other things. Hence, instead of updating the existing script, we have just decided to release as new script. Few FAQs in this regard are as below

What it means for users of AHPU and new users?
▶ Subscription of this script is not sold separately, but will be offered along with existing AHPU script. Meaning, there will be single subscription for both scripts together.
▶ All existing subscribers of AHPU will also get access to this script for the duration of their subscription term. Will start adding access to users starting from lifetime subscribers first.
▶ Any new subscriptions to AHPU will also get access to both the scripts together. We will eventually look to phase out existing AHPU once users are accustomed to new script and any possible bugs are resolved.
▶ Any trial requests will also get access to both scripts. You can request trial even if you have recently requested trial for AHPU.

Why did we create new script instead of updating the existing one?
▶ As mentioned before, this script deviates a lot from the original AHPU. Hence, it is released as new version to make sure smoother transition of users. If anyone is not comfortable using the new version, they can continue using the existing AHPU script until things settle down.
▶ Since the script is new implementation, it may also have initial bugs. It will help us resolve it in more streamlined way.

What are the main differences between these scripts?
▶ Uses single zigzag instead of multi as algorithm is further improved to detect almost everything using single zigzag .
▶ More number of patterns added. But, new patterns are disabled by default as some of them have very wide PRZ. Users can enable it via settings.
▶ Trading type with trailing entry - With wide PRZs, we also had to implement different method for calculating entry/stop. This is explained later in the script.
▶ Matrix implementation and enhanced stats - Entire implementation is redesigned to use matrix data structure instead of arrays. This allows lots of possibilities including enhanced closed trade stats.
Support/Resistance widget is removed as it is proving to be bit of overhead. Users can make use of Support Resistance widget script which is a free to use script instead.

Let's get to the details of indicator now. As with any other harmonic pattern based script, this is combined work of myself and @cryptoarch_ and we both co-own the rights to this work.

🎲 Indicator Components

🎯 Patterns Covered
● Classic Patterns
● Anti/Alternate Patterns
● Non-Standard Patterns (Disabled by default)


Below is a quick snapshot of indicator components.

Now, lets look at some of the individual components:

🎯 Open trade stats helps recognise trades in motion.

Apart from regular stats, it also contain different types of risk reward ratios.

  • Regular RR : RR calculated from entry to reach target with initial stop for risk consideration
  • Trailing RR : This is RR calculated for price to reach from one target to next target considering trailing stop for calculating risk
  • Live RR : This is calculated based on current price as entry and with given targets and stop levels. Live RR will be blank for targets which are already reached.

Targets are calculated only when entry is made. Hence, target details are not shown for patterns where it is still awaiting entry.


🎯 Closed trade stats helps understand historical performance of patterns.

By default closed stats are displayed in Compact mode. Which means, only total stats are shown. But, users can change this to show detailed stats via settings. Detailed stats take up entire screen most of the time. So, keep them only if it is required.


Closed stats present average Risk Reward, Trailing Risk Reward, Average Win Rate, and Average Trailing Win Rate for all the possible levels. As discussed before.

  • Regular RR : RR calculated from entry to reach target with initial stop for risk consideration
  • Trailing RR : This is RR calculated for price to reach from one target to next target considering trailing stop for calculating risk
  • Win Rate : Simple win rate calculation based on number of patterns reached target and number of valid patterns.
  • Trailing Win Rate : This is win rate calculated based on previous target to current target.

For example, if there are 48 valid patterns and out of which 24 patterns reach target1 and 12 patterns out of 24 reach target 2
Target1 WR : 50% (24/48)
Target1 TWR : Not applicable as there is no target before Target1
Target2 WR : 25% (12/48)
Target2 TWR : 50% (12/24)

🎲 Settings

Tooltips are provided to help with each and every settings. And they are as below.



🎲 Fully Customisable Alerts - Placeholders

Alerts are created via alert() method of pine. Hence, users will not see message box for alert template on alert widget.

Instead alerts widget look something like this:


To overcome this issue, script provides alert template placeholders as part of settings. In settings, you can already see Alert section where you can enable/disable alerts for different events.

▶ New Pattern Detection
▶ Entry Reached
▶ Target1-4 Reached
▶ Stop price reached
▶ Trade Complete - either by stop or reaching target 4

You can use following placeholders in the given text boxes to create your own alert template.

🎯 Common placeholders which are applicable for all alerts
{type} - Alert Type
- New Harmonic Pattern
- Harmonic Pattern Status Update
- Harmonic Pattern Trade Closure
{id} - Pattern Id. This is not fully unique id. But, this will be unique for all open trades. Once trade is closed, Ids are reused whenever feasible.
{ticker} - Ticker information
{timeframe} - Timeframe information
{price} - Current close price
{patterns} - Possible patterns for the projections or PRZ.
{direction} - Trade direction - Bullish or bearish
{entry} - Calculated entry for pattern
{stop} - Calculated stop for pattern
{tstop} - Trailing stop for the pattern in trade
{target1} - Target1 for pattern in trade
{target2} - Target2 for pattern in trade
{target3} - Target3 for pattern in trade
{target4} - Target4 for pattern in trade


🎯 There are few specific placeholders, which are applicable for some alert types.
Harmonic Pattern Status Update
{status} - Status of the Pattern in trade
{laststatus} - Previous status of the Pattern in trade

Harmonic Pattern Trade Closure
{result} - Trade result upon closure
Release Notes: Update 1.1

  • Removed failed patterns from closed stats as this causing confusion. You can still get failed patterns details by looking at the total which contains two numbers. /. Difference is the number of failed patterns count.
  • Removed Stopped patterns from closed stats as this number can be easily derived from Win rate of target1. Stopped Percent = 100 - Target1 Win Rate
Release Notes: No change in version. Just updated chart :)
Release Notes: Update Ux1.2

Added option for selective display of closed stats where it shows totals and detailed stats only for the patterns which are open.

Release Notes: Update Ux1.3

Updated available options for Base - which is used for calculating target levels. But, the default value is still kept as min.

Fixed a minor bug in trailing.
Release Notes: Update Ux1.4

Added an option to use confirmed bar. This means, the current bar where high/low can change will not be used for any calculation. This is done to give an option for those who want to use alerts.


Pros
  • When using real time bar, signal can waver and may lead to pattern forming and moving out of range. Hence, you may get an alert on new pattern, but, you may not see that on chart because it has gone out of range and pattern is deleted. It does not impact stats much. But, it does indeed give some troubles for those who want to use alerts. Using confirmed bar reduces this issue.

Cons
  • Alerts are delayed by one bar. Which also mean that you can miss potential entry. However, it becomes easy for those who want to trade by setting stop limit orders as you would know the stop limit entry prices before hand.
Release Notes: Update Ux1.5

Minor bug fixes on the previously released feature of 'Use confirmed bars'
Release Notes: Update Ux1.6

Fix recurring alert issue.
Release Notes: Update Ux1.7

Added options to filter trades by supertrend or moving average. You can see the relevant options in settings. They are disabled by default.


Impact of applying the settings can be studied in closed trade stats.
Release Notes: Update Ux1.8

This version mainly intends to fix the issue came up against alerts. It looks like alert timed out due to having too many settings. Due to this, had to remove several less used settings to make it work.

Hence, I have removed following settings:
  • Open Stat Options to show RR/Trailing and Current RR/XABCD - RR options are hardcoded to true whereas XABCD option is hardcoded to false
  • Bullish/Bearish color options removed and are hardcoded to green and red
  • Start/End Range option is removed. Script runs for maximum possible range

Will try to reintroduce them if required when alert issues are resolved.
Release Notes: Major Update Ux1.9

  • Using lightweight private libraries to increase performance. Private Libraries were not allowed earlier to be used in invite only scripts. Thanks to tradingview's recent updates. It is very much possible now. Due to this, libraries used can be restricted to minimal required in order to improve load time and avoid errors.
  • Removed confirmed Bar option as it was creating some confusion among the users.
  • Added option to Ignore patterns if entry already reached on the D bar. This can help those who prefer to trade on confirmed bars. This does not work in same way as now removed confirmed bar option. But, it is targeted for users with similar trading style.
  • Added two more placeholders for alert template. {pivots} and {targets} which gets replaced with array of pivots and targets respectively
  • Added a new type of alert called summary alert which is disabled by default. When enabled, alerts are triggered once per bar close containing the summary of all patterns in trade.
  • Limiting the backtest range is introduced back. But instead of providing date based filter, providing bars based filter. This is more adoptable to different timeframes as available backtest timeframes are usually from 20k to 30k

Apart from the efforts have been done to increase the accuracy and consistency of alerts. Thanks to few users (@boost_inc, @leoebbert, @satoribr) who have been thoroughly testing this and coming with more details on shortcomings.
Release Notes: Update Ux2.0

  • Pattern size and age (in terms of bars) is shown in open trade stats
  • Average Pattern size is added to the total column of closed stats.
  • Tooltips are added to closed stats table. Hover on any cell to see more information.
  • Options added not to display additional details such as risk reward, percentage etc. on open stats.
  • Added option to filter patterns by size (number of bars)
Release Notes: Update Ux2.1

One last update before boarding my flight.

  • Pattern size data is added for individual patterns and each targets as well. Can see them when percentage mode is off.
  • Apart from tracking entry, the script now also tracks how many of the patterns retest before reaching targets. This stat is helpful for traders who want to play safe by waiting for entry signal and then place limit order. Again, retest data is added to both open stats table and for all pattern and target breakdown of closed stats.
  • Tooltips to provide more info about the stats shown in closed stats table. Just hover on the tables to understand more about the data being presented.
Release Notes: Update U2.2

Added option to make use of recursive zigzag algorithm. Also moved some of the logic to private libraries to support faster execution.
Release Notes: Update 2.3

Quick fix of runtime error on higher timeframes.
Release Notes: Update Ux2.4

Few bugfixes
  • Fix highlighting issue
  • Fix issue related to separator in pattern names
Release Notes: Update Ux2.5

Updated library version for zigzag
Release Notes: Update Ux2.6

  • Added pattern size percentage filter for filter options
  • Added option to suppress updates on D bar
  • Fixed alert bug related to individual targets
Release Notes:
  • Fixed filter related issues for rZigzag method
  • Removed 'Suppress Alerts on D Bar' option as it created some other issues in real time alerts.
  • Removed varip based variables to track alerts as it was causing delays
Release Notes: Update Ux2.8

  • Fix few user reported issues and minor bug related to D bar repainting.
  • Removed Supertrend and Moving average based trend filters. (These can be added as external input now)
  • Added option to include an external input to filter trades. This means, you can build your own custom trend based scripts and use it with AHPUx to filter trades. Will also try to provide few sample filters in coming days.
  • Converted alert template from string to text area input to enhance visibility and ease of use.

Release Notes: Update Ux2.9

Enhanced External filter conditions also to allow bi-directional trades. With this new format of the external condition is:

  • 1 : Long Only
  • -1 : Short Only
  • 0 : No trades allowed
  • 2 : Allow both directions
Release Notes: Update Ux3.0

Minor correction on default alert template
Release Notes: Update Ux3.1

Few bug fixes related to trailing and delayed pattern recognition.

Request trial access: https://www.trendoscope.au/contact-us
Reach me on telegram: https://t.me/HeWhoMustNotBeNaamed
Join tradingview: https://www.tradingview.com/gopro/?share_your_love=sudh
USDT (TRC20): TCaz4CG9aZyR4jp3Ygf7MESWJPmcJgoep5
Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact HeWhoMustNotBeNamed for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases you can find a good open-source alternative for free in our Community Scripts.

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.

Author's instructions

Trial: https://www.trendoscope.au/contact-us Purchase/Subscribe: https://www.trendoscope.au/algorithms

Want to use this script on a chart?

Warning: please read before requesting access.