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.

Backtesting date range
 Post subject: Backtesting date range Post rating: 0   New post Posted: Sun 18 Jan, 2015, 14:34 

User rating: 0
Joined: Thu 23 Jun, 2011, 07:26
Posts: 18
Location: United KingdomUnited Kingdom
Is there a way to programmatically determine the start and finish dates that the historical backtester has been started with?

So in the onStart() method of the strategy, you could find out the actual date ranges the strategy would run against.

Appreciate that's not how live strategies would normally operate, but for backtesting, it would be very useful to know how long the strategy is going to run for pre-allocating some memory structures.

https://imgur.com/oumc8sS for historical backtester screenshot where you specify the custom date range. Just need those values (2007.04.18, 2007.06.30) in the Strategy.


 
 Post subject: Re: Backtesting date range Post rating: 0   New post Posted: Wed 21 Jan, 2015, 10:54 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi!

Standalone API has ITesterClient.setDataInterval() / ITesterClient.getDataInterval() methods. But in case of platform's historical tester JForex API does not provide functionality to get that information.


 
 Post subject: Re: Backtesting date range Post rating: 0   New post Posted: Thu 22 Jan, 2015, 10:17 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
As a workaround you can add 2 new parameters to your strategy: start and end date of test.
Each time you start a new backtest on the platform, you can modify these settings accordingly. And the only thing is left to read out these parameters in the onStart().

I know this is not ideal, but at least you can get what you want.


 

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