Models¶
Price Resolution Settings¶
-
enum
pygindex.models.IGPriceResolution(value)¶ Set of values defining available resolution settings when requesting historical price data.
Resolution means that the returned price values are going to be aggregates for the time period specified by the resolution value.
For example, selecting
IGPriceResolution.WEEKwill return max/min open/close values for each week, whereasIGPriceResolution.HOUR_3will return max/min open/close values for every 3 hour period.Valid values are as follows:
-
SECOND= <IGPriceResolution.SECOND: 'SECOND'>¶ 1 second
-
HOUR= <IGPriceResolution.HOUR: 'HOUR'>¶ 1 hour
-
HOUR_2= <IGPriceResolution.HOUR_2: 'HOUR_2'>¶ 2 hours
-
HOUR_3= <IGPriceResolution.HOUR_3: 'HOUR_3'>¶ 3 hours
-
HOUR_4= <IGPriceResolution.HOUR_4: 'HOUR_4'>¶ 4 hours
-
DAY= <IGPriceResolution.DAY: 'DAY'>¶ 1 day
-
WEEK= <IGPriceResolution.WEEK: 'WEEK'>¶ 1 week
-
MONTH= <IGPriceResolution.MONTH: 'MONTH'>¶ 1 month
-
MINUTE= <IGPriceResolution.MINUTE: 'MINUTE'>¶ 1 minute
-
MINUTE_2= <IGPriceResolution.MINUTE_2: 'MINUTE_2'>¶ 2 minutes
-
MINUTE_3= <IGPriceResolution.MINUTE_3: 'MINUTE_3'>¶ 3 minutes
-
MINUTE_5= <IGPriceResolution.MINUTE_5: 'MINUTE_5'>¶ 5 minutes
-
MINUTE_10= <IGPriceResolution.MINUTE_10: 'MINUTE_10'>¶ 10 minutes
-
MINUTE_15= <IGPriceResolution.MINUTE_15: 'MINUTE_15'>¶ 15 minutes
-
MINUTE_30= <IGPriceResolution.MINUTE_30: 'MINUTE_30'>¶ 30 minutes
-
User Authentication Data Object¶
-
class
pygindex.models.IGUserAuth(api_key: str, username: str, password: str)¶ Dataclass to hold User Authentication data
Configuration can be provided during initialisation, alternatively the following environment variables will be looked up if no arguments were provided:
IG_{UPPERCASE_PARAM_NAME}, for example:IG_API_KEY-
property
auth_req_data¶ Construct Authentication data
Constructs authentication data that will be used to obtain authentication key from IG Index API
- Returns
Dictionary containing authentication details
- Return type
-
property
IG API Configuration Data Object¶
-
class
pygindex.models.IGAPIConfig(platform: str = None)¶ Dataclass for API configuration
Configuration is provided during initialisation, otherwise, if no value is specified we will try to look up environment variable called
IG_PLATFORM.- Parameters
-
property
markets_url¶ Returns IG Index API Markets URL
This endpoint is used for multiple purposes:
Lookup details of a selection of epics
Lookup details of individual epic
Search for epics
- Returns
Markets API URL
- Return type
-
property
positions_url¶ Returns IG Index API Positions URL
- Returns
Positions API URL
- Return type
Session Data Object¶
Response Data Object¶
Instrument Data Object¶
-
class
pygindex.models.IGInstrument(dealing_rules: dict, instrument: dict, snapshot: dict)¶ Dataclass to hold IG Index Instrument data
IG Instrument is a financial instrument based on some underlying financial market instrument. IG Instruments do not represent real world identifiers and are used exclusively on IG Index platform.
More information about the IG Index terms can be found on their Glossary page.