Part 1: Formula to calculate Stop Loss based on account variables
In part 1 I had trouble trying to get the formula correct to set a StopLoss at the right point. after weeks, I finally got it.
$$x = e-(p/L\times 0.01)\times e).$$
Now I have another related issue.
Lets say that I calculated my stoploss to be 9% of my account balance, and that worked, and the stoploss was hit. That means that my account just lost 9% and I am trying to verify that with a Profit/Loss % after the position is closed. This is what I have:
- Previous Account Balance = Current Account Balance - Loss
- Difference = Current Account Balance - Previous Account Balance
- StopLoss Percent = (Difference/Previous Account Balance) * 100
or in mathjax $$-x = {(a - (a-l))\over (a-l)} * 100$$
in this case, if x above equals 9% then x here should equal -9%, unless the position closed in a profit, then x should be something positive.
This isn't working as x comes in anywhere between -1 and -4