Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]

1楼
苦麻菜真好吃 发表于:2016/6/24 14:38:09
老师帮看一下、这代码是不是哪里写错了,开仓能执行、平仓达到条件了也没平仓
思路是这样的:1、最新价比开盘价高5个点、开多,赚5个点平仓、亏8个点平仓、反之;这是后台的


if  DYNAINFO2(7, PZ1)<=enterprice-8*MINDIFF then begin//多损
tsell(1,1,MKT,0);
 end;
if  DYNAINFO2(7, PZ1)>=enterprice+5*MINDIFF then begin//多盈
tsell(1,1,MKT,DYNAINFO2(7, PZ1),0);
end



if DYNAINFO2(7, PZ1)>=enterprice+8*MINDIFF then begin//空损
tsellshort(1,1,MKT,DYNAINFO2(7, PZ1),0);
end
if DYNAINFO2(7, PZ1)<=enterprice-5*MINDIFF then begin //空盈
tsellshort(1,1,MKT,DYNAINFO2(7, PZ1),0);
end
if DYNAINFO2(7, PZ1)<=o-4*mindiff and tbuyholdingex(ZH,pz1,0)=0 and tsellholdingex('',pz1,0)=0 then begin//开空
tbuyshort(1,1,MKT,DYNAINFO2(7, PZ1),0);
end

if DYNAINFO2(7, PZ1)>=o+4*mindiff AND tbuyholdingex('',pz1,0)=0 and tsellholdingex('',pz1,0)=0 then begin //开多
tbuy(1,1,MKT,DYNAINFO2(7, PZ1),0);
end

2楼
jinzhe 发表于:2016/6/24 14:42:27
后台是用tenterprice,不是enterprice
3楼
苦麻菜真好吃 发表于:2016/6/24 14:49:59
谢谢、我再试试
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.