Documentation
¶
Index ¶
Constants ¶
const MasterURL = "https://images.dhan.co/api-data/api-scrip-master.csv"
Variables ¶
This section is empty.
Functions ¶
func CheckAndDownload ¶
CheckAndDownload refreshes the master once the most recent 08:30 IST cutoff has passed. Before 08:30 it continues to use the previous day's file.
func GetExpiryDates ¶
Types ¶
type Filter ¶
type Filter struct {
Exchange string
Segment string
SecurityID string
Instrument string
ExpiryCode *int
TradingSymbol string
TradingSymbolContains string
DisplayName string
DisplayNameContains string
ExpiryDate *time.Time
StrikePrice *float64
LotSize *float64
TickSize *float64
OptionType string
ExpiryFlag string
ExchangeInstrument string
Series string
SymbolName string
}
Filter fields are combined with AND. String fields are case-insensitive exact matches; TradingSymbolContains and DisplayNameContains are partial matches.
type Instrument ¶
type Instrument struct {
Exchange string
Segment string
SecurityID string
Instrument string
ExpiryCode int
TradingSymbol string
LotSize float64
DisplayName string
ExpiryDate time.Time
StrikePrice float64
OptionType string
TickSize float64
ExpiryFlag string
ExchangeInstrument string
Series string
SymbolName string
}
Instrument is one row from Dhan's compact instrument master.
func FindInstruments ¶
func FindInstruments(filter Filter) []Instrument
func Load ¶
func Load(path string) ([]Instrument, error)
Load parses path and replaces the package's in-memory instrument list.
type OptionStrikes ¶
func GetOptionStrikes ¶
func GetOptionStrikes(filter Filter, price float64, max int) OptionStrikes