图表交易,请问这里第二个参数我输入659.8,点确定后再打开来看的时候变成了59.799988呢?这个细微的差距影响到了实盘,请问我该怎么解决?版本4.22,运行环境64位win8.1,劳驾了!!!
公式全部代码如下:
input:ss(2,1,999,1),p(0,0,400000,1),wt(0,-20,20,1),tbzs(3,0,20,1);
VARIABLE:dzsATR=drawnull,doubleATR=drawnull,threeATR=drawnull,cfT=0,CFP=0,eckcON=0;//eckcON为二次开仓开关。
ATR:=if(tbzs=0,ref(MA(tr,20),1),(tbzs-1)*mindiff);
abb:=(time0-timetot0(dynainfo(207))<=20) or not(islastbar);
mck:=(h-l)/ma(tr,20);
3D:=if(ref(holding,1)>0,llv(ref(l,1),2),drawnull);
hh:if(cfT=0 and p<>0 and date[DATACOUNT]=date,p,drawnull),LINETHICK2,COLORRED;
hhh:if(cfP=0 and wt<>0 and eckcON=1 AND date[DATACOUNT]=date,p+wt*mindiff,drawnull),LINETHICK2,COLORRED;
//收盘和夜盘平仓
IFclose:=time=closetime(0) or (time=closetime(1) and closetime(1)<>141500);
if holding>0 and IFclose and abb and dynainfo(54)<>c then begin
sell(1,holding,marketr);
dzsATR:=drawnull;
doubleATR:=drawnull;
threeATR:=drawnull;
end
//开多
if h>=hh then begin
if o<=hh and holding=0 and not(IFclose) then BEGIN
buy(1,ss,limitr,hh+mindiff*4);
dzsATR:=hh-ATR;
doubleATR:=hh+ATR*2;
threeATR:=hh+ATR*3;
end
cfT:=1;
end
if h>=hhh then begin
if o<=hhh and holding=0 and eckcON=1 and not(IFclose) then BEGIN
buy(1,ss,limitr,hhh+mindiff*4);
dzsATR:=hhh-ATR;
doubleATR:=hhh+ATR*2;
threeATR:=hhh+ATR*3;
end
if h>hhh then cfP:=1;
end
//破3根K线最低价平仓
if holding>0 and l<3D then BEGIN
sell(1,holding,marketr);
dzsATR:=drawnull;
doubleATR:=drawnull;
threeATR:=drawnull;
eckcON:=1;
end
//ATR止损
if holding>0 then begin
if h>doubleATR then dzsATR:=max(dzsATR,ENTERPRICE-mindiff*4);//突破2倍ATR后上移止损
if h>threeATR then dzsATR:=max(dzsATR,ENTERPRICE-mindiff*2);//突破3倍ATR后上移止损
end
CorL:=if(enterbars=0 or dzsATR>ref(dzsATR,1),c,l);
if CorL<dzsATR and holding>0 then BEGIN
sell(1,holding,marketr);
dzsATR:=drawnull;
doubleATR:=drawnull;
threeATR:=drawnull;
eckcON:=1;
end
//脉冲大K线平仓
ccl:=openint<ref(openint,1);
if holding>0 and ccl and mck>5 and c<>h then begin
sell(1,holding,marketr);
dzsATR:=drawnull;
doubleATR:=drawnull;
threeATR:=drawnull;
end
if holding>0 and mck>7 and c<>h then begin
sell(1,holding,marketr);
dzsATR:=drawnull;
doubleATR:=drawnull;
threeATR:=drawnull;
end
//日内全局变量归零处理
//if time=CLOSETIME(0) then eckcON:=0;
止损线:max(dzsatr,3d),COLORGREEN;
//深绿色COLOR238e23
//调试
2atrr:doubleATR;
3atr:threeatr;
input:ss(2,1,999,1),p(0,0,400000,1),wt(0,-20,20,1),tbzs(3,0,20,1);
范围应该没有问题吧
只发现动力煤一个品种上有问题
一楼少写了个6,应该是:“请问这里第二个参数我输入659.8,点确定后再打开来看的时候变成了659.799988呢?”不好意思
请帮忙解答下!!!
input:ss(2,1,999,1),p(0,0,400000,0.001)
步长也用小树呢
input:ss(2,1,999,1),p(0,0,400000,0.001)
步长也用小树呢
"步长也用小树",请问小树是什么意思,说详细点行吗?万分感谢!!!