0
Follow
0
Followers
新人求助: 使用_Cross() 或者自定义方法 判断macd金叉 和真实实盘对比, 有时会有误差,请大神帮帮忙!
Created 2018-12-21 20:06:47 Updated 2018-12-21 20:07:32
3
2133
如下图所示:
使用回测系统:时间设置的是12月20日到12月21日,分别用 5分钟的模拟Ticker和实盘Ticker,
1.发现 在上午11:45的时候和下午20:50的时候 实盘Ticker出现金叉 计算错误
2.在上午5:00和 上午11:45的时候 模拟Ticker也出现金叉计算错误
3.其它时间都能正确判断出金叉.

小弟一直百思不得其解,所以将 dif和dea 的值分别打印了出来,最后发现
1.金叉判断错误的时候,dif和dea的值和 火币k线上面标注出来的完全不一样.
2.金叉判断正确的时候, 计算出的dif和dea的值有时也和火币k线上标注出来的不一样 (不一样的判断标准是:精确到4位小数然后四舍五入依然不一样)
我的要求其实也不高,不一定dif 和dea的值要和火币K线图上的一样,只能能正确判断金叉即可,但是往往就因为这2个值的不同,导致金叉判断错误,希望走过路过的大神们不吝赐教,以下是我的 判断金叉的代码:
使用自定义方法:

使用内置函数:

Related Recommendations
How to set execInst on exchange.Sell?Binance Multi-Currencies Automation Trading Strategy API Operation GuideDetailed explanation of BitMEX pending order strategyJavaScript Bitmex【Recruitment】Quantitative Strategy DevelopmentHow can i get the depth of the market when backtesting?ERR_INSUFFICIENT_ASSET from huobiMyLanguage DocumentHappy Halloween / Coupon-codes for everyone -- FMZ Quant TeamAdding exchanges on our setting list

