add more feature to backtest

1 view
Skip to first unread message

ston...@gmail.com

unread,
Nov 28, 2007, 9:53:48 PM11/28/07
to jsystemtrader-dev
Hi, friends,
I like the JST very much. and I expect it will be better and better in
the future.

I add a simple feature to the JST1.5 last week.
the history data I download from IB is one year period. but many time
I only want test one day, one week or one month of it.
so I make some simple change in the BackTestFileReader.java
wish you also can implement in your next release.

Another feature I want jstrader can have in the future is use
configure file to control strategy,
in the MyStratege class, it get parameters from myStratege.config,


here is piece of my code for date range.
first add some fields to the header of historical data file:
#selectedDate=10/01/2007
startDate=10/01/2007
endDate=10/10/2007

public BackTestFileReader(String fileName) throws
JSystemTraderException {
......

boolean hasSelectedDate=exists("selectedDate");
String selectedDateStr=hasSelectedDate?
getPropAsString("selectedDate"):"";

......
boolean blPass=false;
if(hasSelectedDate)
{
if(!dateToken.equalsIgnoreCase(selectedDateStr))
{
blPass=true;
}
}else
{
if(hasStartDate)
{

if(simpleDateFormat.parse(dateToken).compareTo(StartDate)<0)
{
blPass=true;
}
}
if(hasEndDate)
{

if(simpleDateFormat.parse(dateToken).compareTo(EndDate)>0)
blPass=true;
}

}
if(!blPass){

......
}



Thanks for your hard work.

stone

Florent Guiliani

unread,
Nov 29, 2007, 4:19:12 AM11/29/07
to jsystemt...@googlegroups.com
ston...@gmail.com a écrit :

> I add a simple feature to the JST1.5 last week.
> the history data I download from IB is one year period. but many time
> I only want test one day, one week or one month of it.
> so I make some simple change in the BackTestFileReader.java
> wish you also can implement in your next release.

Do you want the downloader automatically split the history file into multiple
history files?

Florent,

Reply all
Reply to author
Forward
0 new messages