Dukascopy
 
 
Wiki JStore Search Login

How to get data interval of ITesterClient
 Post subject: How to get data interval of ITesterClient Post rating: 0   New post Posted: Tue 19 Mar, 2013, 09:02 
User avatar

User rating: 6
Joined: Thu 19 May, 2011, 11:14
Posts: 235
Location: South Africa,
Is it possible to obtain the "from" of an ITesterClient's data interval?
E.g. getDataIntervalFrom() such that gotFrom==from in...
testerClient.setDataInterval(dataLoadingMethod, from, to);
gotFrom=testerClient.getDataIntervalFrom();


 
 Post subject: Re: How to get data interval of ITesterClient Post rating: 0   New post Posted: Tue 19 Mar, 2013, 09:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No. What would be the applicability of such method if there were one?


 
 Post subject: Re: How to get data interval of ITesterClient Post rating: 0   New post Posted: Tue 19 Mar, 2013, 11:43 
User avatar

User rating: 6
Joined: Thu 19 May, 2011, 11:14
Posts: 235
Location: South Africa,
A strategy wants to know "from" during backtesting in the JF client. Since the call to setDataInterval is made from the client, the strategy cannot have access to "from" except through the API.

The reason why a strategy might want to know "from" is hard to explain briefly, but I will try:
  • In live mode, the strategy uses an ITesterClient internally to stream to itself a preamble of historical ticks in order for its state machine to reach a steady state quickly.
  • In backtest mode, the strategy cannot do this because the API does not allow more than one ITesterClient to exist at a time.
  • Therefore the strategy considers the first section of the backtest stream to be the preamble, and only starts trading after this section.
  • In order to decide when to switch over from preamble to trading in backtest mode, the strategy therefore needs to know "from"
  • In the past, I have approximated "from" with the date of the first tick streamed, but weekends introduce some unwanted variation in this approach.


 
 Post subject: Re: How to get data interval of ITesterClient Post rating: 0   New post Posted: Thu 20 Jun, 2013, 17:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Available with JForex-API 2.7.10.


 
 Post subject: Re: How to get data interval of ITesterClient Post rating: 0   New post Posted: Fri 21 Jun, 2013, 12:35 
User avatar

User rating: 6
Joined: Thu 19 May, 2011, 11:14
Posts: 235
Location: South Africa,
Thank you!


 

Jump to:  

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