以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  策略编写求助区  (http://weistock.com/bbs/list.asp?boardid=11)
----  请老师帮忙编个模型  (http://weistock.com/bbs/dispbbs.asp?boardid=11&id=13210)

--  作者:jacan888
--  发布时间:2012/7/21 15:42:13
--  请老师帮忙编个模型

请老师帮忙编个模型。

开多:;//开多条件

平空:;//平空条件

每天09:30后开新仓,14:52平掉所有仓位

止损:每手亏损N点止损(N点可调,想一手亏损到900~1500人民币就出来)

止盈:M根K线,从最高点反收益运行N1个点止盈(参数M,N1可自己设定)

开空买阳价,高G个单位(G参数1对映是0.2个点)

开多买阴价,低D个单位(D参数1对映是0.2个点)

另:下单交易,在当根K线运行到50秒后下单,不知能否可行。

谢谢了老师和各位高人。


--  作者:jacan888
--  发布时间:2012/7/21 18:12:25
--  是不是很难,还是我的思路编不出指标啊

是不是很难,还是我的思路编不出指标啊!

朋友们给点兴趣啊,谢谢了!


--  作者:jinzhe
--  发布时间:2012/7/23 8:48:16
--  

你这个要用走完k线提前下单的模式了,如果一分钟周期那么就是提前10秒

具体策略稍后给出


--  作者:jinzhe
--  发布时间:2012/7/23 9:18:39
--  

input:n(),m(),n1(),g(),d();
variable:zuigao=0;
开多:=;

t1:= time>=093000 and time<=145200;//交易时间

if t1 and 开多 and holding=0 and h>zuigao then begin
 buy(1,1,limitr,c+d);
 zuigao:=h;
 end//开多
 
if enterprice-c>=n then sell(1,0,market);//止损
if zuigao-c>=n1 then sell(1,0,market);//止盈

if time>145200 and time<=150000 then begin
sell(1,0,market);
zuigao:=0;
end//收盘前平仓

 

 

按要求写了个多头的,空头的可以根据上面的自行改写


--  作者:jacan888
--  发布时间:2012/7/23 10:55:53
--  先谢谢老师了

input:n(),m(),n1(),g(),d();
variable:zuigao=0;
开多:=;

t1:= time>=093000 and time<=145200;//交易时间

if t1 and 开多 and holding=0 and h>zuigao then begin
 buy(1,1,limitr,c+d);
 zuigao:=h;
 end//开多
 
if enterprice-c>=n then sell(1,0,market);//止损
if zuigao-c>=n1 then sell(1,0,market);//止盈

if time>145200 and time<=150000 then begin
sell(1,0,market);
zuigao:=0;
end//收盘前平仓

 

 

按要求写了个多头的,空头的可以根据上面的自行改写


--  作者:jacan888
--  发布时间:2012/7/23 11:24:00
--  老师请教下谢谢

buy(1,1,limitr,c+d);//这里是指开多买阴价么,“C+D”价中D值是取负么
 zuigao:=h;//这句是什么意思

 

and h>zuigao //这句是什么意思

谢谢了

[此贴子已经被作者于2012-7-23 11:25:25编辑过]

--  作者:rushtaotao
--  发布时间:2012/7/23 12:02:34
--  

上面是开多;

将最高价赋值到zuigao;

如果最高价>zuigao;

 

建议您学习下基本pel语言


--  作者:jacan888
--  发布时间:2012/7/23 15:05:44
--  是这样的么请教教我我是新手谢谢了

input:N(3,0,100);
input:N1(2,0,100);
input:m(2,1,100);
input:g(2,1,100);
input:D(2,1,110);

variable:zuigao=0;
开多: = ;
开空: = ;
t1:= time>=093000 and time<=145200;//交易时间

if t1 and 开多=1 and holding=0 and h>zuigao then begin
 buy(1,1,limitr,c+d);
 zuigao:=h;
 end//开多
 
 if t1 and 开空=1 and holding>0 and h>zuigao then begin
sell(1,1,limitr,c+d);
 zuigao:=h;
 end//平多
 

 if t1 and 开空=1 and holding=0 and h>zuigao then begin
 buyshort(1,1,limitr,c+d);
 zuigao:=h;
 end//开空
 
 
 if t1 and 开空=1 and holding=0 and h>zuigao then begin
sellshort(1,1,limitr,c+d);
 zuigao:=h;
 end//平空
 
 sellshort(1,1,limitr,c+d);
if enterprice-c>=n then sell(1,0,market);//止损
if zuigao-c>=n1 then sell(1,0,market);//止盈

if time>145200 and time<=150000 then begin
sell(1,0,market);
sellshort(1,0,market);
zuigao:=0;
end//收盘前平仓