Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 2 2

How to download stock market breadth for sp500(McClellan oscillator) using EIKON API with Python?

I want to download McClellan Oscillator Indicator for sp500 using Eikon api with python ?


screenshot-from-2023-01-24-16-09-26.png

eikonpython#technology
icon clock
10 |1500

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

Hi @soroosh,

May I ask what was the formula in the excel sheet cell in your screenshot?

@soroosh

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvotes
Accepted
10.2k 18 6 9

@soroosh So we can get the number of advances and declines historically using our RD library:

import refinitiv.data as rd
rd.open_session()
rd.get_history(universe=".AD.SPX", fields=['ISSUES_ADV','ISSUES_DEC'], interval="1D")

1674600878700.png

From here you can easily create the McClellan Oscillator.

To get the current latest value snapshot you can use the rd.get_data function:

rd.get_data(
    universe=['.AD.SPX'],
    fields=['CF_DATE','CF_TIME','ISSUES_ADV','ISSUES_DEC']
)

1674601291286.png

I hope this can help.


1674600878700.png (131.8 KiB)
1674601291286.png (23.7 KiB)
icon clock
10 |1500

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

Upvotes
10.2k 18 6 9

@soroosh I don't think we would deliver the Mclellan Oscillator as a precalc'd item but we have 3 potentially helpful fields - 'TR.ISSUESADVANCED', 'TR.ISSUESDECLINED', and 'TR.25DAYSMEANADVANCEDECLINERATIO' . Once you have these it is pretty straightforward to calculate the Oscillator in Python. However these fields don't seem to be populated which is strange - I have opened a support case number: 12137983 to look into this and will report back as soon as they respond. I hope this can help. Please bear with us.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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