Small Node.js-based framework for backtesting Forex trading strategies. Allows creation of strategies and studies, and makes inclusion of studies within strategies easy.
- Install Node.js: https://nodejs.org.
- Install Gulp globally:
npm install -g gulp
. - Install Node modules:
npm install
. - Download minute tick data for one security from a supported data provider.
- Open MetaTrader, and open the History Center. Then import the data and export it into CSV format.
- Put the data into ./data/:
- mkdir ./data/metatrader
- mv AUDJPY.csv ./data/metatrader
- Create database
forex-backtesting
with indexes:
db.positions.createIndex({symbol: 1});
db.positions.createIndex({strategyUuid: 1});
db.backtests.createIndex({symbol: 1});
db.datapoints.createIndex({symbol: 1});
db.datapoints.createIndex({"data.timestamp": 1});
db.datapoints.createIndex({"data.groups.testing": 1});
db.datapoints.createIndex({"data.groups.validation": 1});
db.forwardtests.createIndex({symbol: 1});
db.forwardtests.createIndex({group: 1});
db.validations.createIndex({symbol: 1});
db.validations.createIndex({winRate: 1});
db.validations.createIndex({symbol: 1, configuration: 1});
Now run ./backtest.sh AUDJPY
.