Welcome to our Knowledge Base
Setup
Setup
AlgoQuant uses Maven for project management. To download and install the required libraries, you need to do an initialization step.
NetBeans
In NetBeans, open the parent project algoquant and click Build:
NetBeans will download all the required jar files to your local maven repository and run all the tests.
Reference: http://wiki.netbeans.org/MavenBestPractices
Eclipse
In Eclipse, import the parent project (choose File > Import > Maven > Existing Maven Project, then select the root directory of algoquant). Then, Eclipse may install the required maven plugins and restart.
After Eclipse restarts, you need to run Maven install for the parent project algoquant.
Eclipse will download all the required jar files to your local maven repository.
If there are errors shown in source files in algoquant-core, they may be due to the ignorance of Eclipse about the generated source code. Add the generated source folder:
References:
- http://www.sonatype.com/books/m2eclipse-book/reference/index.html
- https://www.eclipse.org/m2e/documentation/m2e-faq.html
Command Line
If you have already installed Maven in your workstation, you can directly use command line interface to do the setup by typing the command:
> mvn install |
at the outermost project folder. Having done the proper setup, you can now start coding with the AlgoQuant API.
Using AlgoQuant API via Maven dependency
Alternatively, you may use AlgoQuant API in your own project without downloading the whole zipped package. In your project POM, fill in our repository information in the section, then put a dependency in the section. Here is an example:
4.0.0
com.mycompany
myproject
1.0-SNAPSHOT
jar
UTF-8
1.8
1.8
nm-repo
Numerical Method's Maven Repository
http://repo.numericalmethod.com/maven/
default
com.numericalmethod
algoquant-core
2.0.0
Your own code can now call the API from algoquant-core.
Link to a local AlgoQuant Project
After downloading, unzipping, and installing AlgoQuant, you can create your own Maven project, and link to the local algoquant-core to use the AlgoQuant API. In this case, you can also customize AlgoQuant by changing the code in your local copy.
This is a simple example POM to link your project to your local AlgoQuant:
4.0.0
com.yourcompany
your-project-id
1.0-SNAPSHOT
jar
2.0.0
com.numericalmethod
algoquant-core
${installed.algoquant.version}
Note: You have to install (or Clean and Build in NetBeans terminology) your local AlgoQuant again after changing the source code.
Configuration File
The default configuration file is algoquant/core/config/config.default.xml. If you would like to modify the settings (e.g., location of data files), you can edit the file data.properties in the same directory.
Alternatively, you can create your custom-made configuration folder and files as in folder, e.g. haksunli, and define the system property config in your Java environment, e.g., -Dconfig=haksunli/config.haksunli.xml in NetBeans IDE. You can put the configuration files in folder core/src/main/resources/config or any location in the classpath.
If you would like to run unit testing with a different config file, you need to set the property of the test goal (see figure).
Project License
All our software requires a license. For NetBeans users, when creating a new file in the project AlgoQuant, you may see this error in the first line of the new file.
Error reading included file Templates/Classes/../Licenses/license-NumericalMethod.txt |
There are two options. You may choose to ignore them and delete this line each time you open a new file. Alternatively, you can comment out the following line in the project POM file (algoquant/pom.xml):
NumericalMethod |