Pulling up timeseries data and creating mathematical equation from the output

Hi Team,

We have a client who's looking to pull up timeseries for TR.Liquidity10DAmt , however, we do not have a parameter to directly retrieve this data. I can attach a sample calculation of this data item and requesting for your assistance in providing a sample code that client can use.


liq-10d.png


Thank you


Best Answer

  • Jirapongse
    Answer ✓

    @chrisma.salut

    The code could look like htis:

    df = ek.get_timeseries("ADML.L",start_date='2021-11-05',end_date='2022-03-19')
    df["LiquidityAmt"] = df["VOLUME"]*(df["CLOSE"]/abs((df["CLOSE"]/df["OPEN"]-1)*100))
    df['Liquidity10DAmt'] = df["LiquidityAmt"].rolling(window=10, min_periods=1).mean()
    df

    The output is:

    1648029201843.png