Dear all,
I would like to have a condition to exit my strategy if the strategy had taken position but did not either hit target or stoploss within 30 minutes. I have seen multiple keywords like “Time”, “EntryTime” etc. but they all give time in HHMM format.
I do get “EntryTime” and “Time” of NSE / NFO for comparison, but the problem is they are in the format of Number but representation is in time format (HHMM) as mentioned above.
So, for example if the strategy has entered at 2:55 PM the Number representation is 1455. However, when time switches to 3 PM the number representation would be 1500. So if I get absolute difference 1500 - 1455 this will be 45 and hence greater than 30 minutes whereas it’s only 5 mins since entry into the trade.
Many thanks in advance for help!