I can see that there is no variable of "fees" which usually applies even on a LIMIT order.
For example Coinbase Pro has Maker fees of 0.15%. Ideally this fees should be added to BUY order and subtracted from SELL order, as that will actually cost you.