npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zero65tech/indian-stock-market

v4.1.10

Published

Indian Stock Market Toolkit

Downloads

324

Readme

indian-stock-market

This utility provides functions to manage and query information related to trading schedules, market openings, and expiries for Indian Stock Market. The utility is written in JavaScript and can be used in Node.js environments.

Features

  • Market Status: Determine whether the market is currently open or closed.
  • Holiday Check: Verify if a specified date is a market holiday.
  • Expiry Information: Obtain accurate monthly and weekly expiry dates for Futures (FUT) and Options.
  • Symbol Breakdown: Receive detailed breakdowns for Call Options (CE), Put Options (PE), and Futures (FUT) symbols in the required format.
  • Comprehensive Symbol Matching: Efficiently match symbols and provide complete breakdowns.
  • Holiday Database: Access an up-to-date list of public holidays and special days.
  • Dynamic Updates: Benefit from regularly updated lists of public holidays and special days, ensuring accuracy every year.

Our utility is designed to enhance your trading experience by providing precise market status information and comprehensive symbol details.

Usage

To get started with the Indian Stock Market package, follow these steps:

Package Installation

  npm install @zero65tech/indian-stock-market

Import Functions in your project

  const { info, isOpen, hasOpened, hasClosed, isHoliday } = require('@zero65tech/indian-stock-market')

Functions explanation

Note:

  • This utility uses IST (Indian Standard Time) for date and time calculations.
  • All times are represented in a 24-hour format

1. info(symbol)

This function analyzes a given trading symbol and returns information about the financial instrument, including script, expiry, expiry date, strike (if applicable), and type (FUT, PE, CE). It supports both monthly and weekly expiries for options.

Example Usage:

const result = exports.info("NIFTY22JAN12000CE");
// Output: { script: 'NIFTY', exp: '22JAN', expiry: '2024-01-25', strike: 12000, type: 'CE' }

2. isOpen()

This function checks if the market is currently open based on the Indian Standard Time (IST). It considers holidays and special days.

Example Usage:

const isOpen = exports.isOpen();
// Output: true or false

3. hasOpened()

This function checks if the market has opened for the current day based on Indian Standard Time (IST). It considers holidays and special days.

Example Usage:

const hasOpened = exports.hasOpened();
// Output: true or false

4. exports.hasClosed()

This function checks if the market has closed for the current day based on Indian Standard Time (IST). It considers holidays and special days.

Example Usage:

const hasClosed = exports.hasClosed();
// Output: true or false

5. exports.isHoliday(date)

This function checks if a given date is a holiday. By default, it checks the current date if no date is provided. The function considers predefined holidays and special days.

Example Usage:

const isHoliday = exports.isHoliday("2024-01-01"); 
// Output: false
// 2024-01-01 is not a Holiday

| Expiry | Weekly (OPT Only) | Monthly (FUT & OPT) | |:-|:-:|:-:| | Stocks | - | Thursday | | Nifty | Thursday | Thursday | | Nifty Bank | Wednesday | Thursday | | Nifty Financial | Tuesday | Tuesday |

The weekly expiry format is <YY><M><DD>. The month format is 1 for JAN, 2 for FEB, 3, 4, 5, 6, 7, 8, 9, O(capital o) for October, N for November, D for December.