设为首页收藏本站

 找回密码
 注册
查看: 9837|回复: 0
打印 上一主题 下一主题

日内交易系统 [复制链接]

Rank: 4

精华
0
UID
112594
积分
333
帖子
281
主题
8
阅读权限
50
注册时间
2012-9-20
最后登录
2013-12-4
1#
发表于 2012-10-16 13:34:17 |显示全部楼层
  1. //------------------------------------------------------------------------
  2. // 简称: Open_Breaker_Filtered
  3. // 名称: 价格过滤后的开盘突破系统
  4. // 类别: 公式应用
  5. // 类型: 用户应用
  6. // 输出:
  7. //------------------------------------------------------------------------
  8. Params
  9.         Numeric N(100);
  10.         Numeric LOTS(1);

  11. Vars
  12.         Numeric KPJ;
  13.         Numeric NN;
  14.         Numeric ZG;
  15.         Numeric ZD;

  16. Begin
  17.         KPJ=OpenD(0);
  18.         NN=BarsSinceToday;
  19.         ZG=HighestFC(High,NN);
  20.         ZD=LowestFC(Low,NN);
  21.        
  22.         If(High>KPJ*(1+N/10000)&&ZD>KPJ*(1-N/1000)&&Time>0.0900&&Time<0.1455)
  23.         Buy(LOTS,Open);
  24.         If(Low<KPJ*(1-N/10000)&&ZG<KPJ*(1+N/1000)&&Time>0.0900&&Time<0.1455)
  25.         SellShort(LOTS,Open);
  26.         If(Time>=0.1455||(ZD<KPJ*(1-N/1000)&&BarsLast(High>KPJ*(1+N/10000))<BarsLast(Low<KPJ*(1-N/10000))))
  27.         BuyToCover(LOTS,Open);
  28.         If(Time>=0.1455||(ZG>KPJ*(1+N/1000)&&BarsLast(High>KPJ*(1+N/10000))>BarsLast(Low<KPJ*(1-N/10000))))
  29.         Sell(LOTS,Open);
  30.        
  31. End


  32. //------------------------------------------------------------------------
  33. // 编译版本        GS2010.12.08
  34. // 用户版本        2012/10/11 09:19
  35. // 版权所有        sora4you
  36. // 更改声明        TradeBlazer Software保留对TradeBlazer平台
  37. //                        每一版本的TrabeBlazer公式修改和重写的权利
  38. //------------------------------------------------------------------------
复制代码
随便发一个,其中用到一个函数:
  1. //------------------------------------------------------------------------
  2. // 简称: BarsLast
  3. // 名称: BarsLast
  4. // 类别: 用户函数
  5. // 类型: 用户函数
  6. // 输出: 数值型
  7. //------------------------------------------------------------------------

  8. Params
  9.         BoolSeries Con;
  10. Vars
  11.         Numeric i;
  12.         Numeric Num(1);
  13. Begin
  14.         for  i = 1 To BarsSinceEntry
  15.     {
  16.             if(Con)
  17.         {
  18.             Return Num;
  19.         }else
  20.         {
  21.             Num=Num+1;
  22.         }
  23.     }
  24. End

  25. //------------------------------------------------------------------------
  26. // 编译版本        GS2010.12.08
  27. // 用户版本        2012/10/11 09:47
  28. // 版权所有        sora4you
  29. // 更改声明        TradeBlazer Software保留对TradeBlazer平台
  30. //                        每一版本的TrabeBlazer公式修改和重写的权利
  31. //------------------------------------------------------------------------
复制代码

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-16 03:25

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部