EMA with variable period

Hello,

I am using python and receive my data via Eikon API.

I want to receive historical EMA datas like 'ema(26,close())'. The 'ema(26,close())' code is working in Eikon Monitor as 'signal(ema(26,close()))'.

I does not see the ema codes in Eikon API - Data Item Browser

Is it possible to receive EMA or other signal datas with different periods from Eikon API?

Best Answer

  • Hi @osmana

    You can try this approach:

    df,err = ek.get_data('IBM.N',['TR.PRICECLOSE.date','TR.PRICECLOSE'], {'sdate' :'2019-01-01','edate':'0D'})
    df['EMA'] = pd.Series.ewm(df['Price Close'], span=26).mean()
    df.tail(10)

    image


Answers