In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
I tried by overlapping the standard pivot points from TradingView and that was the result: the purple dotted line from today corresponds to the pivot ("P") from previous day, the same goes for the red dotted lines which corresponds to previous days resistances ("R1-R3"), and the green dotted lines correspond to previous day supports ("S1-S2")... I wish I knew the basics of coding to fix it but I don't, I hope you guys come up with ideas and if possible fix it.