Run script on previous timeline (and not live)

 
I would like to know if this is possible,
i have a script that i want to test that check some data from the latest 2 Hour 1 candles, but i want to be able to run the script on a history timeline, not only live.
Is possible to run a script in a previous timeline? I prefer to not alter the code for this.
My code just returns some messages with print, and i want to check if those messages are correct according with the conditions that they are displayed.
Reason: