Hi,
I need a condition to check trading day which is one day before expiry or one day after previous expiry.
As Days Difference keyword takes all calendar days, it is not feasible to use it in Algo Trading. For example If I use this to exit one day before expiry then it will try to execute on Wednesday since Thursday is a expiry day for Nifty. What if Wednesday is a public holiday? It won’t work right? Same case for entry as well. I want to take trade one day after previous expiry. How to set it? There is no option available and if Friday is public holiday then it won’t take trade on next trading day that is Monday.
I need a dynamic solution. Otherwise, it is not a Algo Trading.
Question:
Regarding days difference , does it take into account all days or only trading days;
Solution:
All calendar days
so on expiry days difference will be 0, Assuming 3/11/21 is the expiry,
on 02/11/21 it will be 1
01/ 11/21 it will be 2
31/10/2021 = 3
30/10/2021 = 4
Please provide a solution.
Regards,
Uma