I’m working on a partially automated trading journal in Google Sheets and having issues with my position size formula.
Here is the setup of my sheet:
C1: Portfolio (e.g., $1000)
D8: Position type (e.g., "LONG" or "SHORT")
E8: Entry price (e.g., $1)
F8: Position size (the cell I want to calculate)
G8: Leverage (default is x10)
K8: Stoploss (default is 2%)
I would like F8 to automatically calculate the position size in tokens based on these inputs. For example, with a $1000 portfolio, a long position at $1, leverage of x10, and a 2% stoploss, I expect the formula to return 117,000 tokens.
Here’s the formula I’m currently using:
=IFERROR(((C$1 * G8) / (ABS(E8 - K8) / G8)) / E8)
However, it gives me 177,782 tokens, which doesn’t match my actual trading history.
What I want is for the formula to account for:
- Portfolio value and leverage (to calculate effective capital).
- Entry price and stoploss level (to determine risk).
What am I doing wrong, and how can I adjust this formula to calculate the correct position size?
Thank you for your help!
3