- 精华
- 0
- 在线时间
- 40 小时
- UID
- 109379
- 积分
- 112
- 帖子
- 30
- 阅读权限
- 30
- 注册时间
- 2012-4-5
- 最后登录
- 2019-10-10
- 精华
- 0
- UID
- 109379
- 积分
- 112
- 帖子
- 30
- 主题
- 10
- 阅读权限
- 30
- 注册时间
- 2012-4-5
- 最后登录
- 2019-10-10
|
TB 测试显示,
行情Q函数 4TICK/秒
A函数查询,每秒可运行查询2次,因为每个TICK程序都会执行一遍,所以另外两次返回无效值
对于无效值,采用下面方式,效果较好。
因为:A函数在过去的bar上运行,返回值为无效值;此时参与逻辑大小判断,会出现无端错误。方案A:
If( A_BuyProfitLoss!=InvalidNumeric && A_BuyProfitLoss/TradeUnit/Minpoint>8)
{SetGlobalVar(11,1);
FileAppend("d:\\BreakEven.log","错误点1--"+Text(A_BuyProfitLoss/TradeUnit/Minpoint));
}
错误案例:
If( A_BuyProfitLoss/TradeUnit/Minpoint>8)
{
SetGlobalVar(11,1);
FileAppend("d:\\BreakEven.log","错误点1--"+Text(A_BuyProfitLoss/TradeUnit/Minpoint));
}
运行时,错误案例里边的代码,即盈利未达到,也会执行,为后面的计算埋下很大的隐患。 |
|