AO是(前一个AO+前一个AC )/2,这句话不是很会写,请大佬帮忙
def handle_data(context,data):
for stock in g.security:
df = attribute_history(stock,g.p1)
AO = (AO[1]+(df['open'][1]+df['high'][1]+df['close'][1]+df['low'][1])/4))/2
AC = ((df['open'][2]+df['high'][2]+df['close'][2]+df['low'][2])/4)
print(AC)