Requirements

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:

  1. Numerical routines written in C/C++ (with some very simple perl scripts)
  2. 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:

  1. User invokes Backtesting routine with a set of arguments (see below for an example)
  2. Backtesting routine downloads/processes the relevant price history
  3. The processed data is fed into a numerical routine called pre-rolling
  4. pre-rolling generates some output and pass them back to Backtesting routine
  5. Backtesting routine prepares the inputs based on the output from the pre-rolling and the arguments supplied
  6. Start backtesting - loop until we run out of the inputs
    1. An input is fed into a numerical routine called mp-cmx-mvs
    2. mp-cmx-mvs solves the problem and returns an output
    3. Backtesting routine stores the output and uses it to compute the running performance of the portfolios
  7. 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.

AttachmentSize
Backtester-screenshot.gif35.32 KB

What did I say then?

Mainland anticipates more independent future with new exchange | SCMP

Trading in oil futures resumes in Shanghai on Wednesday after a nine-year halt - with the first contracts in fuel oils and trading of crude expected to follow - and the market aims to be a competitor with Singapore in setting prices for Asia.

After years of high growth and stagnant domestic production, China has become the world's third-biggest importer of crude oil, after the United States and Japan, and Asia's biggest importer of fuel oils, but has almost no voice in how the world sets the prices for these commodities.

Trading of fuel oil contracts, which will be conducted at the Shanghai Futures Exchange (SFE), is the first step to changing that.......