TradingView
pranjalchaubey
3 de Set de 2021 07:58

[CP]Pivot Boss Candlestick Scanner - No Repainting  

S&P CNX NIFTY INDEX FUTURESNSE

Descrição

This indicator is based on the high probability candlestick patterns described in the ’Secrets of a Pivot Boss’ book.
The indicator does not suffer from repainting.
I have kept this indicator open source, so that you can take this indicator and design a complete trading system around it.
Although the patterns have some statistical edge in the markets, blindly using them as Buy/Sell Indicators will certainly result in a heavy loss.

I like some of these setups more than others, and I have listed them in the order of my likeness.
The first one I like the most, the last one, I like the least.

The patterns are universal and work well in both intraday, daily and even larger timeframes.
Signals in the example charts are manually marked by,
  • Hammer - profitable short signal
  • Rocket - profitable long signal
  • X - unprofitable long or short signal


GENERAL USER INPUTS:
These settings exist as the indicator uses ‘Labels’ to mark the patterns and Pine Script limits a maximum of 500 labels on a chart.
If you want to go back in the past and check how the indicator was doing, set the Start and End dates both and check the ’Use the date range above to mark the Candlestick Setups?’ option.

EXTREME REVERSAL SETUP:
This is by far my favorite setup in the lot. Classic Mean Reversion setup.
The logic, as explained in the book, goes like this,
1. The first bar of the pattern is about two times larger than the average size of the candles in the lookback period.
2. The body of the first bar of the pattern should encompass more than 50 percent of the bar’s total range, but usually not more than 85 percent.
3. The second bar of the pattern opposes the first.
The setup works extremely well in high beta stocks like Vedanta VEDL.
Feel free to play with the settings in order to better align this pattern with your favorite stock.
Check out the examples below,
No indicator is perfect, failed patterns are marked with an X.




OUTSIDE REVERSAL SETUP:
My second favorite setup, it is quite good at catching intraday trends.
Here’s the logic,
1. The engulfing bar of a bullish outside reversal setup has a low that is below the prior bar’s low and a close that is above the prior bar’s high. Reverse the conditions for bearish outside reversal.
2. The engulfing bar is usually 5 to 25 percent larger than the size of the average bar in the lookback period.
Settings for this pattern simply reflect these conditions. Feel free to modify them as you wish.
The pattern is pretty powerful and will sometimes help you catch literally all the highs and lows of the market, as shown in the examples of Vedanta VEDL and RELIANCE stocks below.
As usual, this pattern is not PERFECT either.



DOJI REVERSAL SETUP:
Doji candles signify market indecision and this pattern tries to profit off these market conditions.
Logic:
1. The open and close price of the doji should fall within 10 percent of each other, as measured by the total range of the candlestick.
2. For a bullish doji, the high of the doji candlestick should be below the ten-period simple moving average. Vice-versa for bearish.
3. For a bullish doji setup, one of the two bars following the doji must close above the high of the doji. Vice-versa for bearish.
Feel free to modify the settings and optimize according to the stock you are trading.
Don't optimize too much :)
This pattern works brilliantly well on larger intraday timeframes, like 15m/30m/60m.
This pattern also has a higher propensity to give false indications than the two described above.
Doji reversal typically helps to catch larger trend reversals. Check out the examples below from RELIANCE and NIFTY charts,
Note that the RELIANCE chart below is the same as shown for the Outside Reversal Setup above, notice the confluence of Outside
Reversal and Doji Reversal on the 31st August.
Confluence of patterns usually increases the probability of success.

RELIANCE 15m Chart - Pattern can catch nice trends on higher timeframes

NIFTY 15m Chart


WICK REVERSAL SETUP:
This pattern tries to capture candlesticks with large wick sizes, as they often indicate trend reversal when coupled with significant support and resistance levels.
Logic:
1. The body is used to determine the size of the reversal wick. A wick that is between 2.5 to 3.5 times larger than the size of the body is ideal.
2. For a bullish reversal wick to exist, the close of the bar should fall within the top 35 percent of the overall range of the candle.
3. For a bearish reversal wick to exist, the close of the bar should fall within the bottom 35 percent of the overall range of the candle.
This pattern must always be coupled with important support resistance levels, else there will be a lot of false signals.
The chart below is the same NIFTY chart as above with the Wick Reversal candles marked as well.
You can see that there are a lot of false signals, but the price also indicates ’pausing’ at important levels by printing a wick reversal setup.
You can use this information to your advantage when riding a trend.


FINAL WORDS:
  • Settings for various patterns simply reflect the logic described.
  • You will probably need to tweak and optimize the pattern settings for the stock that you are trading.
  • Higher Beta/Higher Volatility stocks are a great choice for these patterns.
  • Using these patterns at critical support and resistance levels will result in dramatically high accuracy.
  • Be creative and try to develop a proper system around this indicator, with rules for position sizing, stop loss etc.
  • You do not have to trade all the patterns. Even trading just one pattern with a proper system is good enough.
  • DO NOT USE THIS INDICATOR AS A BUY/SELL SYSTEM, YOU WILL LOSE MONEY.


Feel free to drop any feedback in the comments section below, or if you have any unique candlestick patterns that you would like me to code.

Notas de Lançamento

New Feature has been added that marks the mid-point of every signal candle.
This feature can be disabled (it is enabled by default) by checking-off the "Mark Candle Mid-Range on the signal candles?" option in the settings.
Thanks to user @FR2022 for bringing this in my notice, please check his comments below.

Pivot Boss himself uses these mid-markings when taking trades. Idea is pretty simple, set a stop limit order at the mid-point of a signal candle. Ideally, the price would hit the mid-point, execute your order, and then take off from there.

If you are not able to see the mid points marked on the signal candles, then please change the visual order of this indicator and 'Bring to Front'. Google how to do this in TradingView, if you don't know.
Comentários
ChoppyMarket
as a beginner i have developed something... I tried my best... but yours is way above the expectations

//@version=4
//1. Create the Labels on the line - done

//********CPR *************
//Daily Pivots
//Tomorrows Pivots
//Weekly Pivots

//********Camarilla *************
//Daily Camarilla
//Tomorrows Camarilla

//********Moving Average *************
//Moving Average

//********Previous High and Previous Low *************
//Previous Day High & Low

//******** Opening Range balance *************
//Opening Range

study(title="23Sep", overlay=true)

// Input settings

sessRange = input(title="Trading Session", type=input.session, defval="0915-1015") // Trading Session

plotPP = input(title="Plot Floor Pivots ?", type=input.bool, defval=true) // Intraday Pivots

plotPPT = input(title="Plot Floor Pivots for Tomorrow ?", type=input.bool, defval=false) // Tomorrows Pivots

plotWP = input(title="Plot Weekly Pivots ?", type=input.bool, defval=false) // Weekly Pivots

plotCam = input(title="Plot Cam Pivots ?", type=input.bool, defval=false) // Camarilla Pivots

plotSMA = input(title="Plot Moving Averages ?", type=input.bool, defval=true) // Moving Average

DaysHighLow = input(title="Show PDH/PDL?", type=input.bool, defval=true) // Days high and low

OpeningRange = input(title="Show Opening Range?", type=input.bool, defval=true) // Opening Range

// ***** Calculate Open high low for the daily , weekly and Tomorrows close *****

// Create a function to fetch High Low and Close

GetData(res, data) => security(syminfo.tickerid, res, data[1],lookahead=barmerge.lookahead_on)

GetTomorrowsData(res, data) => security(syminfo.tickerid, res, data[0],lookahead=barmerge.lookahead_on)

// Fetch daily and weekly price data

theHigh = GetData("D", high)
theLow = GetData("D", low)
theClose = GetData("D", close)

weeklyHigh = GetData("W", high)
weeklyLow = GetData("W", low)
weeklyClose = GetData("W", close)

theHighT = GetTomorrowsData("D", high)
theLowT = GetTomorrowsData("D", low)
theCloseT = GetTomorrowsData("D", close)

// **************************************************Intraday CPR *********************************************

pp = (theHigh + theLow + theClose) / 3
bc = (theHigh + theLow) / 2.0
tc = (pp - bc) + pp
r1 = (pp * 2) - theLow
s1 = (pp * 2) - theHigh
r2 = pp +( theHigh -theLow)
s2 = pp -(theHigh -theLow)
r3 = r1 + (theHigh-theLow)
s3 = s1 - (theHigh-theLow)
r4 = r3 + (r2 - r1)
s4 = s3 - (s1 - s2)

plot(series=plotPP ? pp : na, title="PP", style=plot.style_circles, linewidth=1, color=#000000)
plot(series=plotPP ? bc : na, title="BC", style=plot.style_circles, linewidth=1, color=#000000)
plot(series=plotPP ? tc : na, title="TC", style=plot.style_circles, linewidth=1, color=#000000)
plot(series=plotPP ? r4 : na, title="R4", style=plot.style_circles, linewidth=1, color=#2B4AC4)
plot(series=plotPP ? r3 : na, title="R3", style=plot.style_circles, linewidth=1, color=#FBDB0A)
plot(series=plotPP ? r2 : na, title="R2", style=
FR2022
I didn't get his book. I have his basecamp videos. In his videos he shows his Thinkandswim charts. He talks about entering trades (with resting limit orders) at midpoint of previous bar. He has a simple "dot" programmed at the mid point of each bar on the chart to visually show him where the midpoint or 50% mark of the previous bar is. I don't know if in pine script its possible to put a dot or a dash or any kind of a graphic marker on the candlestick bars. If its too much to put it on every bar, perhaps it can be just put on the signal bar . But these midpoint dots are very helpful. If you look at the signal bars or any important bar, the midpoint is often tested. If its rejected then the price goes the way of the signal. If it not rejected then one of two things happens. Either the price goes past the opposite end of the signal bar to trigger stops then goes the way of the signal. Or the signal completely fails and the price reverses all together. This is not 100% but happens very often.
pranjalchaubey
@FR2022, thank you for your inputs, this new feature has been incorporated in the indicator!
fr5050
@pranjalchaubey, thank you, that is fantastic.
pranjalchaubey
@fr5050, You are welcome! :)
robinawesome1
Awesome script.
Could you please implement Opening White Marubozo candle? and the bearish candle that can be used as Bullish: CBM, LBC, GD, BSS, and WSS see reference article. thanks

bullish 1-day candlesticks
"
In the case of bullish single-day patterns, most candlestick patterns could not generate statistically significant positive mean returns.

The ones that did are WM, OWM, LWC, and BPU. Only OWM has significant mean returns over all horizons. The BPU comes close as its mean returns are significant over all horizons except for 1 day. The WM and LWC have significant mean returns only for a 10-day holding horizon.

The binomial test results show that the winning probability is normally not significant. The notable exception is the OWM for a 5- or 10-day holding horizon.

Traders could make a profit (at least before transaction costs) on average from selling when the CWM pattern happens instead of buying as suggested in candlestick textbooks.
However, similar to the bullish CWM pattern case described above, most bearish 1-day patterns, like CBM, LBC, GD, BSS, and WSS, do not have negative mean returns as expected but surprisingly have highly significant positive mean returns. "
-source journals.sagepub.com/doi/full/10.1177/2158244017736799
pranjalchaubey
@robinawesome1, Thank you for such a detailed request....I will surely work on creating this indicator and publish on TradingView very soon!
vichom
@pranjalchaubey, Just starting learning and studying about PBoss and man thank you so much for this.
pranjalchaubey
@vichom, You're welcome! Stay tuned for my next indicator, it is going to blow your mind! :D
ChoppyMarket
@pranjalchaubey, Please publish the latest one .... we are awaiting... Super Programming Skills....
Mais