Multiple Periods in Codebook

Client has a list of companies and one of which is 2382.HK. He wants to get the quarterly data but this specific RIC has no quarterly data. Now, client wants to know how he can write it to get the quarterly and semi annual data in 1 request? Product is API/Codebook. Thank you!

Answers

  • Hi Lizalyn,

    I checked and 6M data seem to indeed be unavailable. As a result, I would suggest runing this in CodeBook:

    ThreeM = ld.get_history(
    universe="2382.HK",
    fields=["BID", "ASK", "TR.Revenue"],
    interval='3M',
    start="2015-01-01",
    end="2025-10-01")

    months_divisible_by_3 = [i for i in range(1, 13) if i % 3 == 0]
    df_filtered = ThreeM[ThreeM.index.month.isin(months_divisible_by_3)]
    image.png

    Is this ok? Was it what you were after?