This actually turned out to be less useful than I originally thought it would be, since I have to specify the exact station rather than telling the script itself that I want to start and stop at the same unspecified station with a single jump.
In TD parlance a "jump" is a hyperspace jump between two stars, while a "hop" is buying at A and selling at B (TD doesn't yet factor in gas stops).
To providing a feature to access "round trips", I've talked to that a couple of times previously (e.g. https://forums.frontier.co.uk/showthread.php?t=34986&page=2&p=678898&highlight=round trip#post678898). Round-trips are an old habit that familiarizing yourself with TD can free you from.
TD doesn't artificially avoid round trips - Try some queries with "--hops 30" and you'll find that sometimes round-trips show up.
But the game is designed to generally preclude profitable round-trips; trade is designed to be primarily asymmetrical.
That's why TD has the "--hops" thing. You can ask it to look many hops forward for you, so that you can find things like this:
From A->B: 600cr/unit
From B->A: 40cr/unit
From B->C: 150cr/unit
From C->A: 500cr/unit
Obviously A->B->A is only 640cr/unit while A->B->C is 750cr/unit, but compare the following:
A->B->A->B->A->B->A
vs
A->B->C->A->B->C
600 * 3 + 40 * 3 = 1920cr/unit
vs
600 * 2 + 150 * 2 + 500 * 2 = 2500cr/unit
And bear in mind - the second route was shorter; if you make the routes by returning to A on the second route, you're talking 3100cr/unit vs 1920cr/unit.
Last edited: