Automated weekly Index Options Tracking -upstox api & Alert System Live to whatsapp number when condition satisified
Budget: ₹1,500 – ₹12,500 INR
Need a developer to build an automated system using Upstox data that tracks index options from their first trading appearance, creates weekly pivot levels, filters them, and automatically activates alerts for the filtered options for the next week.
Instruments
Weekly expiry CE and PE options of:
NIFTY
BANKNIFTY
FINNIFTY
SENSEX
BANKEX
Data source
Upstox API – hourly OHLC candles.
Starting logic — first trading appearance
System must detect when an option contract starts trading for the first time.
Example:
If first candle exists on 7 Jan 2026 and no data exists before that, then 7 Jan is treated as the first trading day of that option.
Week grouping logic
Weeks must be formed using actual trading days, not fixed Monday–Friday.
Market holidays must be handled.
Example:
7 Jan 2026 – Wednesday
8 Jan 2026 – Thursday
9 Jan 2026 – Friday
This becomes the first trading week.
If Friday is a holiday, then the last available trading day becomes week end.
Week definition:
Start = first trading day available in that week
End = last trading day available before next week begins
This must work even if:
* option starts mid-week
* Monday is holiday
* Friday is holiday
First week calculation
If an option starts trading on Wednesday:
Week 1 consists of:
Wednesday + Thursday + last trading day of that week.
After this week completes:
Take:
Weekly High = highest high in that week
Weekly Low = lowest low in that week
Weekly Close = close of the last trading session of that week
Pivot projection rule
Pivot must be calculated only AFTER the week completes.
Never during a running week.
Never mid-week update.
Cycle:
Week completes → pivots generated for next week
Next week completes → new pivots generated
This repeats continuously.
Pivot formula (weekly)
P = (High + Low + Close) / 3
R1 = (2 × P) − Low
S1 = (2 × P) − High
R2 = P + (High − Low)
S2 = P − (High − Low)
R3 = High + 2 × (P − Low)
S3 = Low − 2 × (High − P)
R4 = R3 + (High − Low)
S4 = S3 − (High − Low)
R5 = R4 + (High − Low)
S5 = S4 − (High − Low)
These pivots remain fixed for the entire next week.
Weekly engine behaviour
For every option:
1. Detect first trading date
2. Build first week using actual trading sessions
3. After week ends:
calculate weekly High Low Close
4. Generate pivot levels for next week
5. During next week:
pivots remain unchanged
6. After that week ends:
repeat process
Holiday handling
If any weekday is a holiday:
* week start becomes first available trading day
* week end becomes last available trading day
* pivot generation still happens after final session
Filtering logic before output
After weekly pivots are generated, system must filter options.
Only options satisfying BOTH conditions are selected:
Condition 1
Distance between S1 and S2 must be within defined percentage.
Default:
abs(S1 − S2) ≤ 50% of S1
This percentage must be changeable anytime later.
Condition 2
S1 value must be ≤ ₹70.
Only options satisfying both conditions move to output.
Excel output
Excel must contain only filtered options.
Columns:
Symbol
Expiry
Strike
Option type CE/PE
Week start date
Week end date
Weekly High
Weekly Low
Weekly Close
Pivot
S1 S2 S3 S4 S5
R1 R2 R3 R4 R5
No extra options.
Alert activation — very important
The same options that appear in the Excel output must automatically become active for alerts.
No separate manual selection.
Flow:
1. Week completes
2. Weekly pivots generated
3. Filter applied (S1–S2 distance + S1 ≤ 70)
4. Excel file generated
5. At the SAME time:
alert tracking must automatically activate ONLY for those options present in the Excel output
This means:
* Output list = Alert watchlist
* No manual work
Timing of alert readiness
This must happen immediately after the last trading session of the week.
Example:
Friday after market close:
* weekly pivots calculated
* filtered options list created
* Excel generated
* alert system activated
So that from Monday market open:
system is already tracking those options.
Live alert logic
During next week market hours:
If price touches S1 level of any option from the filtered output list:
Send WhatsApp alert.
Alert example:
BANKNIFTY 45000 CE
S1 touched
Price = 64
Pivot week active = 12 Jan – 16 Jan
Important behaviour
Alerts must trigger ONLY for options:
* generated in last weekly output
* satisfying S1–S2 filter
* present in Excel file
No alerts for other options.
Automation flow
Step 1
Fetch hourly OHLC from Upstox.
Step 2
Detect first trading candle of each option.
Step 3
Group candles week-wise using real trading days.
Step 4
After week completes:
calculate weekly High Low Close.
Step 5
Generate pivots for next week.
Step 6
Apply filters:
S1–S2 distance rule
S1 ≤ 70 rule
Step 7
Generate Excel with filtered options.
Step 8
Automatically activate alert tracking for same options.
Step 9
During next week:
monitor live LTP.
Step 10
If price touches S1 → send WhatsApp alert.
System expectations
Fully automated.
No manual pivot calculation.
No manual alert selection.
No mid-week pivot change.
New option contracts must automatically start from first trading day.
Every week:
* pivots generated
* filtered output created
* alert list updated automatically
Deliverables expected
Upstox API integration
Python automation scripts
First-appearance detection logic
Weekly grouping engine
Holiday handling
Pivot calculation engine
Filter configuration (percentage editable)
Excel auto generation
Auto alert activation from output
WhatsApp integration
Setup instructions
Instruments
Weekly expiry CE and PE options of:
NIFTY
BANKNIFTY
FINNIFTY
SENSEX
BANKEX
Data source
Upstox API – hourly OHLC candles.
Starting logic — first trading appearance
System must detect when an option contract starts trading for the first time.
Example:
If first candle exists on 7 Jan 2026 and no data exists before that, then 7 Jan is treated as the first trading day of that option.
Week grouping logic
Weeks must be formed using actual trading days, not fixed Monday–Friday.
Market holidays must be handled.
Example:
7 Jan 2026 – Wednesday
8 Jan 2026 – Thursday
9 Jan 2026 – Friday
This becomes the first trading week.
If Friday is a holiday, then the last available trading day becomes week end.
Week definition:
Start = first trading day available in that week
End = last trading day available before next week begins
This must work even if:
* option starts mid-week
* Monday is holiday
* Friday is holiday
First week calculation
If an option starts trading on Wednesday:
Week 1 consists of:
Wednesday + Thursday + last trading day of that week.
After this week completes:
Take:
Weekly High = highest high in that week
Weekly Low = lowest low in that week
Weekly Close = close of the last trading session of that week
Pivot projection rule
Pivot must be calculated only AFTER the week completes.
Never during a running week.
Never mid-week update.
Cycle:
Week completes → pivots generated for next week
Next week completes → new pivots generated
This repeats continuously.
Pivot formula (weekly)
P = (High + Low + Close) / 3
R1 = (2 × P) − Low
S1 = (2 × P) − High
R2 = P + (High − Low)
S2 = P − (High − Low)
R3 = High + 2 × (P − Low)
S3 = Low − 2 × (High − P)
R4 = R3 + (High − Low)
S4 = S3 − (High − Low)
R5 = R4 + (High − Low)
S5 = S4 − (High − Low)
These pivots remain fixed for the entire next week.
Weekly engine behaviour
For every option:
1. Detect first trading date
2. Build first week using actual trading sessions
3. After week ends:
calculate weekly High Low Close
4. Generate pivot levels for next week
5. During next week:
pivots remain unchanged
6. After that week ends:
repeat process
Holiday handling
If any weekday is a holiday:
* week start becomes first available trading day
* week end becomes last available trading day
* pivot generation still happens after final session
Filtering logic before output
After weekly pivots are generated, system must filter options.
Only options satisfying BOTH conditions are selected:
Condition 1
Distance between S1 and S2 must be within defined percentage.
Default:
abs(S1 − S2) ≤ 50% of S1
This percentage must be changeable anytime later.
Condition 2
S1 value must be ≤ ₹70.
Only options satisfying both conditions move to output.
Excel output
Excel must contain only filtered options.
Columns:
Symbol
Expiry
Strike
Option type CE/PE
Week start date
Week end date
Weekly High
Weekly Low
Weekly Close
Pivot
S1 S2 S3 S4 S5
R1 R2 R3 R4 R5
No extra options.
Alert activation — very important
The same options that appear in the Excel output must automatically become active for alerts.
No separate manual selection.
Flow:
1. Week completes
2. Weekly pivots generated
3. Filter applied (S1–S2 distance + S1 ≤ 70)
4. Excel file generated
5. At the SAME time:
alert tracking must automatically activate ONLY for those options present in the Excel output
This means:
* Output list = Alert watchlist
* No manual work
Timing of alert readiness
This must happen immediately after the last trading session of the week.
Example:
Friday after market close:
* weekly pivots calculated
* filtered options list created
* Excel generated
* alert system activated
So that from Monday market open:
system is already tracking those options.
Live alert logic
During next week market hours:
If price touches S1 level of any option from the filtered output list:
Send WhatsApp alert.
Alert example:
BANKNIFTY 45000 CE
S1 touched
Price = 64
Pivot week active = 12 Jan – 16 Jan
Important behaviour
Alerts must trigger ONLY for options:
* generated in last weekly output
* satisfying S1–S2 filter
* present in Excel file
No alerts for other options.
Automation flow
Step 1
Fetch hourly OHLC from Upstox.
Step 2
Detect first trading candle of each option.
Step 3
Group candles week-wise using real trading days.
Step 4
After week completes:
calculate weekly High Low Close.
Step 5
Generate pivots for next week.
Step 6
Apply filters:
S1–S2 distance rule
S1 ≤ 70 rule
Step 7
Generate Excel with filtered options.
Step 8
Automatically activate alert tracking for same options.
Step 9
During next week:
monitor live LTP.
Step 10
If price touches S1 → send WhatsApp alert.
System expectations
Fully automated.
No manual pivot calculation.
No manual alert selection.
No mid-week pivot change.
New option contracts must automatically start from first trading day.
Every week:
* pivots generated
* filtered output created
* alert list updated automatically
Deliverables expected
Upstox API integration
Python automation scripts
First-appearance detection logic
Weekly grouping engine
Holiday handling
Pivot calculation engine
Filter configuration (percentage editable)
Excel auto generation
Auto alert activation from output
WhatsApp integration
Setup instructions