Skip to content
Numerical Method , home
Menu

WikiAlgo Quant

Last modified 3 December 2013

AlgoQuant Setup

  1. AlgoQuant Setup
    1. Initial Setup
      1. NetBeans
      2. Eclipse
      3. Command Line
    2. Use AlgoQuant API via Maven dependency
    3. Link to the local AlgoQuant project
    4. Configuration File
    5. Project License

Initial Setup

AlgoQuant uses ​Maven for project management. To download and install required libraries, you need to do an initialization step.

NetBeans

In NetBeans, open the parent project algoquant and click Build:

Then, NetBeans will download all the required jar files into your local maven repository and run all the tests automatically.

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.

Then, Eclipse will download all the required jar files into your local maven repository and run all the tests automatically.

Reference: ​http://www.sonatype.com/books/m2eclipse-book/reference/index.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.

With the proper setup, you can start coding with AlgoQuant API.

Use 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, put the following in the section:

<repository>
    <id>nm-repo</id>
    <name>Numerical Method's Maven Repository</name>
    <url>http://repo.numericalmethod.com/maven/</url>
    <layout>default</layout>
</repository>

and add the following in the section:

<dependency>
    <groupId>com.numericalmethod</groupId>
    <artifactId>algoquant-core</artifactId>
    <version>0.8.0</version>
</dependency>

Then, your own code can directly call the API from algoquant-core.

After downloading, unzipping, and installing algoquant, you could ​create your own Maven project, and link to the local algoquant-core to use the AlgoQuant API. In this case, you could 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:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.yourcompany</groupId>
    <artifactId>your-project-id</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <installed.algoquant.version>0.8.0</installed.algoquant.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.numericalmethod</groupId>
            <artifactId>algoquant-core</artifactId>
            <version>${installed.algoquant.version}</version>
        </dependency>
    </dependencies>
</project>

Note: You have to install (or Clean and Build in NetBeans terminology) your local algoquant again after updating its 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 under the same directory.

Alternatively, you can create your custom-made configuration folder and files as in folder 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 under the core/src/main/resources/config folder or any location in the classpath.

Note that 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 projects use the NumericalMethod 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 this line in the project POM file (algoquant/pom.xml):

<netbeans.hint.license>NumericalMethod</netbeans.hint.license>

Archived from the original wiki · editing is closed