Earn Forex Risk of Ruin Formula

JaytheSpade

Trader
Sep 18, 2021
3
0
6
44
Hi everyone,

There's a really good article on this site that explains different Risk of Ruin (ROR) calculations (https://www.earnforex.com/guides/risk-of-ruin-in-trading/).

The last one mentioned in the article is meant to calculate the ROR for a strategy that consists of different win/loss size, different probabilities which is the one that I want to use.

The article doesn't seem to explain what the N value is or how it is derived. In the article's example the value of 9 was inserted. Could someone tell me how this value is derived please?

I have a snapshot of some of the PHP code that I am referencing in the article and I have a link for it above.

Code:
/*
  Starting balance:      $2,500.00
  Target balance:        $5,000.00
  Avg. losing trade:     $1,500.00
  Avg. profitable trade: $1,000.00
  Loss probability:      30%
  Win probability:       70%
*/

$begin_state = 5;
$N = 9;
$loss_step = 3;
$win_step = 2;
$q = 0.3;
$p = 0.7;
....

Thank you for your help!
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,212
1,504
144
Odesa
www.earnforex.com
The $N is the number of transitional states (k) from the description above that code in the article.
There was an error in that description - it mentioned that k = 11 for that example. In fact it should be 9.
I have fixed it now and also added commentaries to describe that portion of the PHP code.
 

JaytheSpade

Trader
Sep 18, 2021
3
0
6
44
Thank you for the quick reply! Changing the 11 to 9 clears it up as that is the number that is referenced in the code. It makes perfect sense now!

So for simplicity, is it safe to use the formula (Target Balance / GCD) - 1 to get to K?

Thanks again!