Giter VIP home page Giter VIP logo

alxfx's Introduction

AlxFx

Java-based custom local back-testing platform for foreign exchange trading.

Description

This app was created to have a custom backtesting system for evaluating fx strategies.

It is based on JForex platform from Dukascopy. java source code is in project folder. html customized report web code is in JFExtendedReports folder.

How it works

Classes in fradiani.env establish the communication with tick data loaded from csv files (this should be improved to work with a db and reduce space size) that for simplicity of manipulation emulate the tick data that can be publicly downloaded from dukascopy servers.

TickServer is in charge of loading the tick data and serve it to the TestingEnv, it uses the following logic:

  • Chunks of string lines are read from the csv files an kept in cache
  • The lines of the pairs are ordered serving those that are closer in time.
  • When a chunk is completed, another one is loaded until the data of a particular day is done.

TestingEnv is the platform execution environment, run this class to test a particular strategy.

The testing environment class loads a strategy in order to execute its specific trading rules, the global parameters for a backtest are defined in fradiani.strategies.ALX_COMMON i.e: periodStart, periodEnd, equity, strategyName, where strategyName is the full class name of the strategy to be executed.

Configuration

In order to be able to run tests, the following things need to be set:

  • In TickServer, edit the path to load CSV tick data

    public static final String TICK_PATH = "/path/to/csv_data/";

the structure for storing the files is PAIR/YEAR/PAIR_YEAR_MONTH_DAY.csv, e.g: EURUSD/2013/EURUSD_2013_03_01.csv the csv data can be obtained directly from Dukascopy or using tools like Tick Data Downloader.

  • in TestingEnv, the path for the reporting must point to the JFExtendedReports folder, this is the html/js code that shows the performance report of strategies tested.

    public static final String REPORTS_PATH = "/path/to/AlxFx/JFExtendedReports/public_html/";

Creating Strategies

The SampleTrades class could be used as template and as guide to understand the life-cycle of a strategy, which is very similar to the way strategies are defined in the JForex platform. A couple of simple technical indicators are defined in the fradiani.indicators package, but they are at a very primitive stage and should be improved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.