Dukascopy
 
 
Wiki JStore Search Login

策略中获取指标值同图表上显示指标值存在时间差
 Post subject: 策略中获取指标值同图表上显示指标值存在时间差 Post rating: 0   New post Posted: Wed 23 Aug, 2017, 10:21 
User avatar

User rating: 0
Joined: Wed 23 Aug, 2017, 09:42
Posts: 1
策略回测下单有问题,最终发现是取指标值存在问题,获取指标值代码如下
double[][] outputs1=indicators.alligator(instrument, period, OfferSide.BID, AppliedPrice.MEDIAN_PRICE, 13, 8, 5, Filter.WEEKENDS, 24,bidBar.getTime(),0);
意图是获取从当前k线往前24根k线的鳄鱼线指标值
根据说明 outputs1[0][0]为当前k线jaw值, outputs1[1][0]位当前k线teeth值, outputs1[2][0]为当前k线lip值
但通过输出和实际图对比发现并非如此,当前k线对应的三个值分别为jaw=outputs1[0][15] teeth=outputs1[1][18] lip=outputs1[2][20]
同理其他的k线对应的鳄鱼线值也同样分别向前移动 15 18 20
为什么会有这种现象?按理说即使有平移也应该是 8 5 3 不应该是 15 18 20

说明:1、在jforex的个人偏好设置里面图表设置了按GMT时间,平台时区也是GMT;2、在策略中输出bidbar.gettime的时候使用了时间格式jfDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));3、使用的是jforex平台的回测工具,用EURUSD测试30分钟周期
不知道为什么还会出现如此偏差
望坛主解惑,谢谢!


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com