Rss & SiteMap

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

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

标题:这样编写有问题吗?请改正

1楼
300qh 发表于:2013/1/19 11:12:35


买1开多条件:********;
买1止损条件:********;
买1止盈条件:********;
买1移止条件:********;
if 买1开多条件 and holding<=0 then begin
sellshort(1,0,thisclose);
buy(1,1,thisclose);
end

if 买1止损条件 and holding>0 then begin
sell(1,0,thisclose);
end

if 买1止盈条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

if 买1移止条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end


买2开多条件:********;
买2止损条件:********;
买2止盈条件:********;
买2移止条件:********;
if 买2开多条件 and holding<=0 then begin
sellshort(1,0,thisclose);
buy(1,1,thisclose);
end

if 买2止损条件 and holding>0 then begin
sell(1,0,thisclose);
end

if 买2止盈条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

if 买2移止条件 and holding>0 then BEGIN
sell(1,0,thisclose);
end

 

卖1开空条件:********;
卖1止损条件:********;
卖1止盈条件:********;
卖1移止条件:********;
if 卖1开空条件 and holding>=0 then begin
sell(1,0,thisclose);
buyshort(1,1,thisclose);
end

if 卖1止损条件 and holding<0 then begin
sellshort(1,0,thisclose);
end

if 卖1止盈条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

if 卖1移止条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

 

卖2开空条件:********;
卖2止损条件:********;
卖2止盈条件:********;
卖2移止条件:********;
if 卖2开空条件 and holding>=0 then begin
sell(1,0,thisclose);
buyshort(1,1,thisclose);
end

if 卖2止损条件 and holding<0 then begin
sellshort(1,0,thisclose);
end

if 卖2止盈条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

if 卖2移止条件 and holding<0 then BEGIN
sellshort(1,0,thisclose);
end

2楼
jinzhe 发表于:2013/1/21 9:11:11

把持仓判断条件写在下单语句中比如

sellshort(holding<0,)

buy(holding=0,)

3楼
300qh 发表于:2013/1/21 20:46:48

以上这样,如果有很多组买卖条件,只要不断增加就可以了是吗?

持仓判断写在开平仓函数里,与直接写在外面,有什么区别?请指点一下

4楼
jinzhe 发表于:2013/1/22 8:55:28
上面的语法都没问题,平仓反手把持仓判断写进下单语句而不是外面是怕下单时平仓判断有误
5楼
300qh 发表于:2013/1/22 18:38:28
谢谢大师傅
共5 条记录, 每页显示 10 条, 页签: [1]


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