设为首页收藏本站

 找回密码
 注册
楼主: nopain
打印 上一主题 下一主题

通过文件读写函数实现跨周期数据调用! [复制链接]

Rank: 7Rank: 7Rank: 7

精华
1
UID
727
积分
3770
帖子
537
主题
55
阅读权限
80
注册时间
2007-11-11
最后登录
2015-4-8
1#
发表于 2009-4-10 10:11:51 |显示全部楼层
  1. // 简称: atrs
  2. // 名称: ATR指标
  3. // 类别: 技术指标
  4. // 类型: 其它类
  5. // 输出:
  6. //------------------------------------------------------------------------
  7. Params
  8.         Numeric length(10);
  9. Vars
  10.         Numeric atr;
  11.         string strkey;
  12.         string strValue;
  13. Begin
  14.         atr= AverageFC(TrueRange,Length);;
  15.         strKey = DateToString(Date);
  16.         strValue = Text(atr);
  17.         SetTBProfileString("Dayatr",strKey,strValue);
  18.         PlotNumeric("atr",atr);
  19. End
复制代码
  1. // 简称: atrmin
  2. // 名称: ATR分钟指标
  3. // 类别: 技术指标
  4. // 类型: 其它类
  5. // 输出:
  6. //------------------------------------------------------------------------
  7. Params
  8.         Numeric Currentmaxdate(20090201);
  9. Vars
  10.         NumericSeries dayatrValue;
  11.         StringSeries strKey;
  12.         string strValue;
  13. Begin
  14.         If(Date!=Date[1])
  15.         {
  16.                 strKey = DateToString(Date[1]);        
  17.         }Else
  18.         {
  19.                 strKey = strKey[1];
  20.         }
  21.         
  22.         strValue = GetTBProfileString("Dayatr",strKey);
  23.         If(strValue != InvalidString)
  24.         {
  25.                 dayatrValue = Value(strValue);
  26.         }Else
  27.         {
  28.                 dayatrValue = dayatrValue[1];
  29.         }
  30. if(date>=Currentmaxdate)
  31. {
  32.         PlotNumeric("Dayatr",DayatrValue);
  33. }
  34. End
复制代码
TradeBlazer交流群33647992。

使用道具 举报

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

bottom

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

GMT+8, 2024-5-7 08:53

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部