How to bulk import instruments from a txt file |
ArthaChitra has a import feature which facilitates user to import instrument definitions from a txt/csv file. This is helpful in case you want to append a large number of scrips at one go.
Given the open architecture of ArthaChitra, if you have a txt/csv file which contains the name etc of the scrip/symbols then you can custom code your own instrument definition import type. You can use the same to parse and import the contents of the txt/csv file using the 'Import Instrument Definition' feature.
ArthaChitra by default comes some pre-defined scripts which lets you import Instrument Definitions. We will further discuss them below:
Please follow the below steps to import a Instrument.txt file into ArthaChitra
Delete existing Instrument Definitions
Before any bulk import you can delete the existing instrument definitions by following the below steps.
Note: The above will delete all instrument definitions and is a irrecoverable process. It is advisable you take necessary backups.
The Default Instrument Definition import type lets you import instrument definition exported by ArthaChitra.
The default instrument definitions are appended in *.txt file separated by ';' (semi-colon - without the ') with the following values:
The header format for the txt file will be:
@Name;@Description;@InstrumentType;@Exchange;@Currency;@TickSize;@SessionTemplate;@Rollover;@PointValue;@DefaultQuantity;@QuantityDivisor};@Adapter Symbols;@Dividends;@Splits
The below table further clarifies the fields.
Field | Type | Description |
---|---|---|
Name | Max length 255 | |
Description | Max length 255 | |
Instrument Type | ||
Exchange | ||
Currency | ||
Tick size | Tick size of the instrument | |
Session Template | Session Template | |
Rollover | String value (applicable for Futures scripts only) | |
Point value | Point value of the instrument | |
Default quantity | Default quantity | |
Quantity divisor | Quantity divisor - this is reserved from fractional shares | |
Connection symbols | Connection symbol separated by ',' (comma - without the ') | |
Dividends | Date-Amount (separated by ',' (comma - without the ') | |
Splits | Date-Factor (separated by ',' (comma without the ') |
Note: Entries beginning with '#' (without the ') are treated as comments and will be ignored
An Instrument List is a text file separated by ';' (semi-colon without the ') having 3 (three) fields namely
An example will be:
@InstrumentList;Cash;^NIFTY NSE,BERGEPAINT NSE,ONGC NSE,RELIANCE NSE,TVSMOTOR NSE,BANKNIFTY 05 2022 NSE
Note: The Instrument names must conform the naming conventions as mentioned here
The NSE Stock Instrument Definition Import Type lets one to import the scrips as found in the NSE Bhavcopy