# Backtest Results Definitions

In the zip file backtest results. There are 2 folders called StockOutputs and StrategyOutputs. Within the StockOutputs, there are 2 files called StockReturns.csv and StockStats.csv. Inside the StrategyOutputs folder, there will be 3 files called StrategyReturns.csv, StrategyStats.csv, and StrategyTrades.csv.

There are also 3 files called StockSummary.csv, StrategySummary.csv, and output.json in the root folder. The Summary files are just Stats.csv data but all in 1 row. The output.json file has all the results in JSON format.

# StockStats.csv

Field Definition
AnnReturn Annual Return = Total Yearly Annual Returns / Total Years.
AnnSharpe Annual Sharpe Ratio = Annual Return - Risk-Free Return / Standard Deviation of Excess Returns.
AnnSortino Annual Sortino Ratio = Annual Return - Risk-Free Return / Standard Deviation of Negative Excess Returns.
AnnVolatility Standard Deviation of Yearly Returns.
MaxDrawDown% Percentage of Max drawdown from peak to trough.
DrawDownDays Number of days of Max drawdown from peak to trough.
BestMonthRtn Best Returns in a month.
WorstMonthRtn Worst Returns in a month.
BestYearRtn Best Returns in a year.
WorstYearRtn Worst Returns in a year.
Year Year of backtest.
Jan - Dec Monthly Returns.

# StockReturns.csv

Field Definition
Date Date of Daily Return.
Return Daily Return = Current Stock Price / Previous Stock Price - 1.
StockPx Stock Price.

# StrategyStats.csv

Field Definition
AnnReturn Annual Return = Total Yearly Annual Returns / Total Years.
AnnSharpe Annual Sharpe Ratio = Annual Return - Risk-Free Return / Standard Deviation of Excess Returns.
AnnSortino Annual Sortino Ratio = Annual Return - Risk-Free Return / Standard Deviation of Negative Excess Returns.
AnnVolatility Standard Deviation of Yearly Returns.
MaxDrawDown% Percentage of Max drawdown from peak to trough.
DrawDownDays Number of days of Max drawdown from peak to trough.
BestMonthRtn Best Returns in a month.
WorstMonthRtn Worst Returns in a month.
BestYearRtn Best Returns in a year.
WorstYearRtn Worst Returns in a year.
BestTradeP&L$ Best profit/loss in a given trade in absolute dollars per 1 contract.
WorstTradeP&L$ Worst profit/loss in a given trade in absolute dollars per 1 contract.
BestTradeP&L% Best profit/loss in a given trade in notional percent returns.
WorstTradeP&L% Worst profit/loss in a given trade in notional percent returns.
P&L$PerTradeAvg Profit/Loss per trade average in dollar terms.
P&L$PerDayAvg Profit/Loss per day average in dollar terms.
P&L%PerTradeAvg Profit/Loss per trade average in percentage terms.
P&L%PerDayAvg Profit/Loss per day average in percentage terms.
StratWinRate Strategy Win Rate = Total Number of Winning trades divided by Total number of trades.
DaysInTradeAvg Average number of days in option trade.
TotStratTrades Total number of trades.
TotStratP&L$ Total Profit/Loss for the strategy in dollar terms.
TotStratP&L% Total Profit/Loss for the strategy in percentage terms = TotStratP&L$ / (CreditReceivedPerTradeAvg * TotStratTrades)
CreditReceivedPerTradeAvg Credit/Debit Received/Paid per trade average.
%OfTimeInMarket Percent of time in the market = Number of days in the market divided total number of days in the backtest.
Year Year of backtest.
Jan - Dec Monthly Returns.

# StrategyReturns.csv

Field Definition
Date Date of Daily Return.
Return Daily Notional Return = Daily Option Profit / Entry Stock Price.
Delta Total net delta in the position.
StockPx Stock Price.
TotalProfit Total 1 lot daily strategy profit.
TotalTrades Total number of current option positions.

# StrategyTrades.csv

Field Definition
Date Date of option trade entry.
Ticker Stock Symbol.
Leg Leg number of the trade.
Ratio Ratio of the option trade. (ie 1 for long and -1 for short. -2 could be the middle strike for 2 short options in a butterfly)
Weight Weightings multiplier for a symbol that affects profit and return calculations. Commonly used for multi-symbol strategies. Click here for more info.
OptionType call or put
Year Year of expiration.
Month Month of expiration.
Strike Strike of the option.
DTE Days to expiration.
TradeOptPx Entry option price.
Delta Entry option delta.
EntryStockPx Stock price at the time of option trade entry.
IVR Implied Volatility Rank of the time of entry.
ExitDate Exit date of the option trade.
ExitStockPx Stock price at the time of option trade exit.
ExitOptionPx Exit option price.
ExpirDate Expiration date.
ExpirPx Stock Price at expiration.
Profit 1 lot total strategy profit including commissions and weightings multiplier if any.
TradeType Opening or Adjustment trade.

# JSON output

The output.json or json response from the API has all the results in JSON format.

See Backtest Results API for API call.

Example Response

{
	"strategy": {
		"trades": [{
			"date": "2007-01-05",
			"ticker": "IBM",
			"leg": 1,
			"ratio": -1,
			"weight": 1,
			"optionType": "call",
			"year": 2007,
			"month": 2,
			"strike": 100,
			"dte": 44,
			"tradeOptPx": 1.525,
			"delta": 0.38,
			"entryStockPx": 97.42,
			"ivr": 20.68,
			"exitDate": "2007-02-16",
			"exitStockPx": 98.99,
			"exitOptionPx": 0,
			"expirDate": "2007-02-16",
			"expirPx": 98.99,
			"profit": 151.5,
			"tradeType": "opening"
		}, {
			"date": "2007-02-22",
			"ticker": "IBM",
			"leg": 1,
			"ratio": -1,
			"weight": 1,
			"optionType": "call",
			"year": 2007,
			"month": 3,
			"strike": 100,
			"dte": 24,
			"tradeOptPx": 0.762,
			"delta": 0.37,
			"entryStockPx": 98.5,
			"ivr": 20.67,
			"exitDate": "2007-03-16",
			"exitStockPx": 93.25,
			"exitOptionPx": 0,
			"expirDate": "2007-03-16",
			"expirPx": 93.25,
			"profit": 75.2,
			"tradeType": "opening"
		}, 
		...
		],
		"returns": [{
			"date": "2007-01-05",
			"return": "-0.0001026",
			"delta": -0.38,
			"stockPx": 97.42,
			"totalProfit": 0,
			"totalTrades": 1
		}, {
			"date": "2007-01-08",
			"return": "-0.0070622",
			"delta": -0.470649,
			"stockPx": 98.9,
			"totalProfit": -68.80,
			"totalTrades": 1
		}, {
			"date": "2007-01-09",
			"return": "-0.0056457",
			"delta": -0.538148,
			"stockPx": 100.07,
			"totalProfit": -54.99,
			"totalTrades": 1
		}, 
		...],
		"stats": {
			"summary": {
				"annReturn": 1.33,
				"annSharpe": 0.05,
				"annSortino": 0.11,
				"annVolatility": 6.31,
				"maxDrawDownPct": 18.07,
				"drawDownDays": 707,
				"bestMonthRtn": 4.2,
				"worstMonthRtn": -9.37,
				"bestYearRtn": 9.42,
				"worstYearRtn": -9.85,
				"bestTradePnlDollar": 295,
				"worstTradePnlDollar": -1167.8,
				"bestTradePnlPct": 3.24,
				"worstTradePnlPct": -8.05,
				"pnlDollarPerTradeAvg": 17.37,
				"pnlDollarPerDayAvg": 0.59,
				"pnlPctPerTradeAvg": 0.11,
				"pnlPctPerDayAvg": 0.39,
				"strategyWinRate": 76.16,
				"daysInTradeAvg": 29,
				"totalTrades": 151,
				"totalDollarProfits": 2623.5,
				"totalPctProfits": 11.480646784674969,
				"avgCreditReceived": 151.33,
				"percentOfTimeInMarket": 99.16074887023886
			},
			"monthly": [{
				"year": 2007,
				"Jan": 0.75,
				"Feb": 1.47,
				"Mar": 0.32,
				"Apr": -1.85,
				"May": -4.3,
				"Jun": 0.53,
				"Jul": -3.66,
				"Aug": -1.27,
				"Sep": 1.26,
				"Oct": 0.89,
				"Nov": 3.04,
				"Dec": 0.91,
				"annReturn": -1.91,
				"annSharpe": -0.39,
				"annSortino": -0.67,
				"annVolatility": 7.22
			}, {
				"year": 2008,
				"Jan": 0.51,
				"Feb": -2.09,
				"Mar": -2.19,
				"Apr": 1.05,
				"May": -0.46,
				"Jun": 2.35,
				"Jul": 0.78,
				"Aug": 1.35,
				"Sep": 0.87,
				"Oct": 2.37,
				"Nov": 0.65,
				"Dec": 4.2,
				"annReturn": 9.42,
				"annSharpe": 1.18,
				"annSortino": 2.43,
				"annVolatility": 5.98
			},
			...]
		}
	},
	"stock": {
		"returns": [{
			"date": "2007-01-03",
			"return": 0,
			"stockPx": 97.27,
			"adjClsStockPx": 73.08397
		}, {
			"date": "2007-01-04",
			"return": "0.0106919",
			"stockPx": 98.31,
			"adjClsStockPx": 73.86538
		}, {
			"date": "2007-01-05",
			"return": "-0.0090530",
			"stockPx": 97.42,
			"adjClsStockPx": 73.19668
		}, 
		...],
		"stats": {
			"summary": {
				"annReturn": 7.7,
				"annSharpe": 0.34,
				"annSortino": 0.96,
				"annVolatility": 19.86,
				"maxDrawDownPct": 40.64,
				"drawDownDays": 119,
				"bestMonthRtn": 17.26,
				"worstMonthRtn": -26.27,
				"bestYearRtn": 50.01,
				"worstYearRtn": -23.68
			},
			"monthly": [{
				"year": 2007,
				"Jan": 2.04,
				"Feb": -6.08,
				"Mar": 1.49,
				"Apr": 8.28,
				"May": 4.7,
				"Jun": -1.16,
				"Jul": 5.23,
				"Aug": 5.84,
				"Sep": 1.01,
				"Oct": -1.26,
				"Nov": -8.96,
				"Dec": 2.92,
				"annReturn": 14.04,
				"annSharpe": 0.76,
				"annSortino": 1.14,
				"annVolatility": 16.49
			}, {
				"year": 2008,
				"Jan": -0.37,
				"Feb": 6.8,
				"Mar": 1.26,
				"Apr": 4.89,
				"May": 7.53,
				"Jun": -8.61,
				"Jul": 7.89,
				"Aug": -4.49,
				"Sep": -3.39,
				"Oct": -21.07,
				"Nov": -11.17,
				"Dec": 3.93,
				"annReturn": -16.8,
				"annSharpe": -0.71,
				"annSortino": -0.76,
				"annVolatility": 29.28
			},
			...]
		}
	}
}