Can someone please create this Pivot Reversal Strategy for me as an indicator?
strategy("Pivot Reversal Strategy", overlay=true)
leftBars = input(4)
rightBars = input(2)
swh = pivothigh(leftBars, rightBars)
swl = pivotlow(leftBars, rightBars)
swh_cond = not na(swh)
hprice = 0.0
hprice := swh_cond ? swh : hprice[1]
le = false
le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])
if (le)
strategy.entry("PivRevLE", strategy.long, comment="PivRevLE", stop=hprice + syminfo.mintick)
swl_cond = not na(swl)
lprice = 0.0
lprice := swl_cond ? swl : lprice[1]
se = false
se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])
if (se)
strategy.entry("PivRevSE", strategy.short, comment="PivRevSE", stop=lprice - syminfo.mintick)
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
Size:
Color:
For someone out there who might be interested in coding this for you, it's odd not to find clear trading rules in English nor any reference to the origin and trading platform in your request. Just give it a thought.
Size:
Color:
Here is some more information if anyone is able to help i found this stratergy on tradingview.
This “trading signals” indicator plots buy and sell signals points entries when the price breaks the last pivot High/Low levels.
These levels are defined by price tops and bottoms found after the price made:
highest high with “leftP” candles on its left and “rightP” candles on its right
lowest low with “leftP” candles on its left and “rightP” candles on its right
The levels are marked with dark grey dots on the charts.
The signals are given during the candlestick formation and not afterwards.
Size:
Color:
This should make it a bit more clear but I am still at a loss as to how these pivots differ from what is called
swings or
fractals. From your description (re: bars on the left and on the right) this should rather be the latter. Correct me if I'm wrong but (floor trader) pivots are nothing like what you describe:
Pivot LevelsFloor Trader PivotsBefore anything else, I recommend that you exhaust Wealth-Lab's built-in and extra tools for pivots and swings. Search existing strategies for keywords like "
swing", "
fractal" and "
pivot":
Search the Wiki (if it doesn't work
see this: post #21)
Search the ForumSearch strategiesYou should find lots of examples among existing solutions developed to highlight and backtest the
fractals,
swings and
pivots.
P.S.
Zigzag is somewhat related but defines peaks and troughs with respect to a reversal amount rather the number of bars to the left/right.
Size:
Color:
Thank you!
Size:
Color:
Glad I could be of assistance.
Size:
Color: