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


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

   

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


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

主题:请帮忙编写

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


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

写了个多头的,希望其他人来看一下,觉得写的不对劲。。。。。。

variable:aa=0,bb=0;

nn:=barslast(date<>ref(date,1));

tradetime:= time>100000 and time<=143000;


sg:=valuewhen(time<=100000,hhv(h,nn+1));
xg:=valuewhen(time<=100000,llv(l,nn+1));
jk:=ref(o,nn);
jg:=hhv(h,nn+1);
jd:=llv(l,nn+1);


多头强势: = (sg-jk)>(jk-xg) and time>100000;
空头强势: = (sg-jk)<(jk-xg) and time>100000;
今开盘价格带上轨:=jk*1.005;
今开盘价格带下轨:=jk*0.995;

多头止损1:=min(今开盘价格带下轨,min((今开盘价格带下轨+xg)/2, xg));

多头止损2:=max(今开盘价格带下轨,max((今开盘价格带下轨+xg)/2,xg));

空头止损1:=min(今开盘价格带上轨,min((今开盘价格带上轨+sg)/2,sg));

空头止损2:=max(今开盘价格带上轨,max((今开盘价格带上轨+sg)/2,sg));

h1:=hhv(h,enterbars);

 

if 多头强势 and tradetime  then begin
 if ref(c,1)<= 今开盘价格带上轨  then begin buy(holding=0,1,thisclose);aa:=aa+1;end
 if c>sg  then begin buy(holding=0,1,thisclose);bb:=bb+1;end
 if ref(c,1)<= 今开盘价格带上轨 and c>sg then  buy(holding=0,1,thisclose)
end

if aa>0 and l<多头止损1 and tradetime then sell(holding>0,0,thisclose);
if bb>0 and l<多头止损2 and tradetime then sell(holding>0,0,thisclose);

if aa>0 and h1>=(jk+ 今开盘价格带上轨*0.012) and tradetime and c<=(jk+今开盘价格带上轨*0.01) then sell(holding>0,0,thisclose);
if aa>0 and h1>=(jk+ 今开盘价格带上轨*0.015) and tradetime then sell(holding>0,0,thisclose);

if bb>0 and h1>=(max((jg-jk),(jk-jd)))*1.2 and c<=max((jg-jk),(jk-jd)) then sell(holding>0,0,thisclose);
if bb>0 and h1>=(max((jg-jk),(jk-jd)))*1.5 then sell(holding>0,0,thisclose);

if l<多头止损2 then begin
 sell(holding>0,0,thisclose);
 buyshort(holding=0,1,thisclose);
end

if time>=145000 then sell(holding>0,0,thisclose);

if time>=150000 then begin aa:=0;bb:=0;end



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

客户服务部

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

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

 回到顶部
总数 18 1 2 下一页