欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 老师,帮我写个模型。感激不尽

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有13799人关注过本帖平板打印复制链接

主题:老师,帮我写个模型。感激不尽

帅哥哟,离线,有人找我吗?
jinzhe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2012/9/18 15:21:05 [只看该作者]

{每天价格上涨A个点做多,下降A个点做空。
B个点的最初止损,C个点浮动止损,止损后反手。若连续亏损3次(注意不是止损,是亏损,不计算昨天的)直接平仓并且不反手。
所有交易D个点止盈,最后一小时不入场,最后两分钟平仓。
}
input:a(10),b(8),cc(5),d(8);
variable:hh=0,ll=0,cishuduo=0,cishukong=0;
dayopen:=valuewhen(date<>ref(date,1),o);//今开

time1:= time>090100 and time <140000;//交易时间

time2:= time>145800 and time<= 150000;//最后2分钟强平

if c>dayopen+a*mindiff and time1 and cishuduo=0 then begin
buy(holding=0,1,market);
hh:=h;
cishuduo:=1;
end//上涨A个点做多
if h>hh then hh:=h;
if c<dayopen-a*mindiff  and time1 and cishukong=0 then begin
buyshort(holding=0,1,market);
ll:=l;
cishukong:=1;
end//下跌A个点做空
 if l<ll then ll:=l;
if holding>0 and enterprice-c>=b*mindiff then begin
sell(holding>0,0,market);
buyshort(holding=0,1,market);
end//多头止损反手

if holding<0 and c-enterprice>=b*mindiff  then begin
sellshort(holding<0,0,market);
buy(holding=0,1,market);
end//空头止损反手
if hh-c>=cc*mindiff and holding>0 then sell(holding>0,0,market);//CC个点多头浮动止损,下为空头

if c-ll>=cc*mindiff and holding>0 then sellshort(holding<0,0,market);

if numlosstrade>=3 and holding>0 then sell(holding>0,0,market);//多头连亏三次后平仓不反手,下为空头

if numlosstrade>=3 and holding<0 then sellshort(holding<0,0,market);

if holding>0 and c>=enterprice+d*mindiff then sell(holding>0,0,market);//多头d个点止盈
if holding<0 and c<=enterprice-d*mindiff then sell(holding<0,0,market);//多头d个点止盈

if time2 then BEGIN
sell(1,0,market);
sellshort(1,0,market);
cishuduo:=0;
cishukong:=0;
end//收盘前平仓



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
总数 33 1 2 3 4 下一页