Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Strange Behaviour in Historical Tester / Ticks not Created
 Post subject: Strange Behaviour in Historical Tester / Ticks not Created Post rating: 0   New post Posted: Tue 10 Aug, 2010, 22:20 

User rating: -
I seem to have a problem submitting orders in the Historical Tester environment (JForex API 2.6.7 API ) .
1) The OnTick method is never called in IStrategy Interface
2) The onBar method is called and seems to provide consistent price information
3) When submitting market orders in onBar method (a simple test example shown below in this case for EUR/USD)

IBar testBar = history.getBar(instrument, Period.TEN_SECS, OfferSide.ASK,1);
engine.submitOrder("test" + thetime, theinstrument, IEngine.OrderCommand.BUY, 0.01,testBar.getClose(),4.0,testBar.getClose()-0.1,testBar.getClose()+0.2);


The onMessage method records the subitted order:

Account Value :: 1000000.0
Message Information :: Order submitted
Order Information :: EUR/USD,1,OPENED,1.3205,01/03/2005 10:00:00

However the order is filled way off market:

Account Value :: 1000000.0
Message Information :: Order filled
Order Information :: EUR/USD,1,FILLED,1.2777,01/03/2005 10:00:00


Again when an order is submitted an hour later

Account Value :: 999999.88
Message Information :: Order submitted
Order Information :: EUR/USD,2,OPENED,1.3211,01/03/2005 11:00:00

The order is again only filled at the price of 1.277, this is repeated continuously, note there is no change in the value of the account either. This is independent of the stoploss / take profit level.
Account Value :: 999999.88
Message Information :: Order filled
Order Information :: EUR/USD,2,FILLED,1.2777,01/03/2005 11:00:00

I am using the standard TesterMain.java code with a link to my own strategy.


 
 Post subject: Re: Strange Behaviour in Historical Tester Post rating: 0   New post Posted: Wed 11 Aug, 2010, 21:30 

User rating: -
A solution (of sorts) has been found.
A backtest performed from more recent dates (2009 - 2010 data) seems to function as expected, all the above issues go away.

Unless there are other features with the historical tester this may well be the workaround for now - in which case its worth knowing the validity period for historical testing for each currency pair. I'd been keen to know if other users have experienced similar issues.


 

Jump to:  

  © 1998-2025 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