diff --git a/mass-index.py b/mass-index.py new file mode 100755 index 0000000..74ce981 --- /dev/null +++ b/mass-index.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +from __future__ import print_function +import time +import intrinio_sdk as intrinio +from intrinio_sdk.rest import ApiException + +intrinio.ApiClient().set_api_key('OjZjZGIzZmYyNDg4NDZjYjQ4NzAzMzAyZjg0OTU5MDcz') +intrinio.ApiClient().allow_retries(True) + +identifier = 'AAPL' +ema_period = 9 +sum_period = 25 +start_date = '2022-10-01' +end_date = '2022-11-01' +page_size = 100 +next_page = '' + +response = intrinio.SecurityApi().get_security_price_technicals_mi(identifier, ema_period=ema_period, sum_period=sum_period, start_date=start_date, end_date=end_date, page_size=page_size, next_page=next_page) +print(response) diff --git a/mass-index.txt b/mass-index.txt new file mode 100644 index 0000000..5cccd21 --- /dev/null +++ b/mass-index.txt @@ -0,0 +1,57 @@ +{'indicator': {'name': 'Mass Index', 'symbol': 'mi'}, + 'next_page': 'MjAyMi0xMC0wMw==', + 'security': {'code': 'EQS', + 'company_id': 'com_NX6GzO', + 'composite_figi': 'BBG000B9XRY4', + 'composite_ticker': 'AAPL:US', + 'currency': 'USD', + 'figi': 'BBG000B9Y5X2', + 'id': 'sec_agjrgj', + 'name': 'Apple Inc', + 'primary_listing': True, + 'share_class_figi': 'BBG001S5N8V8', + 'ticker': 'AAPL'}, + 'technicals': [{'date_time': datetime.datetime(2022, 11, 1, 0, 0, tzinfo=tzutc()), + 'mi': 25.403274997377284}, + {'date_time': datetime.datetime(2022, 10, 31, 0, 0, tzinfo=tzutc()), + 'mi': 25.325100050916703}, + {'date_time': datetime.datetime(2022, 10, 28, 0, 0, tzinfo=tzutc()), + 'mi': 25.26091759738361}, + {'date_time': datetime.datetime(2022, 10, 27, 0, 0, tzinfo=tzutc()), + 'mi': 25.04263453384024}, + {'date_time': datetime.datetime(2022, 10, 26, 0, 0, tzinfo=tzutc()), + 'mi': 25.07934674656424}, + {'date_time': datetime.datetime(2022, 10, 25, 0, 0, tzinfo=tzutc()), + 'mi': 25.210923599454134}, + {'date_time': datetime.datetime(2022, 10, 24, 0, 0, tzinfo=tzutc()), + 'mi': 25.33276434466653}, + {'date_time': datetime.datetime(2022, 10, 21, 0, 0, tzinfo=tzutc()), + 'mi': 25.39192123785707}, + {'date_time': datetime.datetime(2022, 10, 20, 0, 0, tzinfo=tzutc()), + 'mi': 25.381910449217568}, + {'date_time': datetime.datetime(2022, 10, 19, 0, 0, tzinfo=tzutc()), + 'mi': 25.47509854020378}, + {'date_time': datetime.datetime(2022, 10, 18, 0, 0, tzinfo=tzutc()), + 'mi': 25.557979510415855}, + {'date_time': datetime.datetime(2022, 10, 17, 0, 0, tzinfo=tzutc()), + 'mi': 25.65841548155193}, + {'date_time': datetime.datetime(2022, 10, 14, 0, 0, tzinfo=tzutc()), + 'mi': 25.685567689141486}, + {'date_time': datetime.datetime(2022, 10, 13, 0, 0, tzinfo=tzutc()), + 'mi': 25.534275424028298}, + {'date_time': datetime.datetime(2022, 10, 12, 0, 0, tzinfo=tzutc()), + 'mi': 25.460161574091696}, + {'date_time': datetime.datetime(2022, 10, 11, 0, 0, tzinfo=tzutc()), + 'mi': 25.660865476097264}, + {'date_time': datetime.datetime(2022, 10, 10, 0, 0, tzinfo=tzutc()), + 'mi': 25.880212174871364}, + {'date_time': datetime.datetime(2022, 10, 7, 0, 0, tzinfo=tzutc()), + 'mi': 26.156668785092034}, + {'date_time': datetime.datetime(2022, 10, 6, 0, 0, tzinfo=tzutc()), + 'mi': 26.369535502579826}, + {'date_time': datetime.datetime(2022, 10, 5, 0, 0, tzinfo=tzutc()), + 'mi': 26.610633739058905}, + {'date_time': datetime.datetime(2022, 10, 4, 0, 0, tzinfo=tzutc()), + 'mi': 26.83345309960512}, + {'date_time': datetime.datetime(2022, 10, 3, 0, 0, tzinfo=tzutc()), + 'mi': 27.012773556089712}]}