Trado Hackathon
Trado Hackathon
Overview
Welcome to the TRADO x IIT Ropar Hackathon!
Your task is to build a real-time data processing engine and a backtesting engine to test a simple intraday Bank Nifty options
strategy using both live and recent historical data.
You’ll receive boilerplate code for both parts to get started quickly — focus on applying your logic, improving performance, and
managing real-world trading constraints.
Objectives
Connect to EMQX MQTT broker
Subscribe to key indices: BANKNIFTY , NIFTY , FINNIFTY , MIDCPNIFTY
Calculate ATM strikes and subscribe to CE/PE options at ATM ± 5 strikes
Fetch token numbers via Trado API
Store all market data in PostgreSQL using TimescaleDB
Setup
Node.js 16+
PostgreSQL with TimescaleDB extension
Run:
1 createdb market_data
2 psql -d market_data -f scripts/db-schema.sql
3 npm install
4 npm start
Strategy Rules
Entry at 9:25 AM:
Buy 1 lot ATM CE + 1 lot ATM PE
Exit Conditions:
Individual SL: Exit if a position loses 25%
Total P&L Target: Exit both if combined return is +25%
Total P&L SL: Exit both if combined return is -10%
Square-off all positions at 3:15 PM
Adjustment Logic:
If both exited before 2:00 PM, re-enter fresh ATM CE/PE
Only 1 adjustment allowed
Re-entries held till 3:15 PM without SL/Target
Tasks
Read historical data from TimescaleDB
Simulate trades based on above rules
Track open positions and calculate P&L
Ensure support for multiple indices
Backtest over past 3 trading days
DB Schema (Simplified)
Setup
Install dependencies and set up .env
Run:
1 npm install
2 cp .env.sample .env
3 npm start
Deliverables
Submit:
Working codebase for both parts
A markdown on what were the challenges you faced during implementation of both the parts.
Sample output or logs showing strategy results
Let the market teach you. Best of luck!
Built by Traders. Built for Traders.
— Team Trado