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.

Questions about backward testing
 Post subject: Questions about backward testing Post rating: 0   New post Posted: Thu 10 Dec, 2009, 16:41 

User rating: 0
Joined: Sun 29 Nov, 2009, 04:15
Posts: 11
My strategy uses time filter, for live trading, I could use the local machine time. For backward test, does JForex platform feed the history timestamp to the strategy so I could use tick.getTime()? It's a long type so is it the milliseconds? I heard you use GMT timezone but interesting when I debug in live trading, the line new Date(tick.getTime()) still gives me the time in my zone(EST).
Besides, when testing, I saw many duplicated orders opened once the first one hit the stoploss, of course all of them hit the SL. In my strategy, I actually loop through the current open orders at first, then open a single order so there shouldn't be more than one opened at certain time. Is this a bug in tester or I should do something differently to avoid this?
Another question is about the optimizing of settings, does JForex has GA built in to speed the optimizing like MT4? If not, are you thinking about adding one? For most strategies, it's impossible to manually loop through all the combination of settings to find the result.

Thanks!


 
 Post subject: Re: Questions about backward testing Post rating: 0   New post Posted: Mon 14 Dec, 2009, 15:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Another question is about the optimizing of settings, does JForex has GA built in to speed the optimizing like MT4? If not, are you thinking about adding one? For most strategies, it's impossible to manually loop through all the combination of settings to find the result.

Yes, we are. It will be added in the near future.


 
 Post subject: Re: Questions about backward testing Post rating: 0   New post Posted: Mon 14 Dec, 2009, 15:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
ridgeren wrote:
For backward test, does JForex platform feed the history timestamp to the strategy so I could use tick.getTime()

ITick.getTime() returns time when this particular tick was created
ridgeren wrote:
It's a long type so is it the milliseconds?

Yes, it is time in milliseconds since year 1970
ridgeren wrote:
the line new Date(tick.getTime()) still gives me the time in my zone(EST)

Java Date class always has it's time in GMT time zone internally, but when you call toString() it uses default system time zone. Try this code:
DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss SSS");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
console.getOut().println(dateFormat.format(tick.getTime()));

ridgeren wrote:
Besides, when testing, I saw many duplicated orders opened once the first one hit the stoploss, of course all of them hit the SL. In my strategy, I actually loop through the current open orders at first, then open a single order so there shouldn't be more than one opened at certain time. Is this a bug in tester or I should do something differently to avoid this?

It's hard to say what is wrong without seeing you code. Can you post that place where you check for open orders and submit new one?


 

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