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.

How to make basic strategy from client library?
 Post subject: How to make basic strategy from client library? Post rating: 0   New post Posted: Sun 22 Aug, 2010, 01:38 

User rating: 0
Joined: Mon 09 Aug, 2010, 21:49
Posts: 30
I have been programming EA's with MT4/MQL for about 4 years now, and have taken a C++ 101 class in college, so I have some understanding of how to code things, but Java and OOP are new to me.

I have downloaded and installed Netbeans. I also downloaded the JForex client library zip, extracted it, and imported it into Netbeans, then saved the project to a new folder on my desktop.

I see the MA_play strategy "comes with" the jforex client library. I believe I know enough about coding to adapt this and make my own strategy out of this file. But then, what all do I have to put in C:\Documents and Settings\My Documents\JForex\Strategies? Do I have to put the whole folder in there? The whole project with the src folder and the libraries folder and everything they contain. Or is all I have to bring over the MA_play.java file? (assuming I don't use any other imports or libraries)

And will it still work right if I rename the java file to something else by simply right clicking on it in windows explorer an renaming it?


 
 Post subject: Re: How to make basic strategy from client library? Post rating: 0   New post Posted: Mon 23 Aug, 2010, 20:08 

User rating: 0
Joined: Mon 09 Aug, 2010, 21:49
Posts: 30
Well I swapped out the text in MA_play with my own strategy. Then I right clicked on the MA_Play file in netbeans project explorer, changed the name, and then clicked on "refactor"

Now I get this error on this line:

public class WanderingJava implements IStrategy
{


error: singlejartest.WanderingJava is not abstract and does not override abstract method onStop() in com.dukascopy.api.IStrategy


I have no idea what that means or how to fix it.

Advice?


 
 Post subject: Re: How to make basic strategy from client library? Post rating: 0   New post Posted: Tue 24 Aug, 2010, 07:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hi,
you just need to implement the method onStop.
It would look like:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
public void onStop() throws JFException {
    //your business logic goes here
}
Parsed in 0.048 seconds, using GeSHi 1.0.8.4


 

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