- 精华
- 0
- 在线时间
- 300 小时
- UID
- 114404
- 积分
- 160
- 帖子
- 98
- 阅读权限
- 40
- 注册时间
- 2012-12-26
- 最后登录
- 2017-3-23
- 精华
- 0
- UID
- 114404
- 积分
- 160
- 帖子
- 98
- 主题
- 40
- 阅读权限
- 40
- 注册时间
- 2012-12-26
- 最后登录
- 2017-3-23
|
上面的公式实际使用了未来数据,用来写技术分析是可以的,但用来进行自动交易就会出问题,为了更准确合理的使用跨周期数据,我们应该稍作修改,代码如下:
Vars
NumericSeries DayMAValue;
StringSeries strKey;
string strValue;
Begin
If(Date!=Date[1]) //什么情况下 Date 不等于Date[1],能解释下吗
{
strKey = DateToString(Date[1]);
}Else 什么情况下相等呢?
{
strKey = strKey[1];
}
strValue = GetTBProfileString("DayMA",strKey);
If(strValue != InvalidString)
{
DayMAValue = Value(strValue);
}Else
{
DayMAValue = DayMAValue[1];
}
PlotNumeric("DayMA",DayMAValue);
End
问题在程序后面,哪位给解答下? |
|