QuantumTester - Stock Strategy Backtester

Make more informed investment decisions and simplify and speed up your investing process with our stock strategy backtester. Backtesting has never been easier.

Login

{{errorMail}}
{{errorPassword}}



What is QuantumTester about?

QuantumTester makes it possible for you to backtest easily and quickly various investment strategies for US listed stocks. All you need to do is to define and implement a strategy based on price and/or financial data. Price data supports open, high, low and close values and financial data supports the most common financial metrics such as total sales, net income, shareholder's equity and operating cash flow. All financial data is available in per share format as well. Supported backtesting period is from 1988 to present.

QuantumTester makes it as well possible to include taxes, spread and commission to the simulation which makes the results much more realistic. In addition, you can specify simple volume constraints so that your backtesting results are not distorted by buying too illiquid securities. If you wish to backtest strategies using leverage or short-selling, that is as well possible. In this scenario, you can configure the cost of borrowing and shorting separately yourself.

Below you can download two example reports which QuantumTester has produced. The strategy 1 is based on low P/FCF and momentum factor with microcap stocks while strategy 2 is based on buying stocks at all time high and simply holding them.


Strategy 1



Strategy 2



How to get started?

You can start the backtesting process by registering on the left side. If you have already registered, please login using the login form on the left side. Each registered user has a 3 day free trial period to try out the service. After the trial period is over, you can continue the service by subscribing to our service at a cost of 20€ per month. The subscription period is 1 month after which you need to manually subscribe again.

Once you have logged in, the backtesting service screen with instructions how to use it will be automatically displayed. Then you can start simulating various kind of investment strategies, such as Magic Formula or more simpler ones such as just buying stocks when they reach an all time high.

Please note, that the service requires knowledge concercing Java programming language. If you are not familiar with it or are not interested in learning it, we provide as well a service where we can simulate strategies on your behalf according to your requirements. In this case, please send mail to athtester@ gmail.com



My Details

Show


Mail Address: {{mail}}

{{getCustomerInfo1()}}

{{getCustomerInfo2()}}

{{getCustomerInfo3()}}

Subscribe to our service using Paypal with only {{getPrice()}}€ per month. The subscription period is 1 month and it is not recurring.




Instructions

Show


Below you can find the editor with a pre-defined example with comments where you can specify your investment strategy which you would like to test. The Strategy.java is where you need to implement your strategy. The Indicators.java is where you need to implement your indicators, such as moving average, Piotroski number and so on. Once you are finished with your implementation, click the Compile button to start the simulation. If there are issues with your strategy syntax wise, the Compilation Output textbox below shows in which lines you had syntax issues. Please note that you need to use Java when implementing your strategy below. Once the simulation is finished, a Download button for the generated report will appear next to the Compile button. The simulation might take several minutes so patience is required.

The simulator performs the simulation starting from 1988 to present. Majority of stocks which are currently listed in the NASDAQ, NYSE and Amex are included in the simulation. Dividends, taxes and spread are taken into account in the simulation and you can configure these values in the Strategy.java. There are two functions in the Strategy.java; execute and postExecute. How the simulator works is that for each new day, the execute function is called once for each stock included in the simulation. The symbolIdx in the execute function describes the current internal Id of the symbol. The name of the symbol can be retrieved using the instructions below. The dateIdx describes the current internal Id of the date which can be used to get current date value using the instructions below. The postExecute is called after execute function has been called for all stocks listed in the simulation for the current day. This is useful e.g. for doing simulation for Piotroski as you need to first calculate Piotroski number for each stock and once you have this information only then you can decide which stocks to purchase and sell.

How to purchase a stock
Purchase 100 shares at the current end of day close price:
double price = cc.getData().getClose(dateIdx, symbolIdx);
cc.getOrderHandler().buy(symbolIdx, dateIdx, 100, price);
Sell short 100 shares at the current end of day close price:
double price = cc.getData().getClose(dateIdx, symbolIdx);
cc.getOrderHandler().buy(symbolIdx, dateIdx, -100, price);

How to sell a stock
Sell 100 shares at the open price of current day:
double price = cc.getData().getOpen(dateIdx, symbolIdx);
cc.getOrderHandler().sell(symbolIdx, dateIdx, 100, price);
Close short of 100 shares at the open price of current day:
double price = cc.getData().getOpen(dateIdx, symbolIdx);
cc.getOrderHandler().sell(symbolIdx, dateIdx, -100, price);

How to check how many shares you have in a specific stock
Check the amount of currently existing shares in the portfolio for the current stock:
cc.getOrderHandler().getShares(symbolIdx)

How to check the current symbol name
Check the stock ticker name of the current stock:
cc.getData().getSymbol(symbolIdx)

How to check current date
Get current year, month or day:
cc.getData().getYear(dateIdx)
cc.getData().getMonth(dateIdx)
cc.getData().getDay(dateIdx)

How to check current amount of cash
Get amount of cash in the portfolio:
cc.getEquity().getCash()

How to check current value of portfolio
Get current value of the portfolio:
cc.getEquity().getEquity(dateIdx)

How to get price data
Get the open, high, low or close price of current day for the current stock:
cc.getData().getOpen(dateIdx, symbolIdx)
cc.getData().getHigh(dateIdx, symbolIdx)
cc.getData().getLow(dateIdx, symbolIdx)
cc.getData().getClose(dateIdx, symbolIdx)
If you want to get the same price data for yesterday, just replace 'dateIdx' parameter with 'dateIdx - 1'
NOTE! At the moment only close price is supported.
NOTE! Latest price data will be available for users at the beginning of each calendar month.

How to get financial data
Get total equity for the current stock for last fiscal year:
int year = cc.getData().getYear(dateIdx) - 1;
cc.getData().getFinancialData(symbolIdx, TOTAL_EQUITY, year);
Get total equity per share for the current stock for last fiscal year using dollars:
int year = cc.getData().getYear(dateIdx) - 1;
cc.getData().getFinancialData(symbolIdx, TOTAL_EQUITY, year) /
cc.getData().getFinancialData(symbolIdx, NR_OF_SHARES, year) /
cc.getData().getFinancialData(symbolIdx, EXCH_RATE, year);
For some of the stocks, the financial data is not in dollars, so that is why the EXCH_RATE is recommended to be used.
The TOTAL_EQUITY above describes the financial data and the supported values are:

  • NET_INCOME: Net income
  • CASH_FLOW_FROM_OPER: Cash flow from operations
  • CASH_FLOW_FROM_INV: Cash flow from investment activies
  • CASH_FLOW_FROM_FIN: Cash flow from financing activies
  • TOTAL_LIABILITIES: Total liabilities
  • TOTAL_EQUITY: Shareholder's equity
  • CURRENT_ASSETS: Total current assets
  • CURRENT_LIABILITIES: Total current liabilities
  • NR_OF_SHARES: Total number of shares
  • REVENUE: Total sales
  • TOTAL_ASSETS: Total assets
  • DIVIDEND: Cash dividends
  • CAPEX: Capital Expenditures
  • EXCH_RATE: Exchange rate
  • OPER_INC: Operating income
  • CASH: Cash and short term investments

Invalid keywords
The following keywords are not allowed in Strategy.java or Indicators.java: try, catch, xception, throw. These will result in the following compilation error: No I/O operations are allowed. For example a following line is not allowed: int retry = 5;



Backtester

Show


Need support? We can implement strategies on your behalf. Just send mail to athtester@gmail.com


Strategy.java

Indicators.java


Loading...

Compilation output: