编程语言
首页 > 编程语言> > 新人Python模型求问

新人Python模型求问

作者:互联网

新人求问Python问题

这里面代码有错误,请问怎么解决?
def init(context):
g.index=‘600011.SH’

Variables=(var0(0),var1(0),kline(0),dline(0));
Variables=(avgPriceBuy(0),avgVol(0),avgPriceExit(0));

value1=Stochastic(High,Low,close,14,3,3,1,var0,var1,kline,dline);

avgPriceBuy=Average(Close,10);
avgVol=Average(Volume,10);
avgPriceExit=Average(Close,20);

if(kline>dline and kline[1]<=dline[1] and Volume>avgVol and Close>avgPriceBuy):

order_target_percent(g.index,1)  
    
log.info("全仓买入{0}".format(g.index));

if(close<AvgPriceExit):

order_target_percent(g.index,0)
 
log.info("全仓卖出{0}".format(g.index))欢迎使用Markdown编辑器

标签:index,avgPriceBuy,Python,求问,kline,新人,avgVol,Average,dline
来源: https://blog.csdn.net/chao24xia/article/details/101197191