设为首页收藏本站

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

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

Rank: 4

精华
0
UID
3803
积分
328
帖子
27
主题
5
阅读权限
50
注册时间
2009-3-12
最后登录
2014-4-4
1#
发表于 2009-4-6 14:25:27 |显示全部楼层
好贴!给版主致敬

使用道具 举报

Rank: 4

精华
0
UID
3803
积分
328
帖子
27
主题
5
阅读权限
50
注册时间
2009-3-12
最后登录
2014-4-4
2#
发表于 2009-4-9 23:09:34 |显示全部楼层

照葫芦画瓢写了一个60分钟调用10日线atr值,显示不对!

自己照葫芦画瓢写了一个60分钟调用10日线atr值。
//------------------------------------------------------------------------
// 简称: dayatr
// 名称: dayatr
// 类别: 用户函数
// 类型: 内建函数
// 输出: 数值型
//------------------------------------------------------------------------
Params
        Numeric length(10);
Vars
        Numeric atr;
        string strkey;
        string strValue;
Begin
        atr= AverageFC(TrueRange,Length);;
        strKey = DateToString(Date);
        strValue = Text(atr);
        SetTBProfileString("Dayatr",strKey,strValue);
        Return atr;
End
//------------------------------------------------------------------------
// 简称: My60MinAtr
// 名称: 60分钟取日线ATR
// 类别: 技术指标
// 类型: 其它类
// 输出:
//------------------------------------------------------------------------
Params
        NumericSeries Currentmaxdate(20090201);
Vars
        NumericSeries dayatrValue;
        StringSeries strKey;
        string strValue;
Begin
        If(Date!=Date[1] and date>Currentmaxdate)
        {
                strKey = DateToString(Date[1]);        
        }Else
        {
                strKey = strKey[1];
        }
        
        strValue = GetTBProfileString("Dayatr",strKey);
        If(strValue != InvalidString)
        {
                dayatrValue = Value(strValue);
        }Else
        {
                dayatrValue = dayatrValue[1];
        }
       PlotNumeric("Dayatr",DayMAValue);
End
1)输出不对,请老师看看那里有问题?谢谢
2)如果自动交易断线后,再连网,自动交易如果不用手工补有别的办法吗?

使用道具 举报

Rank: 4

精华
0
UID
3803
积分
328
帖子
27
主题
5
阅读权限
50
注册时间
2009-3-12
最后登录
2014-4-4
3#
发表于 2009-4-10 11:27:52 |显示全部楼层

问题解决了

用户函数不能关联图表。
不能在用户函数调用,只能在技术指标和交易指令

使用道具 举报

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

bottom

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

GMT+8, 2024-5-4 02:43

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部