Position size calculator which includes fees in the risk
Position size calculator which includes fees in the risk
Loading saved threads...
Jericho · External communityPost link
External question — Personal Finance Stack Exchange
Author: Jericho
Original post: https://money.stackexchange.com/questions/153022
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Problem:
I have a position calculator for scalping, but currently it does not include entry/exit fees in my risk calculation.
Since scalping, in most scenarios, requires leverage,
those fees really add up, and add more risk to each trade
. To clarify further, here's an example 2R trade.
Example:
Portfolio and variables:
My portfolio size is $10000
My risk per trade is 2%
My fees for entering and exiting the trade are 0.04% each
Trade details:
Entry : $20000
Stop Loss : $19850
Target : $20300
Position calculation details:
Max to risk : $-200,
Potential reward : $400
Risk:Reward : 2
Max size in shares : 1.33,
Max size in dollars : $26666.66,
Entry Fee : $-10.66,
Stop Loss Fee : $-10.58,
Take Profit Fee : $-10.82
(obviously I would have to use at least x3 leverage here to execute this trade, so don't get hang up on "your position size is greater than your entire portfolio" :)
Conclusion
:
In this example you can see that fees really add up in both scenarios:
if stop loss triggered: entry fee + stop loss fee = $21.24
if target reached: entry fee + take profit fee = $21.48
If my stop loss gets triggered, i'm loosing my
1R
, which is
$200
, plus additional
$21.24
in fees. That all sums up to
$221.24
, which is more than
-1.1R
, not the projected
-1R
.
Question:
Which mathematical formula could I use to include the fees in my position size calculator, so my
"targeted loss" with fees is exactly 2%
?
Code example:
I've recreated my position calculator in javascript and uploaded it
here
so you can play around with it.
The provided calculator includes both long and short calculation, but the core math/logic is this:
maxToRiskAmount = portfolioBalance * MAX_RISK_CONSTANT * -1;
rewardPerUnit = target - entry;
riskPerUnit = stopLoss - entry;
riskReward = rewardPerUnit / -riskPerUnit;
totalCostPerUnit = stopLoss - entry;
maxUnitSize = maxToRiskAmount / totalCostPerUnit;
maxPosSizeUSD = (maxToRiskAmount / totalCostPerUnit) * entry;
Quote
Report
WoSS · External communityPost link
External answer — Personal Finance Stack Exchange
Author: WoSS
Original post: https://money.stackexchange.com/a/154157
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Dunno if you got an answer to this, but I have been going round and round the last week with the same problem and think I may have found a method for the calculation.
Risk Premium (your risk per unit) is what we were both using to size on, versus max account risk.
I have found that if you multiply Entry price by maker fee (for limit in) and Stop price by taker fee (for Market stop out) then add these both to your risk premium (risk per unit), you get an overall risk premium per unit including the per unit fees.
If you then size based on this risk premium it seems to work (within a few cents anyway)
Give it a try.
Quote
Report
Post Reply
Checking account access…