can you pass a list to datastreamDSWS using ds.get_data?

I'd liuke to pass a list of tickers:


stocks = ds.get_data(tickers= list, fields=['P'], start = '-1Y', end = '-0d', freq = 'D')


It sthat possible?


Thanks

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @tikhon.savrasov

    Refer to the DataStream GETTING STARTED WITH PYTHON guide, it accepts a comma-separated string.

    image

    If you need to use a list, you need to convert it to a comma-separated string.

    stocks = ds.get_data(tickers= ','.join(list), fields=['P'], start = '-1Y', end = '-0d', freq = 'D')