帮忙看下这个问题在哪里 ,越改问题越多,图上好多小白开仓信号,
1:希望再帮忙修改每天正反只能个开一次
2:我写的止损条件好像图中显示的并不正确,本来是当开仓价格回碰当天开盘价止损。
万分感谢
runmode:0;
dayopen:=valuewhen(date<>ref(date,1),o);
enterlongcond:=high>=dayopen;
entershortcond:=low<=dayopen;
exittime:=time>=1458;
if holding=0 and time>1015 then begin
if enterlongcond then
buy(1,1,limitr,close+mindiff);
if entershortcond then
buyshort(1,1,limitr,close-mindiff);
end
if holding>0 and time>1015 then begin
exitlongcond:=enterprice<=dayopen;
if exitlongcond then
sell(1,holding,limitr,dayopen);
if enterlongcond and enterbars>=1 then
sell(1,holding,limitr,close-mindiff);
buyshort(1,1,limitr,close-mindiff);
if exittime then
sell(1,holding,limitr,o);
end
if holding<0 and time>1015 then begin
exitshortcond:=enterprice>=dayopen;
if exitshortcond then
sellshort(1,holding,limitr,dayopen);
if entershortcond and enterbars>=1 then
sellshort(1,holding,limitr,closse+mindiff);
buy(1,1,limitr,close+mindiff);
if exittime then
sellshort(1,holding,limitr,o);
end
/
资产:asset-500000,noaxis,coloryellow,linethick2;
盈亏:(asset-500000)/500000,linethick0;
胜率:PERCENTWIN,linethick0;