Expectancy calculated incorrectly

According to the book of Van Tharp the expectancy is the average R, which is something different as the formula used here. The formula currently used is from Van Tharps first book, namely (Probability of Win * Average Win) – (Probability of Loss * Average Loss) . 


On page 18 of his newer book “definitive guide to position sizing” he writes that this formula is incorrect because expectancy really should be the average profit per dollar risked. It is best to just divide the profit/loss by the risk per trade and take the average of this to calculate the expectancy.

Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

a
#1

Venus

29.08.2019 20:41

Task created

o
#2

Enric

30.08.2019 18:17
Voted for this task.
a
#3

Venus

02.09.2019 19:24

Subject changed from SQN Score and Expectancy calculated incorrectly to Expectancy calculated incorrectly

MF
#4

Mark Fric

11.09.2019 11:04

Status changed from New to Waiting for information

I think it is correct. Formula for R Expectancy is: netProfit / (numberOfTrades*Math.abs(avgLoss));


which means average profit / averageLoss, where average loss is used as risk of trade.

a
#5

Venus

11.09.2019 20:34

Attachment Error incorrect expectancy - BTCUSD - 2percAcc.xlsx added

Hi Mark,


Thanks for your response. There is really a difference, please have a look at the attached XLS to see the difference. I made an export of a SQX backtest (see 2nd sheet). On the first sheet, you will see expectancy calculated in a different way. 


MF
#6

Mark Fric

24.09.2019 13:49
where do you get the Risk and R from in the Trades list?


Can you attach the strategy in .sqx format?

a
#7

Venus

25.09.2019 09:44

Attachment Strategy 10920.sqx added

Hi mark,


I calculated the risk and R myself in XLS in the following way:

- Risk: money lost when trade is a loser. In this case "balance" * "risk percentage", but this depends on money management obviously. Does SQX already have a variable in place for "Risk" in ordersList

- R: "profit/loss" divided by "risk"


Attached the strateqy in .SQX format


Eventually i would like to calculate the following statistic, which tells me something about the smoothness of the equity curve: https://roadmap.strategyquant.com/tasks/sqp_0062 . 

MF
#8

Mark Fric

10.10.2019 14:26

Attachment Error incorrect expectancy - BTCUSD - 2percAcc.xlsx added

please see the attached excel, I added few columns there. 

The whole change is that I used Average loss as a risk. We need to be able to compute R expectancy automatically without any further input, and it should work for any money management and stop loss type.

I believe using Avg Loss as a risk is reasonable estimate. I don't know about another way to determine risk that would be valid for any MM or SL.


And when we use it like this then R Expectancy becomes 0.51, just like in SQ X.

MF
#9

Mark Fric

11.10.2019 12:36

Status changed from Waiting for information to Fixed

a
#10

Venus

12.10.2019 18:48
Hi Mark, 


Thanks for the fix, i understand your thoughts regarding a general way of calculating risk. This is much better as the old situation!


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please