The Back Testing screen can be loaded from the Alerts menu in the Main Menu. 


Back Testing is a method that traders use to test their trading strategies against historical market conditions. Knowing how much profit or loss a trading system generated in the past may help prevent or reduce the risk of loss in real trading.

The Abacus Back Testing engine can calculate user’s trading system's performance using nearly two-dozen scientific profit, loss and risk measurements. Abacus allows user to specify individual instructions for buying, selling, holding, and exiting his/her simulated trades. To run a Back Test, simply enter and verify user buy, sell, and exit scripts then click the Back Test button. The Buy Script is a set of instructions for buying (going long) and the "Sell Script" is a set of instructions for selling (going short).


The scripts required on this screen are based on the Abacus programming language. Please refer to the Abacus programming guide for complete details. Click on script guide will open Tradescript Help document for user to learn how to write Buy, Sell and Exit scripts.



User can add symbol by clicking on Select Symbol button which will open Select symbol window to select symbols from any of the exchanges to perform the Backtesting.


Back Test Results Overview:


Some trading strategies work well on a wide range of securities but work poorly with some securities. Reasons may include poor market liquidity for a particular stock (low volume), high volatility and other factors. It is a good idea to test user’s own strategy across a wide range of securities. Just because it isn’t very profitable on one security doesn’t mean it won’t work well with another security. 

 

The values on the back testing page represent a range of measurements based on profitability and risk of user’s trading system when tested with the symbol that user supplied at the top of the back test screen. The output on the back testing results list provides an overall picture of how user’s strategy might perform if used as a live trading system. 



Overview of Back Test Outputs:

  • Total Number of Trades:
Total number of trades including buy, sell, and exit trades.


  • Average Number of Trades per Month
Average number of trades per month, including buy sell, and exit trades.


  • Number of Profitable Trades 
Total number of profitable trades since the beginning of the back test.


  • Number of Loosing Trades

Total number of non-profitable trades since the beginning of the back test.


  • Total Profit 

Total profit since the beginning of the back test.


  • Total Loss

Total loss since the beginning of the back test.


  • Percent Profit

Percentage of profitable trades in since the beginning of the back test.


  • Largest Profit

Largest single trade profit.


  • Largest Loss

Largest single trade loss.


  • Maximum Drawdown

The maximum account drawdown, defined as the percent retrenchment from equity peak to equity valley. Adrawdown is in effect from the time an equity retrenchment begins until a new equity high is reached.


  • Maximum Drawdown (Monte Carlo)

Same as maximum drawdown, except the test is repeated 5,000 times, with each test introducing a smallrandom slippage. Preferred over regular drawdown.


  • Value Added Monthly Index (VAMI)

Reflects the growth of a hypothetical $1,000 in a given investment over time. The index is equal to $1,000 atinception. Subsequent month-end values are calculated by multiplying the previous month’s VAMI index by 1plus the current month rate of return.


Where Vami 0=1000 and

Where R N=Return for period N

Vami N = (1 + R N) X Vami N-1


  • Compound Monthly ROR

The geometric mean is the monthly average return that assumes the same rate of return every period to arriveat the equivalent compound growth rate reflected in the actual return data.


  • Standard Deviation

Measure the degree of variation of returns around the mean (average) return. The higher the volatility of theinvestment returns, the higher the standard deviation will be.


Where R I = Return for period I

Where M R = Mean of return set R 

Where N = Number of Periods

M R = (∑ R I) ÷ N

I=1 

(∑ (R I - M R) 2 ÷ (N - 1)) ½


  • Annualized Standard Deviation 

Standard Deviation X (12) ½


  • Downside Deviation (MAR = 10%)

Similar to the standard deviation above except the downside deviation considers only returns that fall below adefined Minimum Acceptable Return (MAR) rather than the arithmetic mean. For example, if the MAR wereassumed to be 10%, the downside deviation would measure the variation of each period that falls below 10%.(The loss standard deviation, on the other hand, would take only losing periods, calculate an average return forthe losing periods, and then measure the variation between each losing return and the losing return average).


Where R I = Return for period I

Where N = Number of Periods

Where R MAR = Period Minimum Acceptable Return

Where L I = R I - R MAR (IF R I - R MAR < 0) or 0 ( IF R I - R MAR ³ 0 )

((S (L I) 2) ¸ N) ½

I = 1


  • Downside Deviation = ((S (L I) 2) ¸ N) ½

Where NL = Number of Periods where R I - M < 0


  • Sharpe Ratio

A measure developed by William Sharpe that is defined as the incremental average return of an investmentover the risk free rate. Risk (denominator) is defined as the standard deviation of the investment returns.


Where R I = Return for period I

Where M R = Mean of return set R

Where N = Number of Periods

Where SD = Period Standard Deviation

Where R RF = Period Risk Free Return

M R = (∑ R I) ÷ N

I = 1

SD = (∑(R I - M R) 2 ÷ (N - 1)) ½

I=1

Sharpe Ratio= (M R - R RF) ÷ SD


  • Sortino Ratio (MAR = 5%)

A return/risk ratio developed by Frank Sortino. Return (numerator) is defined as the incremental compoundaverage period return over a Minimum Acceptable Return (MAR). Risk (denominator) is defined as theDownside Deviation below a Minimum Acceptable Return (MAR).


Where R I = Return for period I

Where N = Number of Periods

Where R MAR = Period Minimum Acceptable Return

Where DD MAR = Downside Deviation

Where L I = R I - R MAR (IF R I - R MAR < 0) or 0 (IF R I - R MAR ≥ 0)

DD MAR = ((∑( L I ) 2 ) ÷ N ) ½

I=1

Sortino Ratio = (Compound Period Return - R MAR) ÷ DD MAR

Annualized Sortino ratio (MAR = 5%)

Annualized Sortino = Monthly Sortino X (12) ½


  • Calmar Ratio

Return/risk ratio. Return (numerator) is defined as the Compound Annualized Rate of Return over the last 3 years. Risk (denominator) is defined as the Maximum Drawdown over the last 3 years. If three years of data are not available, the available data is used.


  • Sterling Ratio (MAR = 5%)

Return/risk ratio. Return (numerator) is defined as the Compound Annualized Rate of Return over the last 3 years. Risk (denominator) is defined as the Average Yearly Maximum Drawdown over the last 3 years less an arbitrary 10%. To calculate this average yearly drawdown, the latest 3 years (36 months) is divided into 3 separate 12-month periods and the maximum drawdown is calculated for each. These 3 drawdowns are averaged to produce the Average Yearly Maximum Drawdown for the 3-year period. 


Where D1 Calmar Ratio = Average Annual ROR /Worst drawdown = Maximum Drawdown for first 12 months 

Where D2 = Maximum Drawdown for next 12 months 

Where D3 = Maximum Drawdown for latest 12 months 

Average Drawdown = (D1 + D2 + D3) / 3 

Sterling Ratio = Compound Annualized ROR /ABS ((Average Drawdown -10%))