ston...@gmail.com
unread,Nov 28, 2007, 9:53:48 PM11/28/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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