Discussion:
[JBookTrader] Some smaller improvements
Klaus
2016-07-31 20:16:40 UTC
Permalink
Hi,

I am not sure, whether there is still anyone using JBooktrader.
However, I would like to report on some smaller improvements, I recently
made.

a) Sometimes it does not make sense to analyze all possible combinations of
parameters in optimization.
(e.g., if the parameters are symmetrical this would lead to a double
analysis)
For this I added a method to strategy.java

// KS: added 160727 - to exclude incorrect parameter value combinations

public boolean eligible() {

return true;

}

This can now be overloaded in your strategy as you like.
In the call-method of the OptimizerWorker I added a corresponding
if-statement:



if (strategy.eligible()) {

strategy.setMarketBook(marketBook);

strategy.setIndicatorManager(indicatorManager);

strategy.setIndicators();

strategies.add(strategy);

}

else {

// System.out.println("Strategy excluded");

}


The inner part of the if is the original code.

b) It is sometimes also possible to work with a reduced dataset (I
typically gather all the data (24/7) and then just extract the relevant
data. - However, often it is also sufficient to use more coarse-grained
data for optimization. (this leads to very significant speed-ups) - Of
course this depends on your specific indicators whether that is meaningful,
and in many cases at least the parameter values need to be adapted in order
to make use of such an approach.

I use a simple R-script in order to make this extraction. The following
script extracts only the entries with second "00" and also restrict the
time of day. - You can adapt it easily to your need.
A downside of the primitive script is: at the end the first 10 lines need
to reinserted (and the line from the dataframe removed)
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# print("Reached 1")
if (length(args)!=1) {stop("the filename needs to be given", call.=FALSE)}
# print("reached 2")
df <- read.table(args[1], skip=10, sep=",",
col.names=c("Date","Time","Balance","Price","Volume"),colClasses=c("character","character","numeric","numeric","numeric"))
# print("reached 3")
dfr=df[df$Time>"080000" & df$Time<"170000" & endsWith( df$Time,"00"),]
write.table(dfr, file = paste(args[1],"B",sep=""),sep=",", quote = FALSE,
row.names = FALSE)

In order for such an approach to work, it is also necessary to adapt the
MIN_SAMPLE_SIZE definition in the IndicatorManager-class. (originally
60*60, here set to 10)

private static final long MIN_SAMPLE_SIZE = 10;// 60*60; 1 hour worth
of samples
Actually, a much better approach would be to proclaim the need for data in
units of time by the various indicators, the framework would gather this
and take it into account. But this would have required deeper changes.

Again, whether such a scaling is useful appropriate depends very much on
your specific strategy and indicators.

I hope someone finds this useful.

Klaus
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbooktrader+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
s***@gmail.com
2016-08-01 21:08:03 UTC
Permalink
Hello Klaus:

Where can I get some Win32 binaries to run this system, it looks great, but
I cannot get it to run!
I have tried Eclipse 3.3.0 and 3.8.2 but keept getting errors with JRE 1.7
and JRE 1.8.

Any chance you could post links to some compiled and ready to run
binaries???

If so, I will share trading systems and ideas that I develop with it!

Right now I use Quantshare which is OK, but I prefer something where I can
run different copies on different machines without all the LICENSE hassles!
Post by Klaus
Hi,
I am not sure, whether there is still anyone using JBooktrader.
However, I would like to report on some smaller improvements, I recently
made.
a) Sometimes it does not make sense to analyze all possible combinations
of parameters in optimization.
(e.g., if the parameters are symmetrical this would lead to a double
analysis)
For this I added a method to strategy.java
// KS: added 160727 - to exclude incorrect parameter value
combinations
public boolean eligible() {
return true;
}
This can now be overloaded in your strategy as you like.
In the call-method of the OptimizerWorker I added a corresponding
if (strategy.eligible()) {
strategy.setMarketBook(marketBook);
strategy.setIndicatorManager(indicatorManager);
strategy.setIndicators();
strategies.add(strategy);
}
else {
// System.out.println("Strategy excluded");
}
The inner part of the if is the original code.
b) It is sometimes also possible to work with a reduced dataset (I
typically gather all the data (24/7) and then just extract the relevant
data. - However, often it is also sufficient to use more coarse-grained
data for optimization. (this leads to very significant speed-ups) - Of
course this depends on your specific indicators whether that is meaningful,
and in many cases at least the parameter values need to be adapted in order
to make use of such an approach.
I use a simple R-script in order to make this extraction. The following
script extracts only the entries with second "00" and also restrict the
time of day. - You can adapt it easily to your need.
A downside of the primitive script is: at the end the first 10 lines need
to reinserted (and the line from the dataframe removed)
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# print("Reached 1")
if (length(args)!=1) {stop("the filename needs to be given", call.=FALSE)}
# print("reached 2")
df <- read.table(args[1], skip=10, sep=",",
col.names=c("Date","Time","Balance","Price","Volume"),colClasses=c("character","character","numeric","numeric","numeric"))
# print("reached 3")
dfr=df[df$Time>"080000" & df$Time<"170000" & endsWith( df$Time,"00"),]
write.table(dfr, file = paste(args[1],"B",sep=""),sep=",", quote = FALSE,
row.names = FALSE)
In order for such an approach to work, it is also necessary to adapt the
MIN_SAMPLE_SIZE definition in the IndicatorManager-class. (originally
60*60, here set to 10)
private static final long MIN_SAMPLE_SIZE = 10;// 60*60; 1 hour worth
of samples
Actually, a much better approach would be to proclaim the need for data in
units of time by the various indicators, the framework would gather this
and take it into account. But this would have required deeper changes.
Again, whether such a scaling is useful appropriate depends very much on
your specific strategy and indicators.
I hope someone finds this useful.
Klaus
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbooktrader+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
Judson Wilson
2016-08-02 04:30:01 UTC
Permalink
Maybe you should post the errors?
Post by s***@gmail.com
Where can I get some Win32 binaries to run this system, it looks great,
but I cannot get it to run!
I have tried Eclipse 3.3.0 and 3.8.2 but keept getting errors with JRE 1.7
and JRE 1.8.
Any chance you could post links to some compiled and ready to run
binaries???
If so, I will share trading systems and ideas that I develop with it!
Right now I use Quantshare which is OK, but I prefer something where I can
run different copies on different machines without all the LICENSE hassles!
Post by Klaus
Hi,
I am not sure, whether there is still anyone using JBooktrader.
However, I would like to report on some smaller improvements, I recently
made.
a) Sometimes it does not make sense to analyze all possible combinations
of parameters in optimization.
(e.g., if the parameters are symmetrical this would lead to a double
analysis)
For this I added a method to strategy.java
// KS: added 160727 - to exclude incorrect parameter value combinations
public boolean eligible() {
return true;
}
This can now be overloaded in your strategy as you like.
In the call-method of the OptimizerWorker I added a corresponding
if (strategy.eligible()) {
strategy.setMarketBook(marketBook);
strategy.setIndicatorManager(indicatorManager);
strategy.setIndicators();
strategies.add(strategy);
}
else {
// System.out.println("Strategy excluded");
}
The inner part of the if is the original code.
b) It is sometimes also possible to work with a reduced dataset (I
typically gather all the data (24/7) and then just extract the relevant
data. - However, often it is also sufficient to use more coarse-grained
data for optimization. (this leads to very significant speed-ups) - Of
course this depends on your specific indicators whether that is meaningful,
and in many cases at least the parameter values need to be adapted in order
to make use of such an approach.
I use a simple R-script in order to make this extraction. The following
script extracts only the entries with second "00" and also restrict the
time of day. - You can adapt it easily to your need.
A downside of the primitive script is: at the end the first 10 lines need
to reinserted (and the line from the dataframe removed)
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# print("Reached 1")
if (length(args)!=1) {stop("the filename needs to be given", call.=FALSE)}
# print("reached 2")
df <- read.table(args[1], skip=10, sep=",",
col.names=c("Date","Time","Balance","Price","Volume"),colClasses=c("character","character","numeric","numeric","numeric"))
# print("reached 3")
dfr=df[df$Time>"080000" & df$Time<"170000" & endsWith( df$Time,"00"),]
write.table(dfr, file = paste(args[1],"B",sep=""),sep=",", quote = FALSE,
row.names = FALSE)
In order for such an approach to work, it is also necessary to adapt the
MIN_SAMPLE_SIZE definition in the IndicatorManager-class. (originally
60*60, here set to 10)
private static final long MIN_SAMPLE_SIZE = 10;// 60*60; 1 hour
worth of samples
Actually, a much better approach would be to proclaim the need for data
in units of time by the various indicators, the framework would gather this
and take it into account. But this would have required deeper changes.
Again, whether such a scaling is useful appropriate depends very much on
your specific strategy and indicators.
I hope someone finds this useful.
Klaus
--
You received this message because you are subscribed to the Google Groups
"JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbooktrader+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
Ali Farahani
2016-08-02 04:46:15 UTC
Permalink
Hi Steve,

Let's start with the version of Eclipse you are using.You should be using
version 4 of Eclipse (Kepler, Luna, Neon). I recently compiled JBT on Neon
and it works without errors.

Best,

Ali
Post by s***@gmail.com
Where can I get some Win32 binaries to run this system, it looks great,
but I cannot get it to run!
I have tried Eclipse 3.3.0 and 3.8.2 but keept getting errors with JRE 1.7
and JRE 1.8.
Any chance you could post links to some compiled and ready to run
binaries???
If so, I will share trading systems and ideas that I develop with it!
Right now I use Quantshare which is OK, but I prefer something where I can
run different copies on different machines without all the LICENSE hassles!
Post by Klaus
Hi,
I am not sure, whether there is still anyone using JBooktrader.
However, I would like to report on some smaller improvements, I recently
made.
a) Sometimes it does not make sense to analyze all possible combinations
of parameters in optimization.
(e.g., if the parameters are symmetrical this would lead to a double
analysis)
For this I added a method to strategy.java
// KS: added 160727 - to exclude incorrect parameter value combinations
public boolean eligible() {
return true;
}
This can now be overloaded in your strategy as you like.
In the call-method of the OptimizerWorker I added a corresponding
if (strategy.eligible()) {
strategy.setMarketBook(marketBook);
strategy.setIndicatorManager(indicatorManager);
strategy.setIndicators();
strategies.add(strategy);
}
else {
// System.out.println("Strategy excluded");
}
The inner part of the if is the original code.
b) It is sometimes also possible to work with a reduced dataset (I
typically gather all the data (24/7) and then just extract the relevant
data. - However, often it is also sufficient to use more coarse-grained
data for optimization. (this leads to very significant speed-ups) - Of
course this depends on your specific indicators whether that is meaningful,
and in many cases at least the parameter values need to be adapted in order
to make use of such an approach.
I use a simple R-script in order to make this extraction. The following
script extracts only the entries with second "00" and also restrict the
time of day. - You can adapt it easily to your need.
A downside of the primitive script is: at the end the first 10 lines need
to reinserted (and the line from the dataframe removed)
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# print("Reached 1")
if (length(args)!=1) {stop("the filename needs to be given", call.=FALSE)}
# print("reached 2")
df <- read.table(args[1], skip=10, sep=",",
col.names=c("Date","Time","Balance","Price","Volume"),colClasses=c("character","character","numeric","numeric","numeric"))
# print("reached 3")
dfr=df[df$Time>"080000" & df$Time<"170000" & endsWith( df$Time,"00"),]
write.table(dfr, file = paste(args[1],"B",sep=""),sep=",", quote = FALSE,
row.names = FALSE)
In order for such an approach to work, it is also necessary to adapt the
MIN_SAMPLE_SIZE definition in the IndicatorManager-class. (originally
60*60, here set to 10)
private static final long MIN_SAMPLE_SIZE = 10;// 60*60; 1 hour
worth of samples
Actually, a much better approach would be to proclaim the need for data
in units of time by the various indicators, the framework would gather this
and take it into account. But this would have required deeper changes.
Again, whether such a scaling is useful appropriate depends very much on
your specific strategy and indicators.
I hope someone finds this useful.
Klaus
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbooktrader+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
Ali Farahani
2016-08-02 04:36:39 UTC
Permalink
Hi Klaus,

I still run JBT (mostly in Forward Test mode). The only indicator I use is
Force (Tension). Is your improvement meant to create a better (more
efficient) framework to optimize parameters Period, Scale, Entry, and Exit?

Best,

Ali
Post by Klaus
Hi,
I am not sure, whether there is still anyone using JBooktrader.
However, I would like to report on some smaller improvements, I recently
made.
a) Sometimes it does not make sense to analyze all possible combinations
of parameters in optimization.
(e.g., if the parameters are symmetrical this would lead to a double
analysis)
For this I added a method to strategy.java
// KS: added 160727 - to exclude incorrect parameter value
combinations
public boolean eligible() {
return true;
}
This can now be overloaded in your strategy as you like.
In the call-method of the OptimizerWorker I added a corresponding
if (strategy.eligible()) {
strategy.setMarketBook(marketBook);
strategy.setIndicatorManager(indicatorManager);
strategy.setIndicators();
strategies.add(strategy);
}
else {
// System.out.println("Strategy excluded");
}
The inner part of the if is the original code.
b) It is sometimes also possible to work with a reduced dataset (I
typically gather all the data (24/7) and then just extract the relevant
data. - However, often it is also sufficient to use more coarse-grained
data for optimization. (this leads to very significant speed-ups) - Of
course this depends on your specific indicators whether that is meaningful,
and in many cases at least the parameter values need to be adapted in order
to make use of such an approach.
I use a simple R-script in order to make this extraction. The following
script extracts only the entries with second "00" and also restrict the
time of day. - You can adapt it easily to your need.
A downside of the primitive script is: at the end the first 10 lines need
to reinserted (and the line from the dataframe removed)
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# print("Reached 1")
if (length(args)!=1) {stop("the filename needs to be given", call.=FALSE)}
# print("reached 2")
df <- read.table(args[1], skip=10, sep=",",
col.names=c("Date","Time","Balance","Price","Volume"),colClasses=c("character","character","numeric","numeric","numeric"))
# print("reached 3")
dfr=df[df$Time>"080000" & df$Time<"170000" & endsWith( df$Time,"00"),]
write.table(dfr, file = paste(args[1],"B",sep=""),sep=",", quote = FALSE,
row.names = FALSE)
In order for such an approach to work, it is also necessary to adapt the
MIN_SAMPLE_SIZE definition in the IndicatorManager-class. (originally
60*60, here set to 10)
private static final long MIN_SAMPLE_SIZE = 10;// 60*60; 1 hour worth
of samples
Actually, a much better approach would be to proclaim the need for data in
units of time by the various indicators, the framework would gather this
and take it into account. But this would have required deeper changes.
Again, whether such a scaling is useful appropriate depends very much on
your specific strategy and indicators.
I hope someone finds this useful.
Klaus
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbooktrader+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/jbooktrader.
For more options, visit https://groups.google.com/d/optout.
Loading...