TradingView
Trendoscope
Jul 11, 2021 12:54 PM

Auto Harmonic Patterns - Long only Strategy 

JP Morgan Chase & Co.NYSE

Description

This is long only strategy where entry and exits are generated based on Harmonic Patterns.

Logic used for generation of harmonic patterns is same as the below script (Double top and bottom are removed in this script):
tradingview.com/script/PCOw0dtT-Auto-Harmonic-Patterns/

Now to generate entry and exit signals, following rules are used:

If there is bullish pattern:

  • Entry : If X is between Point B and D, then use X as entry point. Else use B as entry point. Entries are managed via stop limit orders.
  • StopLoss : D - (atrMult times atr)


If there is bearish pattern and useReverseTradeOnBearishPattern is selected:

  • Entry : D + (atrMult times atr)
  • StopLoss : If X is between Point B and D, then use X as stoploss. Else use B as stoploss


If there is any existing trade while new patterns are formed, then existing stoploss and target levels are updated accordingly instead of placing new order.

Optional Profit Targets : When takeInitialProfitOnTargets is selected, minimal profit (20% of open positions) is taken based on harmonic pattern profit targets. These targets are set only based on bullish pattern recognition
  • First Target : Lower of A and C
  • Second Target : Higher of A and C
  • Third Target: 1.618 times AD


Example of XABCD points are shown in below picture:


Other logic involved:
  • Apart from stoploss generated by patterns, there is also trailing stoploss which is simply based on trailingStopAtrMult times ATR
  • Stoplosses, entry points and target levels are updated only if new stoploss generated either by ATR or by harmonic patterns are higher than present stoploss. If not, previous stoplosses are used.


Happy trading. Let me know your views.

Release Notes

  • useStopOrder option is set to true and removed from user input.
  • Three drives and 5-0 patterns removed as they are bit different to rest and the existing logic will not be apt for them.
Comments
sachinsgawali76
I have checked this script and it is working beyond 2hrs time frame. Can you make changes in the script so that it can work on smaller time frames, like 5min.
Look forward for your positive feedback.
idsme
Learned much form your V1 thanks.. Trying to get into double / tripple bottoms for my day trading.. One thing 1 noticed is that the place of double tops or bottoms differs. is this settings or is this something more.
Trendoscope
@idsme, there is no double top/bottom in this script. Can you tell me which two scripts you are referring to?
sina8ball
hi
this is repaint?
just_naba
thanks boss....great as always,
mirahtrader
Great results - incorporated into impuls system with cci divergence for entry . Thanks a lot for this script !!
Trendoscope
@mirahtrader, thanks for sharing this 😊
mirahtrader
Great great great !! Thanks a lot !
Lunatic_Fringe
Can I have its source code or can you please add Time range ?
DiMaria222
Hello dear friend,
I wonder if the signal comes right away on the candle or shown on the second or third candle!?

Thanks in advance
Best regards
More