Requirement
We require an Excel Add-In that wraps an existing program written in C/C++/Java
Background
Please read below carefully. Any questions, please feel free to let us know.
The current program consists of two blocks:
- Numerical routines written in C/C++ (with some very simple perl scripts)
- Backtesting routine written in Java
Numerical routines and Backtesting routine are completely separate. The numerical routines are invoked using Runtime process.
Backtesting routine is really a prototype and we are asking to re-implement the routine, using whichever language is suitable.
In nutshell, the Backtesting routine downloads the price history of the selected financial assets from Yahoo Finance and feed them into the numerical routines with a set of arguments. The Numerical routines then do some calculation and return the result, which is picked up by the Backtesting routine to compute the running performance of the portfolios. At the end, the Backtesting routine outputs the summary of the backtesting result.
A brief workflow is:
- User invokes Backtesting routine with a set of arguments (see below for an example)
- Backtesting routine downloads/processes the relevant price history
- The processed data is fed into a numerical routine called pre-rolling
- pre-rolling generates some output and pass them back to Backtesting routine
- Backtesting routine prepares the inputs based on the output from the pre-rolling and the arguments supplied
- Start backtesting - loop until we run out of the inputs
- An input is fed into a numerical routine called mp-cmx-mvs
- mp-cmx-mvs solves the problem and returns an output
- Backtesting routine stores the output and uses it to compute the running performance of the portfolios
- At the end of the backtesting, Backtesting routine returns the stored outputs + the performance history of the portfolios
Example of arguments
#! /usr/bin/perl $cmd = "perl ./backtest.pl ". ".MPCMXMVSModel.java ". #source file "MPCMXMVSModel ". #class name "\"19/06/05\" \"19/01/06\" \"weekly\""." ". #start date, end date, frequency "1e-5"." ". #tolerance "\"\'0.8 0.2\'\""." ". #preference over skew and return "0.05 10 1"." ". #risk range, no. of history to read, no. of iter "5"." ". #no of assets "\"\'10 2 2\'\""." ". #branching structure "\"\'0.2 0.2 0.2 0.2 0.2\'\""." ". #initial allocation "\"\'0.005 0.005 0.005 0.005 0.005\'\" \"\'0.005 0.005 0.005 0.005 0.005\'\""." ". #buying/selling cost "\"\'^HSI ^N225 ^DJC ^TYX\'\""." ". #underlying factor tickers "\"\'0005.HK 0941.HK 0013.HK 0883.HK 0011.HK\'\""." ". #asset tickers "\"mid\""." ". #minimax type "1e-5 -1"." ". #penalty for transactions, terminal? "\"/mp-cmx-mvs-p/mp-cmx-mvs\""." ". #path for mp-cmx-mvs "\"/utils/pre-roll\""; #path for pre-rolling system($cmd);
Other information
This is the first of a series of projects that we will post in the coming months.
Every effort should be made to develop in-house whatever is necessary for the final deliverable, any use of third-party components (open-source or not) should be subject to a consent from us.
| Attachment | Size |
|---|---|
| Backtester-screenshot.gif | 35.32 KB |
