请教一下,哪位大侠有在bar replay 回放模式下调试afl的经验? 我在 bar replay模式下面调试一段afl代码 (每次按前进按钮是能看到当前bar上面的变化) 但是有什么方法能够把当前bar的情况,甚至其他变量的情况显示出来呢? 我发现在 0 - barcount 的循环里面好像读不到 bar replay这种模式下的当前bar 关键在于怎么获得这个模式下的当前bar的index... 不知道各位看懂了没有... 我的代码是把结果输出到dbgview下面, 如果哪位能给几行代码演示一下大概方法就好了
bar replay模式下,AB的数据引擎只提供到最近时点的数据,之后的bar被截取掉了; 所以当下的BarCount就是公式中所能识别的当前bar的index, 并且,不仅当前Ticker是如此,在该AB中无论你通过何种方式获取到的报价都是如此。 该是描述清楚了吧
Thanks wj2000 and xMore! It's caused by something wrong in my code. AFL actually loops through each bar until the very last one available in replay mode. I recently found debugging in bar replay mode is very helpful to find issue that can only be detected in real time exploration during trading, which costs real money.
我没有在indicator里面用这个函数,一般是在scan/exploration里面用。 bar replay的时候,如果指定范围内有200个bar,那么barcount=200。这是对的。 这个贴子的问题已经解决了。是我程序里面的一点问题。