I am barely a day old at PineScript and am trying to experiment by backtesting some simple strategies. I am trying to Short at a specific time (say 2:00 PM ) and Exit the position at say (3:00PM) How do I do this? I have read the documentation and have attempted at a code but I am getting Syntax Error. I am absolutely new to programming / scripts
//////
strategy("My strategy", initial_capital=100000, margin_long=100, margin_short=100)
start = timestamp(2001,1,1,0,0)
end = timestamp(2022,9,1,0,0)
if time > start and time < end
strategy.entry ("Short", strategy.short,1,when=time(12:00))
strategy.close("Short", when=time(14:00))