This script stopped working today as a result of a minor update to Pine script. I need to renovate the script to fix other issues as well. ie better use of dates and a MIDAS channels fix. I will do a quick fix for the max bars back issue.
In the meantime, this will get things going. I also changed line 78 from plot(n+1,style=area,color=blue,transp=100) to plot(n ,style=area,color=blue,transp=100). This will move your pivot in the TB-F one line back. jayy