In-Development TradeDangerous: power-user trade optimizer

I apologize if this is a little off-topic, but I'm curious if there's any interest in an opensource GUI front end for Trade Dangerous? I've been working on one recently that works really well for me, and I was wondering if anyone else might find it helpful.

As awesome as Trade Dangerous is (hats off to Oliver for doing a brilliant job), having to juggle with command lines and batch files while running trade routes and missions is a bit annoying. I set out this past weekend to build a tool that helps with just being able to hop into the game, and occasionally fiddle with calculating trade routes.

If there's any interest I'll try to post a fresh thread.
 
I apologize if this is a little off-topic, but I'm curious if there's any interest in an opensource GUI front end for Trade Dangerous? I've been working on one recently that works really well for me, and I was wondering if anyone else might find it helpful.

As awesome as Trade Dangerous is (hats off to Oliver for doing a brilliant job), having to juggle with command lines and batch files while running trade routes and missions is a bit annoying. I set out this past weekend to build a tool that helps with just being able to hop into the game, and occasionally fiddle with calculating trade routes.

If there's any interest I'll try to post a fresh thread.

I'd be interested for sure. I'm currently sketching out a web app via cherry py to use on my phone but my coding and html skills are iffy to say the least :)
 
How to remove stations

It looks like some OCR derps made it into maddavo's Station.csv file.

Code:
trade.py local --ly=0 Branglal -vv
System              Dist
  /  Station                               StnLs Age/days BMkt Pad Itms
-----------------------------------------------------------------------
BRANGLAL            0.00
  /  Gibson Horizons                         882     2.89   No Lrg   66
  /  Skripochka Gateway                      882     0.00   No Lrg   66
  /  Skripochr Gateway                         ?        -    ?   ?    0

What is the official way to get these Stations and their trade data removed locally and remotely?

OK, this keeps coming up and the method has changed a bit over a few TD versions because of the way the cache rebuilds. The following are the steps from beginning to end for COMPLETELY REMOVING a station locally AND from maddavo market share.

1. Ensure you have a Station.csv (you may not have one)

Code:
trade.py export --tab Station

2. Edit the Station.csv so the offending station has ls_from_star=-1
(in the example below I've edited two bad stations)

Code:
unq:name@System.system_id,unq:name,ls_from_star,blackmarket,max_pad_size
'RBS 1843','Bernaro Landing',-1,'?','?'
'REDDIS','Olahus Krt',-1,'?','?'

3. Upload the edited Station.csv

Code:
python -m misc.madupload data/Station.csv

4. Edit/remove Station.csv. Because we now have a Station.csv that has been touched, any TD command will cause a buildcache. This is bad because it won't like the -1 values. So now DELETE the lines from the Station.csv OR just delete the Station.csv

5. Remove the station(s) from the TD database
(in the example I have abbreviated the system/station but as long as it is unique TD will find it)

Code:
trade.py station -rm reddis/olahuskrt
trade.py station -rm rbs/bernaro

6. Edit corrections.py. The stations are now gone from the local database and the Station.csv BUT if there were any prices for those stations (likely because bad stations are usually OCR derps when recording prices) then the stations are still in the local .prices file. So we have to make sure that a buildcache will not remake the stations. The following lines need to be added into the stations dict definition (look for #ADD_STATIONS_HERE).

Code:
    "RBS 1843/BERNARO LANDING":             DELETED,
    "REDDIS/OLAHUS KRT":                    DELETED,

I think it may be possible to skip step 4 and 5 if you do 6 but I haven't tested it. AN ALTERNATIVE to step 6 is to delete the station(s) prices in the prices file.

Obviously this whole procedure is a bit complex and non-user-friendly. I am working with kfsone to streamline this.
 
Last edited:
OK, this keeps coming up and the method has changed a bit over a few TD versions because of the way the cache rebuilds. The following are the steps from beginning to end for COMPLETELY REMOVING a station locally AND from maddavo market share.

1. Ensure you have a Station.csv (you may not have one)

Code:
trade.py export --tab Station

2. Edit the Station.csv so the offending station has ls_from_star=-1
(in the example below I've edited two bad stations)

Code:
unq:name@System.system_id,unq:name,ls_from_star,blackmarket,max_pad_size
'RBS 1843','Bernaro Landing',-1,'?','?'
'REDDIS','Olahus Krt',-1,'?','?'

3. Upload the edited Station.csv

Code:
python -m misc.madupload data/Station.csv

4. Edit/remove Station.csv. Because we now have a Station.csv that has been touched, any TD command will cause a buildcache. This is bad because it won't like the -1 values. So now DELETE the lines from the Station.csv OR just delete the Station.csv

5. Remove the station(s) from the TD database
(in the example I have abbreviated the system/station but as long as it is unique TD will find it)

Code:
trade.py station -rm reddis/olahuskrt
trade.py station -rm rbs/bernaro

6. Edit corrections.py. The stations are now gone from the local database and the Station.csv BUT if there were any prices for those stations (likely because bad stations are usually OCR derps when recording prices) then the stations are still in the local .prices file. So we have to make sure that a buildcache will not remake the stations. The following lines need to be added into the stations dict definition (look for #ADD_STATIONS_HERE).

Code:
    "RBS 1843/BERNARO LANDING":             DELETED,
    "REDDIS/OLAHUS KRT":                    DELETED,

I think it may be possible to skip step 4 and 5 if you do 6 but I haven't tested it. AN ALTERNATIVE to step 6 is to delete the station(s) prices in the prices file.

Obviously this whole procedure is a bit complex and non-user-friendly. I am working with kfsone to streamline this.

From a bash perspective, what I do is this:

Code:
$ head -1 data/Station.csv >tmp/badstations.csv
$ grep "^'SYSTEM','STATION'" data/Station.csv >>tmp/badstations.csv
$ sed -e "s/',[0-9]*,/',-1,/" tmp/badStations.csv

This:
. copies the first line of Station.csv into tmp/badstations.csv,
. copies the station line into badstations.csv,
. replaces the distances with -1

There's also a perl script for parsing the output from buildcache/import and automatically turning the OCR Derps into a tmp/badstation.csv file (misc/badstations.pl). So you do something like:

Code:
$ trade.py import -i import.prices | misc/badstations.pl
 
Thanks for the tool. It's really useful and entertaining too.

I've one question though, that is... Yesterday I downloaded maddavo's prices, systems and stations. The download was fine, so all good. Alas, while being in Poponne system (Fan Port station, to be more precise), I noticed that the prices in the station were different from the ones that I downloaded, so I updated them via trade.py's new GUI interface. So far, so good. The new local prices for that particular station were received by the tool and the details and suggestions for profitable runs changed accordingly.

Later I downloaded new prices from maddavo and I was glad to notice that the Poponne's prices I personally updated weren't touched, because they were more recent that the ones from maddavo.

Here's my question, then: is there any way to contribute to maddavo? In other words, since I double checked the new prices of that particular station (Fan Port in Poponne system), is there any command that I can use in the shell to upload them to maddavo and share them with other people?

Thanks for the support and keep up the excellent job.
 
Last edited:
Thanks for the tool. It's really useful and entertaining too.

I've one question though, that is... Yesterday I downloaded maddavo's prices, systems and stations. The download was fine, so all good. Alas, while being in Poponne system (Fan Port station, to be more precise), I noticed that the prices in the station were different from the ones that I downloaded, so I updated them via trade.py's new GUI interface. So far, so good. The new local prices for that particular station were received by the tool and the details and suggestions for profitable runs changed accordingly.

Later I downloaded new prices from maddavo and I was glad to notice that the Poponne's prices I personally updated weren't touched, because they were more recent that the ones from maddavo.

Here's my question, then: is there any way to contribute to maddavo? In other words, since I double checked the new prices of that particular station (Fan Port in Poponne system), is there any command that I can use in the shell to upload them to maddavo and share them with other people?

Thanks for the support and keep up the excellent job.

There are indeed many ways to provide your local updates back to maddavo. In TradeDangerous, you run the madupload.py script in the misc folder. But the simplest way is to occasionally upload your entire TradeDangerous.prices file in your data folder to madddavo's site http://www.davek.com.au/td/default.asp
 
What are the 'rules' about whether the station updates that you upload to maddavo's site via the web page form are accepted or not?

I ask because I uploaded my entire station.csv twice today, and have downloaded station.csv several times (if the maddavo site showed a new timestamp for the file). My updates have not been propogated into the version available for download.

Normally I use the madupload.py script, every time I modify a single station, but it was producing VBScript errors yesterday. So today I tried the web page method.
 
Last edited:
question: upload button trade d from EliteOCR

hi,
does this button have a function at all?
i alway push it, in the hope its this what it meant to be.
but there is unforunately no feedback.

anyway, upload to EDDN from E_OCR is in function (also feedback via green bar ).
so, (as it stands (my current knowledge)) trade d is updated via maddavo,
maddavo is updated via EDDN.

is this button in E_OCR relevant ever (aside from its dubious functionality)?

with best regards

ps.: may all data be good:)
 
hi,
does this button have a function at all?
i alway push it, in the hope its this what it meant to be.
but there is unforunately no feedback.

anyway, upload to EDDN from E_OCR is in function (also feedback via green bar ).
so, (as it stands (my current knowledge)) trade d is updated via maddavo,
maddavo is updated via EDDN.

is this button in E_OCR relevant ever (aside from its dubious functionality)?

with best regards

ps.: may all data be good:)

Are you talking about OliteOCR and the Trade Dangerous export button? If so, you have to run command "trade.py import import.prices", without quotation marks, so that it updates the TD prices.

It allows users to have instant new and correct prices for that station. And also if the user doesn't want the data to be public, but still wants to use TD.
 

wolverine2710

Tutorial & Guide Writer
I apologize if this is a little off-topic, but I'm curious if there's any interest in an opensource GUI front end for Trade Dangerous? I've been working on one recently that works really well for me, and I was wondering if anyone else might find it helpful.

As awesome as Trade Dangerous is (hats off to Oliver for doing a brilliant job), having to juggle with command lines and batch files while running trade routes and missions is a bit annoying. I set out this past weekend to build a tool that helps with just being able to hop into the game, and occasionally fiddle with calculating trade routes.

If there's any interest I'll try to post a fresh thread.

Absolutely positively YES. In the past a few commanders started with a GUI but afaik stopped and iirc one is still looking at making a GUI but rather slowly making progress (RL). I think a powerful GUI could bring TD more to the masses. TD is very very powerful but unless one is a familiar with working with a CLI/Shell program it can be off putting a bit. Very curious how you are going to harness the power of TD in a GUI ;-)
 
I apologize if this is a little off-topic, but I'm curious if there's any interest in an opensource GUI front end for Trade Dangerous? I've been working on one recently that works really well for me, and I was wondering if anyone else might find it helpful.

As awesome as Trade Dangerous is (hats off to Oliver for doing a brilliant job), having to juggle with command lines and batch files while running trade routes and missions is a bit annoying. I set out this past weekend to build a tool that helps with just being able to hop into the game, and occasionally fiddle with calculating trade routes.

If there's any interest I'll try to post a fresh thread.

Oh, absolutely - the "license" for the TD code is at the top of tradedb.py - it basically says "do what you will, just give me a mention". One guy asked if it was ok to port to android and I pointed out that was fine, and that it was ok to charge for the app so long as he didn't translate that into an SLA from me :)
 
I have been toying with the idea of moving this to a LAMP VM and putting a PHP front end on it. But I'm enjoying the game too much, don't have time to waste....
 
Hi guys! I love TradeDangerous and I use it all the time. :) [EDIT: I am using version 6.10.0] I have a question about the expected behavior when using trade.py run with both --from and --to. (I use this when I am docked at a station and I have a specific system or station I want to go to, so I want to see what I can trade.). So what I do is specify "--hops 1" so I don't have to stop off in between. This works fine if the --to system is relatively close to the --from system, but if it's far away I get back "Error: No profitable trades matched your critera" *unless* I artificially increase the "--ly-per" I pass to it.

For example, if I use --ly-per=22.24:

Code:
trade.py run --from "YEMBO/Naddoddur Terminal" --to "ERAVATE" --credits 300000 --hops 1 --capacity 112 --ly-per=[B]22.24[/B]

trade.py: Error: No profitable trades matched your critera, or price data along the route is missing.

But then if I run the exact same command except artificially increasing the "--ly-per" to 50, it works as expected:

Code:
trade.py run --from "YEMBO/Naddoddur Terminal" --to "ERAVATE" --credits 300000 --hops 1 --capacity 112 --ly-per=[B]50[/B]

YEMBO/Naddoddur Terminal -> ERAVATE/McMahon Dock
  YEMBO/Naddoddur Terminal: 88 x Auto-Fabricators, 3 x Polymers,
  ERAVATE/McMahon Dock +77,300cr

Is it a bug? Why does the "--ly-per" value make any difference when finding a profitable trade between the --from and --to systems?

EDIT:
BTW if I use the -v switch it correctly shows the jumps I have to make to reach Eravate (it assumes my 50ly max jump, though :p), so it doesn't appear that it's just a matter of TD expecting my ship to reach the destination system in one jump:

Code:
trade.py run --from "YEMBO/Naddoddur Terminal" --to "ERAVATE" --credits 300000 --hops 1 --capacity 112 --ly-per=50 -v

YEMBO/Naddoddur Terminal -> ERAVATE/McMahon Dock (score: 77313.914000)  Load from YEMBO/Naddoddur Terminal: 88 x Auto-Fabricators (@3406cr), 3 x Polymers (@75cr),
  [B]Jump YEMBO -> VERBIGENI -> ERAVATE[/B]
  Dock at ERAVATE/McMahon Dock
  Finish ERAVATE/McMahon Dock + 77,300cr => 377,300cr
 
Last edited:
@dezeer / thanks for your answer,
i was not aware of the fact, that this button "Trade Dangerous Export" in "Elite OCR"
is of course only a local export.
(see also the headline of my post;))

but anyhow, my favorite command before start ED is:
"trade.py import --plug=maddavo --option=stncsv --option=syscsv".
so its not that importent and crucial for the current game.

the things are again a little clearer.

 
Last edited:
Oh, absolutely - the "license" for the TD code is at the top of tradedb.py - it basically says "do what you will, just give me a mention". One guy asked if it was ok to port to android and I pointed out that was fine, and that it was ok to charge for the app so long as he didn't translate that into an SLA from me :)

Cool, so basically just the MIT license then. I'll probably do the same. I'll make sure I put a mention on the site and with the tool itself.
 
For example, if I use --ly-per=22.24:

Is it a bug? Why does the "--ly-per" value make any difference when finding a profitable trade between the --from and --to systems?

No it's not a bug. You have missed the --jumps argument. The default is 2. Jumps are the maximum number of systems TD will plot a route through to get --from from --to to :D

So by asking TD to find a route between YEMBO and ERAVATE in 1 hop (i.e. no interim stops) with only 2 jumps of a maximum of 22.24ly per jump it will not find a route.

If you change your first command to

Code:
[COLOR=#E4E4E4]trade.py run --from "YEMBO/Naddoddur Terminal" --to "ERAVATE" --credits 300000 --hops 1 --capacity 112 --ly-per=[/COLOR][B]22.24 --jumps=3[/B]

then it will find you a route.

In conclusion never make claims for your light year jump that your ship cannot do. Increase --jumps instead.

Hope that helps.
 
Absolutely positively YES. In the past a few commanders started with a GUI but afaik stopped and iirc one is still looking at making a GUI but rather slowly making progress (RL). I think a powerful GUI could bring TD more to the masses. TD is very very powerful but unless one is a familiar with working with a CLI/Shell program it can be off putting a bit. Very curious how you are going to harness the power of TD in a GUI ;-)

Well, that's where user suggestions come in. If the interface needs improvements, and I'm not aware of some particular use case, I'll do my best to oblige. Though if someone else wants to change things they can just do a pull request on bitbucket and I'll check it out.

I'll work on refactoring the interface this coming weekend to make it cleaner. I'm busy with adding Via, Rare routing, and improving the Buy/Sell support right now.
 
Last edited:
Regarding the TradeDangerous GUI discussion, I have a lightweight GUI I've been working for a while now that I hope to release this weekend. It's not a full GUI, it just shows the TD console output in a window, but it's a lot easier for me to use than the command line and it has full auto-completion when typing system/station names and items. (It's Windows-only since it's written in in .NET 4.5.) You just drop it into your TradeDangerous folder and run. Screenshot is below:

tdgui_14_snapshot.jpg

That being said, I think an open-source full GUI for TradeDangerous that WombatFromHell talked about is a great idea! (My TDGUI will never be a full GUI, nor will it be open-source, so I don't see it competing with Wombat's GUI. :D)
 
Last edited:
Well done chasps ...

I must say, I'm loving the flexibility of TD.
Now that I've got back into the habit of CLI working, that is.

Yesterday I hardly flew in-game at all, I was having too much fun trying out different combinations of "trade.py run", making a point to save the good ones ;)
The power of multi hop routes and start near/end near takes TD way beyond the others.

All power to your elbows, Oliver and team.
 
Back
Top Bottom