相对于昨日收盘?
r1:=callstock('if00',vtclose,6,-1);
//参考了3楼回复,图表改为以下
if (c-r1)/r1>0.01 and ((currenttime>=145500 and islastbar) or (not(islastbar) and time>=145500)) then buy(holding=0,1,market);
//以下为后台程序化交易,写法
r1:=callstock('if00',vtclose,6,-1);
if (c-r1)/r1>0.01 and currenttime>=145500 then tbuy(tholding=0,1,mkt);
节日快乐!
这样写图表不妥,还要加个条件限定
if (c-r1)/r1>0.01 and (currenttime>=145500 and islastbar) or (not(islastbar) and time>=145500) then buy(holding=0,1,thisclose);
图表求昨结算求的是近似值,不是行情数据,所以最好换个值来算