It turned out not to be that easy to plot the close of the previous week in hourly or daily charts. In my first experiments things went wrong on Friday or intraday if you simply use the security function. So here is the thing with an algorithm that guaranties the correct value.