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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → [交易系统]菲阿里突破

   

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


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

主题:[交易系统]菲阿里突破

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[交易系统]菲阿里突破  发帖心情 Post By:2011/10/24 21:10:36 [只看该作者]

 

runmode:0;

variable:longtrade=0;
variable:shorttrade=0;
variable:stopline=0;

predayhigh:=callstock(stklabel,vthigh,6,-1);
predaylow:=callstock(stklabel,vtlow,6,-1);
predayrange:=(predayhigh-predaylow)*0.5;
predayrange:=round(predayrange/mindiff)*mindiff;

dayopen:=callstock(stklabel,vtopen,6,0);

trailingstop:=predayrange;

dist:=barslast(date>ref(date,1))+1;

myentrytime:=time<=145500;
myexittime:=time>=150000;

upperband:=ref(hhv(high,dist),1);
lowerband:=ref(llv(low,dist),1);

hh:=ref(high,1);
ll:=ref(low,1);

if holding=0 then begin
if myentrytime and dayopenpredaylow then begin
if high>=predayhigh and longtrade=0 then begin
buy(1,1,limitr,max(open,predayhigh));
longtrade:=1;
end

if low<=predaylow and shorttrade=0 then begin
buyshort(1,1,limitr,min(open,predaylow));
shorttrade:=1;
end
end

if myentrytime and dayopen>=predayhigh then begin
if dist>=4 and high>=upperband and longtrade=0 then begin
buy(1,1,limitr,max(open,upperband));
longtrade:=1;
end
end

if myentrytime and dayopen<=predaylow then begin
if dist>=4 and low<=lowerband and shorttrade=0 then begin
buyshort(1,1,limitr,min(open,lowerband));
shorttrade:=1;
end
end
end

if holding>0 and enterbars>=1 then begin
myexitprice:=0;

if stopline=0 then
stopline:=enterprice-trailingstop;

if hh-trailingstop>stopline then
stopline:=hh-trailingstop;

if low<=stopline then
myexitprice:=min(open,stopline);

if myexittime then
myexitprice:=close;

if myexitprice>0 then begin
sell(1,holding,limitr,myexitprice);
stopline:=0;
end
end

if holding<0 and enterbars>=1 then begin
myexitprice:=0;

if stopline=0 then
stopline:=enterprice+1000;

if ll+trailingstop stopline:=ll+trailingstop;

if high>=stopline then
myexitprice:=max(open,stopline);

if myexittime then
myexitprice:=close;

if myexitprice>0 then begin
sellshort(1,holding,limitr,myexitprice);
stopline:=0;
end
end

if myexittime then begin
longtrade:=0;
shorttrade:=0;
end

盈亏:asset-500000,noaxis,coloryellow,linethick2;


 回到顶部