TradingView
twingall
26 févr. 2020 22:38

Pivot Points & Midlines with color selector 

E-mini Dow ($5) FuturesCBOT

Description

Adapted from Pinescript Manual's "Pivot Points Standard". Added extra levels and midlines as well as user inputs for color and a "show labels" on/off switch.
So this will show the Pivot level, the resulting levels R1,R2,R3,S1,S2,S3 and the midpoint lines between these.
User can choose the Higher timeframe period from which to calculate these pivot levels, as per the original script.
I like to add two of these to a chart, one for daily and one for weekly pivot levels.
If you don't need any particular level, just comment out the appropriate lines (one from each of the second last and third last blocks in the script).

Notes de version

~added Previous day's high and Previous day's low
~limited the number of historical levels as much as possible (you can tweak these by editing up the numbers in line 8; unfortunately, if you try to make them lower than 26, it throws an error)

Notes de version


~allow to show Previous day's highs & lows ONLY
~allow to show Pivot& midlines lines ONLY
(default is show all)

Notes de version

-show/hide previous day levels; added user option toggle on/off. Default is not show.

Notes de version

-Added option to print price labels
-Cleaned up code

Notes de version

-added label position choice (left or right).
-added offset bars for current day's labels (offset +(right) or -(left) of last bar index. Only applies when label position is set to 'right'.
Commentaires
Jb_2
Nice, simple and clean. Thank you !
sakilakhtar09
@twingall can you please add option to remove previous days support resistance..& add previous days high & Lows..
twingall
@sakilakhtar09, Sorry i don't have much time these days.
For deleting old levels you could try replacing top line of code with:
study("Pivot Points & Midlines with color selector", overlay=true,max_lines_count=26, max_labels_count =26)
tweaking the numbers to reduce the number of 'latest' levels/labels shown. If it throws an error, maybe convert the script to v5 first (pine editor: top right corner 3 dots, click >> convert to v5)
twingall
@sakilakhtar09, fixed as best i could: now has previous day's highs and lows, and less historical levels. Don't know why but TV throws an error 'too many drawings' if you reduce lines/labels count to less than 26
berke_gorgun
@twingall, Any solution to delete prev day lines ?
twingall
@berke_gorgun, done, toggle on/off. Default is now off.
berke_gorgun
@twingall, Thank you my friend.I have also added moving averages,vwaps to this indicator.Its far better now...
twingall
@berke_gorgun, no worries. Ok, will give it a go.
d.umesh
Sir, Again Some problem in monthly levels can't plot plz check @ur end.
M Waiting for your Reply
Thnx
Sergioramos1987
Hey, i was wondering if it would be possible to add color selection to the levels? like R levels would be red and S levels would be green and mids would be grey.... i WILL buy you coffee if its possible
Plus