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


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

   

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


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

主题:[交易系统]闪灵交易系统

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[交易系统]闪灵交易系统  发帖心情 Post By:2011/10/3 17:06:48 [只看该作者]

图片点击可在新窗口打开查看

 

runmode:0;

input:length1(60);
input:length2(30);

variable:myholding=0;
variable:myprofit=0;
variable:myentryprice=0;
variable:myexitprice=0;
variable:myfailtrade=0;

entryupperband:=ref(hhv(high,length1),1);
entrylowerband:=ref(llv(low,length1),1);

entrylongcond:=high>=entryupperband;
entryshortcond:=low<=entrylowerband;

exitupperband:=ref(hhv(high,length2),1);
exitlowerband:=ref(llv(low,length2),1);

exitlongcond:=low<=exitlowerband;
exitshortcond:=high>=exitupperband;

if myholding=0 then begin
 if entrylongcond then begin
  myholding:=1;
  myentryprice:=max(open,entryupperband);
 end 
end 

if myholding=0 then begin
 if entryshortcond then begin
  myholding:=2;
  myentryprice:=min(open,entrylowerband);
 end 
end 
 
if myholding=1 then begin
 if exitlongcond then begin
  myholding:=0;
  myexitprice:=min(open,exitlowerband);
  myprofit:=myexitprice-myentryprice;
  if myprofit<0 then
   myfailtrade:=myfailtrade+1;
  else
   myfailtrade:=0; 
 end
end 

if myholding=2 then begin
 if exitshortcond then begin
  myholding:=0;
  myexitprice:=max(open,exitupperband);
  myprofit:=myentryprice-myexitprice;
  if myprofit<0 then
   myfailtrade:=myfailtrade+1;
  else
   myfailtrade:=0;
 end
end

if holding=0 and myfailtrade=1 then begin
 if entrylongcond then
  buy(1,1,limitr,max(open,entryupperband));
end

if holding=0 and myfailtrade=1 then begin
 if entryshortcond then
  buyshort(1,1,limitr,min(open,entrylowerband));
end

if holding>0 then begin
 if exitlongcond then
  sell(1,holding,limitr,min(open,exitlowerband));
end

if holding<0 then begin
 if exitshortcond then
  sellshort(1,holding,limitr,max(open,exitupperband));
end

盈亏:asset-50000,noaxis,colorred,linethick2;


 回到顶部
美女呀,离线,留言给我吧!
xian_0_9
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 BOO
等级:论坛游民 帖子:378 积分:1856 威望:0 精华:0 注册:2010/1/25 18:04:12
  发帖心情 Post By:2011/10/3 18:37:43 [只看该作者]

。。。过节也不休息奥图片点击可在新窗口打开查看

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


加好友 发短信
等级:论坛游民 帖子:431 积分:2515 威望:0 精华:0 注册:2011/9/30 14:12:32
  发帖心情 Post By:2011/10/6 8:33:51 [只看该作者]

闪灵交易系统初看不错,1楼的图是何时的测试区间呀?如能加上中文注解就更利于学习和交流了。

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


加好友 发短信
等级:论坛游民 帖子:431 积分:2515 威望:0 精华:0 注册:2011/9/30 14:12:32
  发帖心情 Post By:2011/10/11 6:10:27 [只看该作者]

z7c9,请问闪灵交易系统主要思想是什么呢?谢谢

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


加好友 发短信
等级:新手上路 帖子:40 积分:154 威望:0 精华:0 注册:2013/1/29 21:12:59
  发帖心情 Post By:2013/1/29 21:38:46 [只看该作者]

图片点击可在新窗口打开查看

 回到顶部