Calculating Trade Profit with Entry and Exit Commissions
Summary
The document raises a backtesting question about calculating the return on a BNB/USDT trade after commissions. The author compares a purchase at 28.0750 with a sale at 27.5224, applies a 0.001% fee at each side, and obtains a loss of about 2.16%, while TradingView reports about 1.99%. The calculation converts the initial cash into units after the entry fee, then values those units at the exit price after the exit fee.
This is a useful example of how fees affect trade returns and of the need to match the backtest's accounting conventions to the comparison platform. However, the document contains only the question and the author's arithmetic; it includes no answer resolving the discrepancy. It does not establish TradingView's commission settings, fill assumptions, or return denominator, so the stated figures cannot identify the exact source of the difference.
Key ideas
- Trade return calculations should account for fees at both entry and exit.
- The example calculates units purchased after the entry fee and proceeds after the exit fee.
- A platform comparison requires matching fee settings and accounting conventions.
- The document does not explain the discrepancy between the two reported returns.
Tags
Full text
# Calculating a trading profit rate # Calculating a trading profit rate I wanted to chek my backtester engine, so I opened a tradingview account and I ran the same test. All buy and sell numbers, prices, dates, indicator calculation, etc were exactly same, but profit calculation was different. Here is an example: On BNB/USDT I bought @28.0750 and sold @27.5224 with commission %0.001, so I calculated -2.164% Loss in this case, but tradingview says it is -1,99% So my basic math is like this. ``` Buy >> 0.999/28.0750 = 0,035583259 (incl. %0.001 fee) Sell >> 0.999*27.5224 = 27,4948776 (incl. %0.001 fee) PLratio >> 0,035583259 * 27,4948776 = 0.978357350814 Pct >> (0.978357350814 -1)*100 = -2.1642649186 ``` Am I doing wrong?
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.