Click here to Login








System Metrics v2.0

by Dave Walton, 4139 days ago
Share |






This is an enhancement from the "System Metrics" MM script. This version has many calculation bug fixes and adds the following:
Four inputs:
1) # Tr Rolling R - the number of trades to use in rolling R/SQN calculation
2) Include Dividends - flag to indicate whether to include dividends in calculations (requires custom database with dividend entries: item http://www.quantshare.com/sa-37-how-to-download-the-history-of-dividend-payments-for-stocks-in-the-us-market)
3) ATR Lookback - ATR lookback at time of trade entry; used for volatility based position sizing
4) Avg Loss Estimate% - when the system has no stop, estimate of average loss based on historical data/testing, used for calculating R. THis does nothing if the system has an initial stop loss
5) # of bars to use in pre/post trade exit/entry efficiency - a value of zero means to use the same number of bars as the duration of the trade

Simulation Metrics:

Compounded Reinvested Dividend Value
Ending Account Value including Dividends
Max Drawdown% w/dividends
CAR w/dividends
Estimated Avg. Loss = 1.1%. Act. Avg. Loss% - when the system has no stop, user estimates avg loss, this metrics shows the delta
Standard Deviation of (R)
Max Drawdown (R)
Average Exit Efficency (winning trades only) - as defined by Chuck Lebeau: exit timing wrt post-trade timeframe
Average Entry Efficency (winning trades only) - entry timing wrt pre-trade timeframe
Average Winning Trade Efficency - combines Avg Exit Efficiency and Avg Exntry Efficiency (how much of the market move did the trade catch)
Average Losing Trade Efficency - combines Avg Exit Efficiency and Avg Exntry Eficiency (how much of the market move did the trade catch)
Winning Trade Ideal Entry Bars from Act. Entry - ideal entry point in relation to actual entry (-1 means the bar before entry)
Winning Trade Ideal Exit Bars from Act. Exit - ideal exit point in relation to actual exit (-1 means the bar before exit)
Losing Trade Ideal Entry Bars from Act. Entry
Losing Trade Ideal Exit Bars from Act. Exit

Per Trade Metrics

MFE%BT - MFE as if trade had been active in pre-trade timeframe
MAE%BT - MAE as if trade had been active in pre-trade timeframe
MFE%AT - MFE as if trade had been active in post-trade timeframe
MAE%AT - MAE as if trade had been active in post-trade timeframe
Exit Efficiency
Entry Efficiency
Trade Efficiency
IExit BFEx - Ideal Exit Bars From Exit
IEntry BFE - Ideal Entry Bars From Entry
MFEV - Market price of MFE
MAEV - Market price of MAE
MFE BFE - Bars from entry where MFE occured
MAE BFE - Bars from entry where MAE occured
MFEVBT - Market price of MFE as if trade was active in the pre-trade timeframe
MAEVBT - Market price of MAE as if trade was active in the pre-trade timeframe
MFEBT BFE - Bars from entry in pre-trade timeframe where MFE occured (always negative number)
MAEBT BFE - Bars from entry in pre-trade timeframe where MAE occured (always negative number)
MFEVAT- Market price of MFE as if trade was active in the post-trade timeframe
MAEVAT- Market price of MAE as if trade was active in the post-trade timeframe
MFEAT BFEx - Bars from exit in post-trade timeframe where MFE occured (always positive number)
MAEAT BFEx - Bars from exit in post-trade timeframe where MFE occured (always positive number)

Time Period Metrics

Account Equity w/dividends
R-Mult
Total R
Run Avg R
n Tr Avg R
n Tr SQN
Drawdown (R)
Exit Efficiency
Entry Efficiency
Trade Efficiency
Ideal Entry bars from Entry
Ideal Exit bars from Exit
Run Avg Exit Efcy
Run Avg Entry Efcy
Run Avg Winner Trade Efcy
Run Avg Loser Trade Efcy
Run Avg Winner Ideal Entry bars from Entry
Run Avg Loser Ideal Entry bars from Entry
Run Avg Winner Ideal Exit bars from Exit
Run Avg Loser Ideal Exit bars from Exit


From the original version: This MM script adds many system statistics and per trade metrics to help compare trading systems. Most of the calculations are done in terms of R (defiend as initial risk).


Trade Statistics:
Total R - P/L in terms of R
Expectancy (R)
SQN (n) - System Quality Number = expectancy(R)/stdev(R) * sqrt(num trades)
SQN100 - SQN normalized to 100 trades
T-score of returns - avg(perf)/stdev(perf) * sqrt(num trades)
Average Win (R)
Average Loss (R)
Largest Win (R)
Largest Loss (R)
Average Win MAE (R)
Average Loss MAE (R)
Largest Win MAE (R)
Largest Loss MAE (R)
Average Win MFE (R)
Average Loss MFE (R)
Largest Win MFE (R)
Largest Loss MFE (R)
Profit Factor (R)
Performance Ratio (R)
Payoff Ratio (R)
Largest Win (R) / Total R
Longest # bars between new equity highs
Longest # trades between new equity highs
Average # bars between new equity highs
Average # trades between new equity highs
% trades making new equity highs
% bars making new equity highs
Equity Curve R-Squared
R per Day
Daily SQN - SQN calculated using # of average closed trades per day
Opportunity (Day)
Expectunity (R) (Day)
Percent Inactive Days - number of days without closed trades
SQN (n) of Daily P/L (n = number of days in backtest)
SQN100 of Daily P/L
R per Week
Weekly SQN - SQN calculated using # of average closed trades per week
Opportunity (Week)
Expectunity (R) (Week)
Percent Inactive Weeks - number of weeks without closed trades
SQN (n) of Weekly P/L (n = number of weeks in backtest)
SQN100 of Weekly P/L
R per Month
Monthly SQN - SQN calculated using # of average closed trades per month
Opportunity (Month)
Expectunity (R) (Month)
Percent Inactive Months - number of days without closed trades
SQN (n) of Monthly P/L (n = number of months in backtest)
SQN100 of Monthly P/L
R per Year
Yearly SQN - SQN calculated using # of average closed trades per day
Opportunity (Year)
Expectunity (R) (Year)
Percent Inactive Years - number of days without closed trades
SQN (n) of Yearly P/L (n = number of months in backtest)
SQN100 of Yearly P/L
Per trade Metrics:
Margin% - % of account margin used
Entry Price - entry price of position
Exit Price - exit price of position
Risk - $ amount risked per trade
Risk% - %risked of total account per trade
R-Mult - trade P/L in terms of initial risk
MAE (R) - MAE in terms of R
MFE (R) - MFE in terms of R
n Tr Avg R - rolling average R for the last n trades (n is user defined)
n Tr SQN - rolling SQN for the last n trades (n is user defined)



Share This ->
Share |


You have to log in to bookmark this object
What is this?




Type: Advanced Money Management

Object ID: 1335


Country:
All

Market: All

Style:
All

Reviews
You must log in first

Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects

Empty

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Technical Analysis


Fundamental Analysis



Random Blog Posts

How to Automatically Import Local Data Into QuantShare

How to Switch On/Off Trading Rules in Your Stock Trading System

Backtesting a Strategy Based on Bond and Stock Index ETFs

4 Links to Download Free Historical Stock Prices Data by Date

Quantitative Analysis: Price Channels

How to Download Trading Data for Certain Securities Only

Learn How to Create Your Own Technical Analysis Indicators

How to Pick the Best Trend Indicators

Show All

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object






QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.