- 精华
- 0
- 在线时间
- 86 小时
- UID
- 40788
- 积分
- 84
- 帖子
- 36
- 阅读权限
- 30
- 注册时间
- 2011-5-19
- 最后登录
- 2021-3-1
- 精华
- 0
- UID
- 40788
- 积分
- 84
- 帖子
- 36
- 主题
- 14
- 阅读权限
- 30
- 注册时间
- 2011-5-19
- 最后登录
- 2021-3-1
|
本帖最后由 courage121 于 2011-6-26 22:55 编辑
将系统函数Lowest改动一下,就是加了一条FileAppend进行输出,新函数命名为GetLowest
测试合约:cf1109
测试日期:5.16日
测试周日:5分钟k线
测试数据:最低价,
测试一:时间选取13:30
调用if(Low[0]==GetLowest(low,4)){...}
测试结果为:TIME:1330,25095,25095,25255,25265,25255,25215
测试二:时间选取11:20
调用if(Low[0]==GetLowest(low,4)){...}
测试结果为:TIME:1120,25255,25265,25255,25215,25215,25245
问题一:11:20测试的结果中,倒数第二个数25215是错误的,实际最低价应该是25245,
问题二:为什么13:30测试会重复出现两个25095,实际应该只有13:30出现的一个25095,最主要是11:25分钟的最低价25245为什么没有输出????
Params
NumericSeries Price(0);
Numeric Length(5);
Vars
Numeric LowestValue;
Numeric i;
Begin
LowestValue = Price;
FileAppend("D:\\a\\Program_Trading_"+Text(date)+".log","TIME:"+Text(Time*10000)+","+Text(Price[0])+","+Text(Price[1])+","+Text(Price[2])+","+Text(Price[3])+","+Text(Price[4])+","+Text(Price[5]));
for i=1 to Length - 1
{
If(Price < LowestValue)
LowestValue = Price;
}
Return LowestValue;
End |
|