Rss & SiteMap

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

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

标题:[建议]建议增加次周期收盘价交易函数

1楼
鸟人 发表于:2012/12/25 12:41:49
        好像没有这个函数吧,还是我没找到?
2楼
jinzhe 发表于:2012/12/25 13:04:05

次周期收盘价?refx(c,1)

但是是未来

3楼
qwe123 发表于:2012/12/25 13:17:55

给你一个模板,这是我一直使用的

 

//股指期货自动交易程序(长线交易系统5号系统)(30分钟持仓过夜)
//编制:
//日期:2012年12月8日 定稿

{
//加密及期限
drawtextex(1,1,200,800,engincode());
rzb:=strcmp(engincode(),'aaaaaaaaaa');
if rzb<>0 then
 begin
 drawtextex(1,1,500,500,'程序不能在此计算机上运行');
 exit;
 end

有效期:1121230,linethick0;
账号:11111,linethick0;
zhh:=strtonum(taccount(1));

if zhh<>账号 then
 begin
 drawtextex(1,1,500,500,'授权账号不正确,程序无法使用');
 exit;
 end
 
if date>有效期 then
 begin
 drawtextex(1,1,500,500,'已过授权时间,程序无法使用');
 exit;
 end
}
if datatype<>4 then
 begin
 drawtextex(1,1,500,500,'本程序使用30分钟周期,请切换到30分钟周期');
 exit;
 end

//========================================================
//交易控制变量
variable:a1=1;
variable:a2=0;
variable:c1=1;
variable:c2=1;
variable:c3=1;
variable:c4=1;

//**********************************
//交易手数:
tn:=1;

//最大持仓量
cx:=3;

//提前下单量(秒)
xd1:=3;

//滞后下单量(秒)
xd1:=3;

//交易时间区间
p1:=time>=091500 and time<=150000;
p2:=if(islastbar,dynainfo(207),time);
p3:=time0-timetot0(p2),linethick0;

//*************************************
r1:=barslast(date<>ref(date,1));
r2:=ref(o,r1);

//*******************************
hd:=if(islastbar,5,0.6);//k线中交易
hd1:=if(islastbar,5,0.2);//k线走完交易

//*******************************


//*******************************
//收盘前清仓
if p2>=150955 then
 begin
 sellshort(holding<0,0,limitr,c-hd1);
 sell(holding>0,0,limitr,c+hd1);
 end

//*************************************
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-2000000,colorred,linethick1,noaxis;
日盈亏:asset-ref(asset,r1+1),noaxis,colorred,linethick0;
持仓:holding,colorwhite,linethick0;
rr1:=barslast(month<>ref(month,1));
月盈利:asset-ref(asset,rr1+1),linethick0;

 

 

如果提前xd1秒下单,你的条件是 A

 

if a and p3<=xd1 then.................

 

 

如果是滞后下单

if ref(a,1) and p3>180-xd2{假如是3分钟周期} then......

 

如果是次周期收盘价交易,提前xd1秒下单。

 

if ref(a,1) and p3<=xd1 then。。。。。。。

 

 


 

[此贴子已经被作者于2012-12-25 13:19:51编辑过]
4楼
jinzhe 发表于:2012/12/25 13:22:35
这个是提前下单?回错帖了吧
5楼
qwe123 发表于:2012/12/25 13:38:39

滞后下单这么写:

if ref(a,1) and p3<180-xd2 and p3>180-xd2-2 then {假定是3分钟周期,滞后3-5秒下单}

[此贴子已经被作者于2012-12-25 13:39:18编辑过]
6楼
qwe123 发表于:2012/12/25 14:14:00

//收盘前清仓
if p2>=150955 then
begin
sellshort(holding<0,0,limitr,c+hd1);
sell(holding>0,0,limitr,c-hd1);
end

 

//滞后下单量(秒)
xd2:=3;

 

不好意思,有点错误。

7楼
鸟人 发表于:2012/12/25 14:32:35
谢谢QWE123,这个好像有点复杂,我还是希望金字塔能加个函数,既然有次周期最高价最低价这些没用的函数,为什么就不能加个有用的呢
8楼
ackvz 发表于:2012/12/25 14:41:50

隔一周期下单  很简单的

将下单条件由本周期达成 改为 上周期达成

9楼
ackvz 发表于:2012/12/25 14:42:36

想隔多少周期都成 改为前N周期条件达成

不需要蛋疼的函数

10楼
qwe123 发表于:2012/12/25 14:42:45

那样的话和你的条件就有很多关系,在一个大系统里显然没有你自己写的效率高。这个一点都不麻烦啊。

[此贴子已经被作者于2012-12-25 14:43:15编辑过]
共10 条记录, 每页显示 10 条, 页签: [1]


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