I am trying to build a strategy which will take trades only on the day of expiry and on the previous day of expiry i.e. on wednesday and thursday in case of BankNifty. I have built the entry condition as shown in the screenshot attached. But the strategy is taking trades only on the expiry day and not on the previous day of expiry.
use D2-D1 condition for better accuracy.
Days Difference (D2-D1):
This keyword is used to calculate the difference between days and the output is an integer
Days Difference has 2 inputs. Please note that keywords that return DD-MM-YYYY formats can only be used as inputs.
In this keyword, D1 is subtracted from D2, so always D2 should be the bigger one
In the above condition, we are checking if the difference between the Current month expiry and today is greater than 15 days.
It considers all calendar days including holidays and non-trading days. You can find more detail on this keyword in the video link shared below: