Scorecard Feature Request - Net Profit/Average Bars Held
Author: Panache
Creation Date: 8/23/2016 11:05 AM
profile picture

Panache

#1
Eugene,

I would find it useful to have a Scorecard metric for Net Profit/Average Bars Held. The necessary information is already contained in the Net Profit and Avg Bars Held metrics.

This would be particularly helpful when Optimizing Strategies which have significant periods when they are not invested. The following are selected results from Optimizing such a Strategy:

Net Profit APR % Trades Avg Bars Held Profit / Total Bars Profit/Bar
178,754.52 0.18 61 3.97 709.34 45,026.33
392,895.11 0.4 61 14.67 1,559.11 26,782.22


While the second set of parameters results in twice the Net Profit (and APR% and Profit/Total Bars), the Strategy is holding each position almost four times as long.

Another useful version of this would be Net Profit/Average Bars Held/Trade. That would go one step further and allow users to easily differentiate between parameters which resulted in different numbers of trades within the Date Range.

I assume adding additional columns isn't that big of a deal, but if it is, you could delete APR% and/or Profit/Total Bars. I believe maximizing either of those produces the same result as maximizing Net Profit.

Thanks.
profile picture

Panache

#2
Attached is a better view of the table.

btw - If I want the image to appear in the post, what do I do after clicking on the Image icon above in order to insert the image?

profile picture

Eugene

#3
Hi Kurt,
Thank you for your suggestion but I do not understand the purpose. Wealth-Lab already has a performance metric called Profit per Bar which divides the total net profit by the total number of bars of exposure. Not sure what the "significant periods when they are not invested" have to do with this as the metric only considers the bars in a trade.

P.S.
QUOTE:
I assume adding additional columns isn't that big of a deal

It is a big deal so we do not throw everything in just for the sake of having it. Rather the opposite, after the rewrite from scratch of MS123 Visualizers some years ago I tend to be selective and thoughtful re: new metrics. Please read my detailed response to a similar request in another thread where I've summed up my position last week quite thoroughly.

QUOTE:
I assume adding additional columns isn't that big of a deal, but if it is, you could delete APR% and/or Profit/Total Bars.

We cannot and won't delete anything. Firstly, the Basic and Extended scorecards cannot be modified altogether since they belong to Fidelity. Speaking of the MS123 Scorecards, Wealth-Lab is used around the world from Russia to Australia and from Colombia to South Africa so who knows what metric may our users optimize for. We have to be selective about deleting something, too.

QUOTE:
btw - If I want the image to appear in the post, what do I do after clicking on the Image icon above in order to insert the image?

Copy and paste the attachment link inside an Image tag (img). I've just edited your 2nd post so there you have an example.
profile picture

Panache

#4
QUOTE:
Wealth-Lab already has a performance metric called Profit per Bar which divides the total net profit by the total number of bars of exposure.


Are you referring to Profit / Total Bars in the Basic and Extended Scorecards? If so, either I don't understand what you mean by "total number of bars of exposure" or the metric is not working as anticipated.

For illustration, here is a very simple Strategy

CODE:
Please log in to see this code.


This generates one Buy, which is sold the following day. Therefore, the position is held for 1 day (or 2 Bars Held).

If I run this with a Data Range of 10 Bars, Profit / Total Bars = Net Profit / 10. If I run it with a Data Range of 100 Bars, Profit / Total Bars = Net Profit / 100. Therefore, as the name suggests, all it appears to be doing is taking the Net Profit and dividing it by the total number of bars in the Date Range.

The number of Bars Held appears to have no impact on this metric. Therefore, using this metric, Strategy Parameters which result in the Strategy holding a position for the entire Data Range resulting in a Net Profit of $X would have the same Profit / Total Bars as Strategy Parameters which result in the Strategy holding the position for one bar and generating the same Net Profit. Obviously, I would prefer the latter!
profile picture

Eugene

#5
Got it. I was referring to Profit Per Bar in Raw Profit mode on the Performance tab and in both RP/Port.Sim. modes on the Trades tab. In PS mode the metric does change to Profit / Total Bars and it's suboptimal for performance evaluation as you've correctly pointed out.

I'm at a loss as to why it's the way it is but it definitely makes good sense to expose "Profit Per Bar" in Performance+ and both MS123 Scorecards (in Portfolio Simulation mode). Look for it early September. Thanks for your suggestion.
profile picture

Carova

#6
Hi Eugene!

I suggest that you consider "Profit % Per Bar" rather than "Profit Per Bar" in Portfolio Simulation mode. As equity grows in PS mode this absolute "dollar profit" make less sense.

Vince
profile picture

Eugene

#7
"Profit Per Bar" is an easy choice: since it's built-in (part of SystemResults) I don't even have to code it, just expose. Thanks for your suggestion Vince. Maybe for some future release I consider to review it.
profile picture

Eugene

#8
Panache,

As requested, "Profit Per Bar" is part of Performance+ and MS123 Scorecards now (update to v2016.09 of the library).
profile picture

Panache

#9
Thanks Eugene.

Just to clarify, I believe in the description "bars of exposure" means Average Bars Held * Number of Trades. Therefore, Profit per Bar appears to be (close to, but not exactly) Profit per Bar per Trade, ie. Net Profit / Avg Bars Held / Trades. (I'm guessing the reason it is not exact is that Wealth-Lab is calculating the Profit Per Bar based on each trade, rather than using Net Profit and Avg Bars Held.) The important thing to remember is that Position Sizing has an impact on Profit Per Bar.

To demonstrate this, here's a very simple Strategy:

CODE:
Please log in to see this code.


If you run this on AA though Friday's data (11/18/16) using 100% of $1 million in Starting Capital, it generates a Profit Per Bar of $6,838. However if you decrease the Percent of Equity to 50% and make two trades on AA instead of one, the Profit Per Bar drops to $3,416. (There are two additional commissions, which is why the numbers aren't exact.)

Net Profit 13,675 13,665
Average Bars Held 2 2
Number of Trades 1 2
Percent of Equity 100 50
Profit Per Bar 6,838 3,416
Calculated 6,838 3,416


When you have time, I'd still like to see a performance metric for Profit Per Bar, ie. Net Profit / Average Bars Held.

profile picture

Eugene

#10
You might want to be interested in implementing this custom metric yourself with the help of our fully functional demo of MS123 Visualizers (previous generation):

Home - MS123 Visualizers (log in and click on Attachments to download)