Rss & SiteMap

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

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

标题:在达到条C时平仓此后不再开仓,怎么写?

1楼
qq代人发帖 发表于:2014/11/25 9:13:29
请教:在达到条C时平仓此后不再开仓,怎么写?
2楼
pyd 发表于:2014/11/25 9:17:07
VARIABLE:n=0;
if 开仓条件 and n=0 then buy(holding=0,1,market);
if 条件c then begin
sell(holding>0,holding,market);
n:=1;
end
3楼
向日葵 发表于:2014/11/25 9:34:24
谢谢
4楼
向日葵 发表于:2014/11/25 9:50:12
老师,我用上面的方法测试了,13:45分平多仓即空仓后,14点多,仍然还能开仓,这怎么办啊?
5楼
pyd 发表于:2014/11/25 9:52:22

你说的不再开仓是当天不再开仓吗?

[此贴子已经被作者于2014/11/25 9:53:01编辑过]
6楼
向日葵 发表于:2014/11/25 9:52:54
我的意思是:这样平仓后,在此后N周期内就不再开仓了,或日内就不再开仓了。请指导
7楼
pyd 发表于:2014/11/25 9:55:43

平仓后当然不再开仓

VARIABLE:n=0,m=0;
if 开多条件 and n=0 then buy(holding=0,1,market);
if 平多条件 then begin
sell(holding>0,holding,market);
n:=1;
end 
if 开空条件 and m=0 then buyshort(holding=0,1,market);
if 平空条件 then begin
 sellshort(holding<0,holding,market);
 m:=1;
 end

if time=CLOSETIME(0) then BEGIN
n:=0;
m:=0;
end

[此贴子已经被作者于2014/11/25 9:59:58编辑过]
8楼
向日葵 发表于:2014/11/25 10:16:58

/平仓后当然不再开仓

VARIABLE:n1=0,m11=0;
if 开多条件 and n1=0 then buy(holding=0,1,market);
if PD4 then begin
sell(holding>0,holding,market);
n1:=1;
end 
if 开空条件 and m11=0 then buyshort(holding=0,1,market);
if PK4 then begin
 sellshort(holding<0,holding,market);
 m11:=1;
 end

if time=CLOSETIME(0) then BEGIN
n1:=0;
m11:=0;
end

 

其中:PD4为另外的平多条件,PK4为另外的平空条件。n,m因为重复,改为n1,m11.

这样变动一下可以吗?老师

 

9楼
pyd 发表于:2014/11/25 10:25:11
可以,是平仓后当天不再开仓不是当然,笔误。
10楼
向日葵 发表于:2014/11/25 10:42:03

还不行啊老师,还是13:45分平多仓即空仓后,14点多,仍然还能开仓,这怎么办啊?

共11 条记录, 每页显示 10 条, 页签: [1] [2]


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