79228012

Date: 2024-11-26 19:35:32
Score: 0.5
Natty:
Report link

I had/Have this similar issue too. My Work around is to use a 14 month old hard coded date and zeros for time as a flag to my code that user wants to use today's date and time. Make a standard to compare to :

tDefault = timestamp("01 Oct 2023 00:00:00 -0400")  

Then the user input.time MUST match exactly :

backtestStartDate_raw = input.time(timestamp("01 Oct 2023 00:00:00 -0400"),    
    title="Strategy Start Date+Time ",
    tooltip="This start date is in the time zone of the exchange " + 
    "where the chart's instrument trades. It doesn't use the time " + 
    "zone of the chart or of your computer." , group = "Trading Options" 
) 

Now just compare the two:

(backtestStartDate_raw == tDefault) 
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: FGZ.Rick