DojiEmoji

Fractal Breakout Strategy [KL]

DojiEmoji 已更新   
Fractal Breakout Strategy
This strategy will enter into a Long position when (a) bullish fractal is formed, combined with (b) ATR is relatively low. Trailing stop loss is set based on ATR.

Bullish fractal pattern:
A bullish fractal pattern looks like this:
It is formed when lower-low has reached a local minimum followed by higher-lows.
By default, this script plots the pivot point (the local minimum) using green crosses. This line will extend to the right until the next bullish fractal is formed. The local minimum pivot point is considered as key level of support. For long position entry, entry price must be higher or equal to it.

On the other hand, a bearish fractal pattern looks like the exact opposite. Reversing the logic, it is a local maximum indicated by higher-highs followed by lower-highs. This is shown by red crosses.

Why use ATR to confirm entry:
Two reasons to enter when ATR is low:
1) Since trailing stop loss is based on ATR, entering the market when ATR is low means risking less for potentially high reward.
2) Low ATR often signals price consolidation. There are two favorable scenarios, either: (i) period of accumulation, or (ii) bull flag, ideally followed by breakout.

Determining whether ATR is low:
Relative lows are quantified out by using the method in my other script: Modified ATR Indicator

The method involves applying two-tailed hypothesis testing to assess whether ATR (ie. by default lookback period of 5) has greatly deviated from a larger sample size (ie. lookback period of 50). Assuming ATR is normally distributed and variance is known, then test statistic (z) can be used to determine whether ATR5 is within the critical area under Null Hypothesis: ATR5 == ATR50. If z falls below/above the left/right critical values (ie. 1.645 for a 90% confidence interval), then ATR is determined to the relatively low/high respectively. For the purpose of assessing whether ATR is low, the left-tail is the main focus.

Profit taking:
Profits by default are taken over 3 levels based on risk to reward ratio (ie. 1R, 2R, 3R). When a target is met at each level, strategy will close out one third of current position size. Remainders (ie. already taken once at 1R, but not yet reaching 2R or 3R) will eventually be closed at the trailing stop loss price.
版本注释:
Order size management based on TradingView's parameters (go to Settings -> Properties -> Order size)
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?