Dukascopy
 
 
Wiki JStore Search Login

Running a strategy on Historical Tester - questions
 Post subject: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Sun 05 Feb, 2017, 22:48 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hi
I have a strategy which:-

(a) accesses a table of data, performs data mining and updates the table
(b) continuously writes out debugging data to a file

When I run this strategy in demo state, everything works perfectly :)

The following is the early code for access to database table..................

private class DerbyApp
{
private String framework = "embedded";
private String driver = "org.apache.derby.jdbc.EmbeddedDriver";
private String protocol = "jdbc:derby:";

void go(String[] args_derby)
{

parseArguments(args_derby);

fw.writetoFile(("DerbyApp starting in " + framework + " mode"), FILE_NAME);

loadDriver();

ArrayList statements = new ArrayList(); // list of Statements, PreparedStatements
PreparedStatement ps = null;
PreparedStatement psInsert = null;
PreparedStatement psUpdate = null;
PreparedStatement psDelete = null;

fw.writetoFile(("DerbyApp starting in " + framework + " mode"), FILE_NAME);

try
{
Properties props = new Properties(); // connection properties
props.put("user", "BobM");
props.put("password", "xxxx");

String dbName = "C:/Users/Stan/.netbeans-derby/us_copiosus_USDJPY_S"; // the name of the database

conn = DriverManager.getConnection(protocol + dbName, props);

fw.writetoFile(("Connected to database " + dbName), FILE_NAME);

conn.setAutoCommit(false);

s = conn.createStatement();
statements.add(s);


When I run this strategy in the Historical Tester

(c) the data table is NOT updated - not sure whether the table is accessed or not
(d) error occurs - File writing error - can't find the path specified

Any ideas on how to correct both of these problems?

Many thanks

Bob M


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Mon 06 Feb, 2017, 12:40 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1054
Location: Geneva, Switzerland
We will investigate this.


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Mon 06 Feb, 2017, 23:16 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Thank you for that.....................

At the moment, I am UNABLE to produce accurate historical data in my database table


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Wed 08 Feb, 2017, 15:50 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1054
Location: Geneva, Switzerland
Please provide the full source code.


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Thu 09 Feb, 2017, 02:31 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
The FULL source code is in excess of 3,000 lines !

In addition, I would prefer to keep the code private

Platform Support - are you of the opinion that I should be able to run a strategy which accesses a derby database and updates it on the Historical Tester platform successfully ?

As I mentioned before, this works perfectly on both Live and Demo platforms

So my only problem is getting some accurate historical data (trades)

Bob M


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Thu 09 Feb, 2017, 12:38 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1054
Location: Geneva, Switzerland
Yes, you should be able to do that. We will rectify this problem, if you provide us a sample, without any trading logic, which repeats the problem.


 
 Post subject: Re: Running a strategy on Historical Tester - questions Post rating: 0   New post Posted: Sun 12 Feb, 2017, 22:42 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hi Platform Support

I have no idea why, but I now get historical data using the Historical tester with updated records in my derby table

so , all good :)

Bob M


 

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