公式里,加入了调试语句:
debugfile('D:\turtle.log', 'symble: %s', stkname());
debugfile('D:\turtle.log', 'enterbars: %.2f', tenterbars(0));
日志文件中的内容:
。。。。
2010-06-10 14:03:04.687 enterbars: 4294965284.00
2010-06-10 14:03:04.703 enterbars: -1.00
2010-06-10 14:03:04.703 enterbars: -1.00
2010-06-10 14:03:04.718 enterbars: -1.00
2010-06-10 14:03:04.718 enterbars: -1.00
2010-06-10 14:03:04.718 enterbars: -1.00
2010-06-10 14:03:04.734 enterbars: -1.00
2010-06-10 14:03:04.734 enterbars: -1.00
2010-06-10 14:03:04.750 enterbars: -1.00
2010-06-10 14:03:04.750 enterbars: -1.00
2010-06-10 14:03:04.750 enterbars: -1.00
2010-06-10 14:03:04.750 enterbars: -1.00
2010-06-10 14:03:04.765 enterbars: 4294965136.00
2010-06-10 14:03:04.781 enterbars: 4294966834.00
2010-06-10 14:03:04.781 enterbars: 4294965260.00
2010-06-10 14:03:04.781 enterbars: -1.00
2010-06-10 14:03:04.796 enterbars: -1.00
2010-06-10 14:03:04.796 enterbars: -1.00
2010-06-10 14:03:04.812 enterbars: -1.00 <--- 到这里正好19行(我监控了19个品种)
2010-06-10 14:03:08.140 symble: (null)
2010-06-10 14:03:08.140 enterbars: -1.00
当前确实有仓位:
几个问题:
1. 为什么tenterbars取不到有效值?
2. stkname()为什么取不到品种名称?是不是%s的格式串有问题? debugfile里支持什么样的格式串?(这个好像没看到有文档说明)
3. 我监控的是19个品种, 调试中一次循环前面看到19个enterbars, 但symble只输出了一次。也很奇怪。 (两个debugfile语句连续执行的,并且没有放在条件语句中)
[此贴子已经被作者于2010-6-10 14:15:07编辑过]