Write code a pinescript v4 script for above Structural Pivots Method (SPM) Small Pivots…
- User
Write code a pinescript v4 script for above
Structural Pivots Method (SPM)
Small Pivots • In a rally, when we get 2 lower closes and lower lows, we get to mark Small Pivot High (sph) • In a decline, when we get 2 higher closes and higher highs, we get to mark Small Pivot Low (spl)
Structural Pivots Method (SPM) - Small Pivots
Concept of anchor/reference bar
Importance of creating rules objectively to mark the pivots
If rules are adhered, all will mark the same pivots
Small Pivots – Rules for marking
a. Small Pivot High :-
• To mark sph, we need two lower lows and two lower closes compared to anchor bar • SPH is the highest point in between 2 SPLs • SPH alternates with SPL
b. Small Pivot Low :-
• To mark spl, we need two higher highs and two higher closes compared to the anchor bar • SPL is the lowest point between 2 SPHs • SPL and SPH alternate with each other, SPL cannot follow another SPL
Common Rules
• Bar 1 & Bar 2 for marking small pivots does not have to be consecutive bars UNTIL WE GET TO MARK THE SMALL PIVOT (HIGH OR LOW) • Anchor Bar or a reference bar is taken as a starting point to compare high/lows • Only Bar2 of prev marked pivot can ‘start’ acting as the anchor bar to mark the next pivot • Recently marked small pivot is temporary. It becomes permanent only after marking the subsequent small pivot.
SPM Large Pivots – Rules for marking • To mark LPH, we need to break the previously marked spl(temp spl break is enough)
• To mark LPL, we need to break the previously marked sph(temp sph break is enough)
• LPH and LPL alternates...
• To mark LPH, we go back to see all the sphs (that were marked after the last LPL – including highs) and mark the highest sph as LPH
• To mark LPL, we go back to see all the spls (that were marked after the last LPH – including lows) and mark the lowest spl as LPL
• Once marked, Large pivots are permanent (no temp pivot concept like spl/sph)
buy when : Higher high and higher low LPs
sell when : Lower high and lower low LPs
Mark spl, sph with lower lower and upper arrow respectively mark lpl, lph with 2 lower and 2 l upper arrows respectively
Also write detailed psedo code after writing pinescript
- Assistantpinescript