Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Transaction costs affect % return

Hi guys,

so in the code below ,which only places 2 trades:
if i run it with no transaction cost, the return is 201%
if i run it with transaction costs, the return is 202%

How can you get a larger return? I guess this goes to how the return is calculated but this seems funny to me. It should include the transaction costs as a loss maybe.
In either case, I'd like to plot my costs as a function of time or at least know the total $ value the algo spent. thoughts on how to get this?

5 responses

If you don't specify a commission model, it doesn't default to 0, it defaults to Quantopian's default, which happens to be quite steep.

I see, it's 3c / share. mine is 3c/share but 1.3$ minimum.

how could i find out the total $ amount i spend in commissions?
i dont see a method to get all the executed orders for which i could sum order. Commission

I have been doing that in the Research Platform, which you can get access to by submitting an algorithm to the Quantopian Open contest...

Hi Simon,
could you please provide more info how to do this? I'm interested to check, as well, what is the total transaction cost after Full Backtest is performed.
Currently, I can;t find that info.
thanks in advance

Hi Simon, or anyone else,
I think Saki's question is a good one and seems to still be unanswered, or at least not yet addressed in the form that I think would be most useful. Basically, as i run any backtest, i like to monitor the number of open positions and the leverage which is easy enough. I would also like to monitor the ratio of net P&L vs cumulative total transaction costs to date. P&L is just the total account equity minus initial equity but how can we obtain cumulative total transaction costs as a function of time? I'm sorry if this seems like a naieve question, but i'm, a "nerwbie" and still struggling with python. Example code would be very much appreciated. Cheers, thanks, TonyM.