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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 请老师帮忙编一个模型

   

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


  共有8854人关注过本帖树形打印复制链接

主题:请老师帮忙编一个模型

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2011/11/25 9:33:25 [显示全部帖子]

前面平仓是止损平仓时开仓手数是亏损仓位的2倍、最多仓位开到32手、是盈利平仓时就开1手

这句话能否详细的讲解一下,不明白



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2011/11/25 10:15:51 [显示全部帖子]

td:= (time>=090000 and time<=145800);
variable:aa=1,bb=1;

if A and td then buy(holding=0,1,thisclose);

if B and td then buyshort(holding=0,1,thisclose);

//止损止盈平仓,10点止损30点止盈

if c-enterprice >=30 or enterprice-c>=10 then
  sell(holding>0,0,thisclose);
 


if enterprice-c>=30 or c-enterprice>=10 then 
 sellshort(holding<0,0,thisclose);
 

if numprofit(1)>0 and A and td then buy(holding=0,1,thisclose);

if numprofit(1)>0 and B and td then buyshort(holding=0,1,thisclose);

if numprofit(1)<0 and A and td and aa<=32 then begin
 buy(holding=0,aa,thisclose);
 aa:=aa*2;
end

if numprofit(1)<0 and b and td and bb<=32 then begin
 buyshort(holding=0,bb,thisclose);
 bb:=bb*2;
end

if time>145800 then begin
 sell(holding>0,0,thisclose);
  sellshort(holding<0,0,thisclose);
 end
 
 if time>=150000 then begin
  aa:=1;
  bb:=1;
 end



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2011/11/25 13:43:07 [显示全部帖子]

不好意思,上面写得逻辑不够严密,刚改了下,再试试

 

variable:aa=2,bb=2,cc=0,dd=0;
td:= (time>=090000 and time<=145800);
if A and td and cc=0 then begin
buy(holding=0,1,thisclose);
cc:=1;
end

if B and td and dd=0 then  begin
buyshort(holding=0,1,thisclose);
dd:=1;
end

//止损止盈平仓,10点止损30点止盈

if c-enterprice >=30 or enterprice-c>=10 then
  sell(holding>0,0,thisclose);
 


if enterprice-c>=30 or c-enterprice>=10 then 
 sellshort(holding<0,0,thisclose);
 

if numprofit(1)>0 and A and td and cc=1 then buy(holding=0,1,thisclose);

if numprofit(1)>0 and B and td and dd=1 then buyshort(holding=0,1,thisclose);

if numprofit(1)<0 and A and td and aa<=32 and cc=1 then begin
 buy(holding=0,aa,thisclose);
 aa:=aa*2;
end

if numprofit(1)<0 and b and td and bb<=32 and dd=1then begin
 buyshort(holding=0,bb,thisclose);
 bb:=bb*2;
end

if time>145800 then begin
 sell(holding>0,0,thisclose);
  sellshort(holding<0,0,thisclose);
 end
 
 if time>=150000 then begin
  aa:=2;
  bb:=2;
  cc:=0;
  dd:=0;
 end



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2011/11/25 16:17:43 [显示全部帖子]

哪个?


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2011/11/28 9:41:35 [显示全部帖子]

容我三思


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

客户服务部

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

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

 回到顶部