from WindPy import *
import pandas as pd
from pandas import DataFrame
w.start()
all_data={}
a=w.weqs('tp')
for ticker in a.Data[0]:
all_data[ticker]=w.wsd(ticker,'close','20170101')
price=DataFrame({tic:data.Data[0] for tic,data in all_data.items()},index=all_data[next(iter(all_data))].Times) # next (iter(my_dict))get firt key of a dict
syzs=(1+price.pct_change()).cumprod()
syzs.iloc[0,:]=1
syzs.plot()
sy=syzs.resample('W',how='last').pct_change()