“Expiry” Related Keywords: Different Examples of its Uses — Tradetron Community
← Community

“Expiry” Related Keywords: Different Examples of its Uses

Keyword help 8,706 views

Nelson Tradetron team

This thread will contain examples of different keywords used to select different expiries

Nelson Tradetron team
  1. Below will take trade only on Current Weekly Expiry Day of NIFTY BANK:

Note: This formula can be used only in ‘Condition Builder’, not ‘Position Builder’

image

Nelson Tradetron team
  1. Below will take trade on all days except Current Weekly Expiry Day of NIFTY BANK:

Note: This formula can be used only in ‘Condition Builder’, not ‘Position Builder’

image

Nelson Tradetron team

Formula to find 1 day before expiry in Condition Builder:
Below Formula can be used only in Condition Builder , not Position Builder

Please check the below video

Nelson Tradetron team

To check in Condition Builder , if Today is the Expiry of Traded Instrument in Set 1, Condition 1, Leg 1:

Chandrahas

Is Function Days Difference return absolute values? what if D1 and D2 are interchanged…?

Chandrahas

The formula is Understood. Question is will it return negative value if I interchange Today(NSE) and Current Month expiry(Nifty 50,-1)

Lion Algos

Not sure on that. Need to test and check

Tradetron Team Tradetron team

On the follow-up question: Days Difference (D2-D1) is not an absolute value. It returns Date 2 minus Date 1.

  • Positive when Date 2 is later than Date 1.
  • Negative when Date 2 is earlier.
  • So the order of the two inputs matters.

Example: days left to expiry

Put today first and the expiry second:

Days Difference(Today('NSE'), Current Month Expiry('NIFTY 50', 0)) >= Number(15)

This is true while 15 or more days remain to the current monthly expiry. On expiry day itself the result is 0, so == Number(0) is a simple “expiry day” check. If you swap the two inputs, the same 15 days comes back as -15 and the condition above would never be true.

Use it in the condition builder, combined with your other conditions using AND. Test it in Live Offline and look at the value in the Notification Log.

Keywords: Keyword Documentation — Tradetron

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