If I have multiple markets (let's say 5, but the solution should be generic) trading the same stock/commodity/whatever, and the markets differ in both variable fees (which are in % of the trade order) and fix fees (which are in absolute number of $ per trade order), and suppose there exists an arbitrage opportunity on more than 2 markets at the same time, how do you calculate the absolutely most profitable sequence of market orders? (order of orders matters)
The variable fees are not a problem, but the fix fees complicate the whole algorithm tremendously. Is this a traveling salesman type of problem? Or, is there any paper which deals with this problem.
The fees might be something like this (shown as an example):
1st market: $5 + 1 %
2nd market: $4 + 2 %
3rd market: $0 + 5 %
4th market: $10 + 0 %
5th market: $3 + 3 %