Some exchanges (tested: CBP, Bitmex) add fees to the buy side on buys and sell side on sells, rather than reducing the amount bought (as with BFX) so if you calculate a trade amount based on balance and target amount, there will be insufficient balance.
Needs fixing to take account of the fees on exchanges with this model. Probably means adding some metadata to XChange to tell us which type of exchange is involved.
Some exchanges (tested: CBP, Bitmex) add fees to the buy side on buys and sell side on sells, rather than reducing the amount bought (as with BFX) so if you calculate a trade amount based on balance and target amount, there will be insufficient balance.
Needs fixing to take account of the fees on exchanges with this model. Probably means adding some metadata to XChange to tell us which type of exchange is involved.