Trendoscope

Auto Harmonic Projection - Ultimate [Trendoscope]

Trendoscope Wizard Updated   
Hello traders, Many who used Auto Harmonic Pattern - Ultimate had enquired with me about having option to project PRZ before patterns formed. We always replied that it is in pipeline but will not be part of existing script. Finally, we decided to utilise part of our Christmas and new year break to make it happen.

Lets get started..

⬜ Process

▶ Unlike Auto Harmonic Patterns Ultimate, instead of scanning whole XABCD for harmonic pattern, this script only collects XABC and projects PRZs (Possible D zones)
▶ Once possible patterns are found, lines are drawn to connect XABC and boxes to project PRZs. There can be more than 1 PRZs for XABC combination. If PRZs of multiple patterns overlap, they are joined and shown as single PRZ where all patterns are listed against it.
▶ If price crosses C, pattern is considered as failed. If price stays between C and PRZs for long time, patterns are timed out. In either case, patterns and projections are removed from chart.
▶ Pattern is considered to be active once price reach B. Until then Pattern is inactive.
▶ PRZs are tracked individually even if they belong to same pattern. PRZ is considered active only if price hits PRZ and completes the pattern. Till then PRZ is considered inactive.
▶ After activating, PRZs can either reach successful level if price moves in reversal direction. Or it can reach failure if price reaches stop.
▶ PRZs are removed from chart once it either reaches stop or success level. But, if more PRZs are present for pattern, pattern will still be there on chart.
▶ Pattern is kept active till all the PRZs are either hit stop or success or pattern itself is either failed or timed out.

Note:
  • Whenever we refer pattern - consider it as lines joining X, A, B, C and D if PRZ is active.
  • Wherever we refer PRZ - consider it as box representing potential reversal zones.

⬜ Screen components

▶ Inactive Patterns and PRZ - Patterns with inactive PRZs are represented as lines joining XABC. There will not be line connecting D and PRZs are shown with faded colour and smaller fonts.
▶ Active Patterns and PRZ - Patterns with active PRZ are represented with full pattern and line fills. PRZ will also show stop and success level. Note that success level is not target level - but a position used for validating the outcome.
▶ Stats table - Open stats table contains patterns and corresponding PRZ levels. Stats will have red background for bearish patterns/projections and green background for bullish patterns/projections. Content text colour is matched with that of PRZ and Pattern line colors so that users can identify the matching stats easily.
▶ Run timer - Tells how long the script backtest is running. Run timer will have red background for TRIAL access or if right access key is not used. Otherwise, it will have green background colour. This does not have much significance now as there are no closed stats available. It will be added in the future versions.
▶ Watermark - Watermark appears only if valid key is not used or TRIAL access key is used.


Bit more details about open stats table here


⬜ Settings
⚪ Alert Key
Alert key is given for active subscribers. This key is required in order to set alerts or in order to run the script for more than 30 bars on single instrument without interruption. Not having alert key will not stop users from using the indicator once they acquire access - but it will only limit few capabilities. Key is not given for trial access.

Key is prompted every time users add indicator to chart. If you are provided with key, please use it instead of the TRIAL access key.

If you are using valid key,
  • You will see run timer in green instead of red background
  • No TRIAL ACCESS watermark on the chart.

⚪ Zigzag and pattern detection settings
⚪ Pattern Selection settings
⚪ Stats and Display
⚪ Colors and themes
⚪ Backtest Settings
Not important for now as there are no closed pattern stats. Kept for future usage. Will impact the timer widget.

⚪ Alerts
▶ Types and settings

▶Setting alerts is simple. When indicator is loaded on chart (Make sure you are using the right alert key), goto alerts and select the AHProjection from Condition dropdown. Update other parameters such as alert name, webhook details as required and press create

▶ Examples of alerts

⬜ Status Tracking
Script tracks two types of statuses.
⚪ Harmonic Pattern Projection Status : Tracks projection as a whole for each combination of X, A, B, C. Different states available are
  • Awaiting Activation : Any pattern projection when formed by default goes into Inactive State and hence set to Awaiting Activation.
  • Projection Active : Once price reach B, then pattern projection is considered active
  • Entry Reached : Once price reach the nearest PRZ level, it is considered as Entry reached. Status will remain as entry reached even if PRZ is removed and next PRZ level is yet to be reached.
  • Projection Invalidated : If price goes beyond C level, then pattern projection is considered invalidated. It can happen at any stage and even after successful completion of few PRZ ranges.
  • Projection Timed Out : If price keeps between PRZ and C for considerable time, it will timed out and removed from chart.

⚪ Harmonic Pattern Projection PRZ Status Tracks individual PRZs separately which may or may not belong to same patterns. Different states available are
  • Awaiting Activation : Any PRZ is considered inactive before price reaching the PRZ level.
  • Active : Once price reaches PRZ, it will become active. Active PRZs are highlighted with line fill on chart. Active PRZ also display success and stop levels. PRZ is not removed unless price hits one of these levels or the entire pattern is timed out.
  • Successful : If an active PRZ price reaches success level, then PRZ projection is considered successful. Once successful, PRZ will removed from chart
  • Failed : If an active PRZ price reaches stop level, then PRZ projection is considered failure. Once failed PRZ will be removed from chart.
Release Notes:
Minor calculation updates.
Release Notes:
V1.2 Minor bugfixes
Release Notes:
V1.3 - Minor updates to PRZ calculation
Release Notes:
U 1.0 Reboot

We are going to reboot the versioning for both AHPU and AHProjection due to major re-architecture of algorithm. This version also has several major updates.

🎲 Architectural update
Major re-architecture in our scanning algorithm allows us to scan more patterns without much compromise with respect to performance. With this change, 90% of the patterns or projections are identified with the first zigzag of length 5. Hence for better performance, disable other three zigzags from the settings.

We have also added option to set individual depths for each zigzag to give users better control on what they want to scan.

🎲 Fully customisable alerts are here!!
No more single static format alerts. You can customise the alerts the way you want. To make this happen, we have provided following placeholders.

▶ Common placeholders which are applicable for all alerts
- Alert Type
- New Harmonic Pattern Projection
- Harmonic Pattern Projection Update
- Remove Harmonic Pattern Projection
- Harmonic Pattern Projection PRZ Updates
- 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 information
- Timeframe information
- Current close price
- Possible patterns for the projections or PRZ.
- Trade direction - Bullish or bearish

▶ There are few specific placeholders, which are applicable for some alert types.
New Harmonic Pattern Projection
- Start of PRZ range for the projection
- End of PRZ range for the projection
- Projection activation point - this is generally B
- Projection invalidation point - this is generally C

Harmonic Pattern Projection PRZ Updates
- PRZ start range
- PRZ end range
- target for PRZ to call it as successful
- Status of the PRZ
- Previous status of the PRZ

Remove Harmonic Pattern Projection
- Status of the Projection before close
- Projection activation point - this is generally B
- Projection invalidation point - this is generally C

Harmonic Pattern Projection Update
- Status of the Projection
- Previous status of the Projection.

By default, the values of alert template is set to generate the json based alerts as before.


For example, if you are only concerned about getting alerts with pattern and direction information, all you need to do is, before setting the alerts, update these fields to:

type:, ticker :, patterns : , direction : 

When you do this, your alert will only contain this info, This also helps for algo traders to set alerts as per the specification of their bot services.
Release Notes:
Apparently editor removed all the entries within "<>". Hence, I had to update "<>" with "{}"

With that, I will reiterate the fully customisable alerts feature.

🎲 Fully customisable alerts are here!!
No more single static format alerts. You can customise the alerts the way you want. To make this happen, we have provided following placeholders.

▶ Common placeholders which are applicable for all alerts
{type} - Alert Type
- New Harmonic Pattern Projection
- Harmonic Pattern Projection Update
- Remove Harmonic Pattern Projection
- Harmonic Pattern Projection PRZ Updates
{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

▶ There are few specific placeholders, which are applicable for some alert types.
New Harmonic Pattern Projection
{przstart} - Start of PRZ range for the projection
{przend} - End of PRZ range for the projection
{activation} - Projection activation point - this is generally B
{invalidation} - Projection invalidation point - this is generally C

Harmonic Pattern Projection PRZ Updates
{przstart} - PRZ start range
{przend} - PRZ end range
{orztarget} - target for PRZ to call it as successful
{status} - Status of the PRZ
{laststatus} - Previous status of the PRZ

Remove Harmonic Pattern Projection
{status} - Status of the Projection before close
{activation} - Projection activation point - this is generally B
{invalidation} - Projection invalidation point - this is generally C

Harmonic Pattern Projection Update
{status} - Status of the Projection
{laststatus} - Previous status of the Projection.

By default, the values of alert template is set to generate the json based alerts as before.


For example, if you are only concerned about getting alerts with pattern and direction information, all you need to do is, before setting the alerts, update these fields to:

type:{type}, ticker :{ticker}, patterns : {patterns}, direction : {direction}

When you do this, your alert will only contain this info, This also helps for algo traders to set alerts as per the specification of their bot services.
Release Notes:
Minor bugfix U1.1
Release Notes:
Minor bugfix U1.2
Release Notes:
Major update U2.0

Added Closed stats which can help traders to understand the probability of converting projection to pattern.

Other changes include:
  • Updating library references and moving out less important code to libraries
  • Removal of few redundant options from stats to make way for more features.
Release Notes:
Update U2.1

Removed the key input to make it simple for everyone :)
Release Notes:
Update U2.2

  • Added non-standard patterns using eHarmonicExtended Library
  • Update to use single zigzag and revised scanning algorithm which removes the necessity of multiple zigzags
  • Id generation is now made sequential
  • Updated alerts using library methods to avoid missing alerts
Release Notes:
Major Update U2.3

Apologies for the outage - whoever observed. While waiting for tradingview to resolve the platform issue, I thought why not do some updates to this script to make use of new pine features.

  • Using refined libraries to speed up the performance
  • Recursive Zigzag implementation
  • Added filters based on size, percent and external indicators - available via settings
  • Alert templates switched to text area in settings for better visibility
  • Updated to matrix based implementation
  • Tooltips added for all the required settings
Release Notes:
Major Update Ux2.4

Added option to scan patterns in log scale
Release Notes:
Update U2.5
Library updates
Release Notes:
Major Update U2.6

Added feature of Strict Ratio Scanning Mode. This feature is disabled by default. When enabled, the ratio checking includes error threshold only if there is no range.

For example, if the expected range of ratio is between 0.382 and 0.618, then no error threshold is applied for checking the valid ratios. But, if the expected ratio is a single ratio such as 0.618 and then error threshold is used to check between the ranges of 0.618+-error threshold.

Outcome of this option is mathematically more accurate patterns and less number of patterns. This feature is included as per the recommendations from @royal4taste
Release Notes:
Major Update U2.7

  • Complete revamp using the new zigzag and projection algorithms and usage of latest pine structures for better performance of the indicator.
  • Update of visuals and display to track projections.
  • Detailed fully customisable alerts with more number of placeholders.
  • More stats based on historical occurrences to enhance deeper study of the concepts.
  • Updates to settings to enable higher degree of customisation.

Refer to "Author's instructions" section of this page for further details on documentation, trial requests and pricing.
Release Notes:
Update U2.8

Minor Library Updates

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 Trendoscope 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 Access : www.trendoscope.io/trial Subscribe: www.trendoscope.io/pricing Documentation: docs.trendoscope.io/ahproju-sg/

Want to use this script on a chart?

Warning: please read before requesting access.