# Calculating returns with trading costs

This perhaps is an over simplification of calculating trading returns while including trading costs. I've made some assumptions - the commission for investing and extracting an investment is 1% and 2% respectively. The commissions do not change over the trading period which in this case is 5 time steps. I've used Python code to perform the calculations.

Set of positive and negative percentage changes in price for a given asset over 5 time steps is {0.031% , 0.00121% , 0.0231% , -0.0213% , -0.0121%}.

The commission to enter an investment is 1% of the invested amount, the commission to exit an investment is 2% of the current value of the invested amount.

If I invest 1 euro in this asset, is the following correct?

1.

The final investment amount if I do not trade the investment until $$t=5$$ is: the final percentage change amount at $$t=5$$ which is 'initial invested amount' + '% change' - 'commission to enter' - 'commission to exit', therefore:

initial_investment_amt = 1

comission_in_amt = 1

comission_out_amt = 2

price_change = -.0121

return_amt = (initial_investment_amt + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100) = 0.97 which represents a loss of 1 - .97 = .03


2.

The final investment amount if I trade the investment at each time step until $$t=5$$ is:

initial_investment_amt = 1

comission_in_amt = 1

comission_out_amt = 2

price_change = .031

return_amt_1 = (initial_investment_amt + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100)

price_change = .00121

return_amt_2 = (return_amt_1 + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100)

price_change = .0231

return_amt_3 = (return_amt_2 + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100)

price_change = -.0213

return_amt_4 = (return_amt_3 + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100)

price_change = -.0121

return_amt_5 = (return_amt_4 + (price_change / 100)) - (comission_in_amt / 100) - (comission_out_amt / 100)

print(return_amt_1)
print(return_amt_2)
print(return_amt_3)
print(return_amt_4)
print(return_amt_5)


prints :

0.97031
0.9403220999999999
0.9105530999999999
0.8803400999999998
0.8502190999999998


which represents a loss of $$1 - 0.85 = 0.15$$.

Then the quantity of the asset you have is ((100) - (0.01 * 100)) / buy_price_of_asset.
Suppose you then sell the asset at a price of 110. The selling process becomes: (110 * quantity) - 0.02 * (110 * quantity).