start = '2017-12-20'
end = '2018-03-20'
import datetime
import ky
sdk = ky.Api("http://data-api.kuaiyutech.com/api.rpc")
print( 'trading date',sdk.get_trading_dates_by_date_range(end,start, exchange='SHSE')    )  
print(' ')


print( sdk.get_symbols_by_index('SHSE.000905'))

def getMostRecentTradingDayFromKy():
    end = datetime.datetime.today()
    start = end - datetime.timedelta(70)

    end = datetime.datetime.strftime(end,'%Y-%m-%d')
    start = datetime.datetime.strftime(start,'%Y-%m-%d')
    
    return sdk.get_trading_dates_by_date_range(end,start,exchange='SHSE')[-1]

print(getMostRecentTradingDayFromKy())