clocks156t174

quantized pin bar indicator with ATR

Abstract
This script computes the strength of pin bars.
This script uses the corrent and the previous two bars to compute the strength of pin bars.
The strength of pin bars can be also comared with average true range, so we can evaluate those pin bars are strong or weak.

Introduction
Pin bar is a popular price action trading strategy.
It is based on quick price rejection.
Most of existing pin bar scripts only determine if a bar is a pin bar or not.
However, evaluating the strength of pin bars is important.
If price rejection is too weak, it is difficult to trigger trend reversal.
If a pin bar is too strong, we may enter the trade too late and cannot have good profit.
In this script, it provides a method to compute to strength of pin bars.
After the strength of pin bars are quantized, they can compare with average true range, price range and trend strength, which can help us to determine where are worthy for us to open trades.

Computation
Bullish hammer : current low is lower than ( previous high or current open ) and current close.
Bearish gravestone : current high is higher than ( previous low or current open ) and current close.
Bullish engulfing and harami : ( current low or previous low ) is lower than ( previous 2nd high or previous open ) and current close.
Bearish engulfing and harami : ( current high or previous high ) is higher than ( previous 2nd low or previous open ) and current close.

Parameters
Smoothing : the type of computing average.
Length of ATR : determines the number of true ranges for computing average true range.
ATR multiplier line : the threshould that a pin bar is strong enough. For example, if this value is 0.5, it means a pin bar with 0.5*atr or more is considered a strong pin bar.
one direction pinbar : set to 1 if you want the strength of bullish pin bars and bearish pin bars are cancelled. Set to 0 if you want to keep both strength of bullish pin bars and bearish pin bars; in this case, you may need to change the plot style to make both strength visible.

Trading Suggestions
Evaluate the strength of trend against pin bars. After all, a single reverse pin bar may be too weak to reverse the trend.
Timeframe : if atr is higher than 4*spread, the timeframe is high enough. However, if strong pin bars appear too frequent or price range is too small, going to higher fimeframe may be more safe.
Entry and exit : according to personal flavors.

Conclusion
The strength of pin bars can be quantized.
With this indicator, we can find more potential pin bars which human eyes and binary pattern detectors were leaked.
In my opinion, 0.5*atr is the most suitable streng of a pin bar for my trade entry but I still need to consider the direction of the trend.
You are welcome to share your settings and related trading strategy.

References
Most of related knowledge can be searched from the internet.
I cannot say the exact references because they may violate the rules of Tradingview.
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?