Tomorrow Keyword not working — Tradetron Community
← Community

Tomorrow Keyword not working

Keyword help 1,748 views

Pramod

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.

farty

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:

Tradetron Team Tradetron team

Tomorrow returns the next calendar date as text (YYYY-MM-DD). It is true on the day before expiry only if that day is literally one calendar day earlier, and only when you compare it with a date string such as an expiry keyword. A common mistake is comparing it with a number, or with an expiry keyword for a different underlying or expiry.

Recommended: trade on expiry day and the trading day before

Use two checks joined with OR:

  • Expiry day: Today('NSE') == Current Week Expiry('NIFTY BANK', 0)
  • Day before (skips holidays and weekends): Next Trading Day('NSE') == Current Week Expiry('NIFTY BANK', 0)

Next Trading Day uses the NSE holiday calendar, so if the day before expiry is a holiday it still picks the right day.

Alternative: days to expiry

Days Difference(Today('NSE'), Current Week Expiry('NIFTY BANK', 0)) <= Number(1) counts calendar days, so a holiday in between can make it miss.

Use the expiry keyword that matches the contracts your index actually lists (Current Week or Current Month). Expiry weekdays change over time, so don’t hard-code a weekday. Test in Live Offline.

Keyword reference: Keyword Documentation — Tradetron

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.

Tradetron अब हिन्दी में भी उपलब्ध है हिन्दी में देखें Continue in English