Nifty Options Tracker is a Node.js application that periodically fetches and stores options chain data for NIFTY from the NSE website. It logs data in a MongoDB database and notifies via Telegram.
- Connects to MongoDB to store options data
- Fetches real-time options chain data from NSE
- Logs and updates strike price data with timestamps
- Sends notifications via Telegram for success/failure
- Runs periodically during trading hours on trading days
- Node.js & npm installed
- MongoDB database
- Telegram bot for notifications
- Clone the repository:
git clone https://github.com/yourusername/nifty-options-tracker.git cd nifty-options-tracker
- Install dependencies:
npm install
- Create a
.env
file with the following variables:MONGODB_URL=your_mongodb_connection_string TELEGRAM_BOT_TOKEN=your_telegram_bot_token TELEGRAM_CHAT_ID=your_telegram_chat_id NSE_API=your_nse_cookie
- Start the application:
node index.js
- The script checks if today is a trading day.
- If within trading hours (9:15 AM - 3:30 PM IST), it fetches options data from NSE.
- Data is stored in MongoDB with timestamps.
- A notification is sent to Telegram on success or failure.
- The process repeats every minute during trading hours.
const DailyOptionsDataSchema = new mongoose.Schema({
date: { type: String, required: true, unique: true },
timestamps: [{ timestamp: String }],
strikePrices: [{
strikePrice: { type: Number, required: true },
data: [{
CE: { timestamp: String, OI: Number, OICHANGE: Number, BuyQty: Number, SellQty: Number },
PE: { timestamp: String, OI: Number, OICHANGE: Number, BuyQty: Number, SellQty: Number }
}]
}]
});
Feel free to submit issues and pull requests to improve the project.
This project is licensed under the MIT License.