Dukascopy
 
 
Wiki JStore Search Login

Historical tester uses bad weekend's bars
 Post subject: Historical tester uses bad weekend's bars Post rating: 0   New post Posted: Mon 11 Feb, 2013, 22:12 

User rating: 0
Joined: Thu 27 Sep, 2012, 14:41
Posts: 2
Hello Support,

My strategy uses ONE MIN bars for indicator calculation with flats on weekends (Filter.NO_FILTER), and when I tried to test my strategy during 22:00 GMT changeover from weekend's flat to market open, I encountered that onBar() method receives bad askBar and bidBar values. Instead of weekend's values equal to last Friday's tick, it receives first Sunday's tick values. Example for better idea:

Market opening at 22:00 GMT 03-Feb-2013, EUR/USD:
Last Friday's tick (01-Feb-2013) is equal to: Ask=1.36413 Bid=1.36391. JForex shows these values during whole weekend's flat, also history.getBars() returns these values for everyone weekend's bar.
But! instead of these values, historical tester and testing via JForex SDK receives for everyone weekend's bar values equal to first Sunday's tick: Ask=1.36524 Bid=1.36502.

Attached is simple strategy with tester for presentation, result from this strategy:
Time: 2013-02-03 21:58:00.000 Ask: 1.36524 Bid: 1.36502 (Market closed, bad values, correct are Ask: 1.36413 Bid: 1.36391)
Time: 2013-02-03 21:59:00.000 Ask: 1.36524 Bid: 1.36502 (Market closed, bad values, correct are Ask: 1.36413 Bid: 1.36391)
Time: 2013-02-03 22:00:00.000 Ask: 1.36546 Bid: 1.36529 (Market opened, first bar correct close values)

The problem is that also indicator receives bad values for weekend's bars and thus it has bad signals during market changeover, and I'm not able to test my strategy with a month or year but only with a few days during week.


Attachments:
TesterMain.java [6.19 KiB]
Downloaded 367 times
StrategyTemp.java [1.44 KiB]
Downloaded 348 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

cron
  © 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