For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 1 2 9

Eikon API for MACD(Moving Average) chart data

Hi Team,

I am deciding whether I should go for Eikon API.

Basically we would like to obtain the 5minute/3minute/1day MACD (moving average) chart data programatically on request basis.

Is Eikon API feasible to do that?

Thanks very much.

Cheers,

Juno

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
4.6k 26 7 22

@Juno Chan there are no pre-calculated intraday MACD values, and the pre-calc ones are a snapshot, rather than time series:

import pandas as pd
import eikon as tr

tr.set_app_id('your_eikon_id')

aapl_daily_macd, err = tr.get_data(['AAPL.O'], 
                                   ['TR.MovAvgCDLine1.date','TR.MovAvgCDLine1','TR.MovAvgCDLine2','TR.MovAvgCDSignal'])
aapl_daily_macd

As for the intraday, you can calculate it with the standard pandas tools, as get_timeseries() returns a pandas.Dataframe. The intervals that are supported are 'tick', 'minute', 'hour', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly'.

aapl_1_min = tr.get_timeseries(['AAPL.O'], ['TIMESTAMP', 'CLOSE'],interval='minute', start_date='2018-02-01', end_date='2018-02-02')

aapl_1_min_ewm_fast = aapl_5_min.ewm(span=12, min_periods=1).mean()
aapl_1_min_ewm_slow = aapl_5_min.ewm(span=26, min_periods=1).mean()

aapl_1_min_macd = pd.DataFrame(aapl_1_min_ewm_fast-aapl_1_min_ewm_slow)

You can resample 1 min series to get 3 and 5 mins with pandas.Series.resample().


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
5 1 2 9

Thanks @Zhenya Kovalyov for the python implementation. Is this based on the "Eikon API Proxy Beta"?

On the other hand, also seeing there is a .NET version of Eikon API getting time series of 1minute/30minute/daily. Could the 1minute intraday also be resampled to 5minute interval?

Just would like to compare the implementations between both .net and python.

Cheers,

Juno

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

You can resample any 1-min or tick data into any evenly spaced interval, it is simpler in python in my opinion, as the tool set for working with data is much reacher with the pandas data frame, however there is a bunch of examples how to do it in .net as well (for example, this). I would use python, as it also has access to the fundamental data API, something that the legacy .NET API will not get.

Click below to post an Idea Post Idea