I'm currently writing something to script arbitrage between two exchanges to test the concept.
I know I can determine the difference in prices by using
(ExhangeA_sell - ExchangeB_buy) <- this will give me the price difference. i.e. gross profit (before fee's)
My question, how do I take the fee's into account when calculating net profit?
Currently my thinking is that I add the commission % to the buy price on ExchangeA and subtract the commission % from the sell price on ExchangeB.
Any ideas on this?