In-Development TradeDangerous: power-user trade optimizer

What shell do you use to run trade.py? Is it the basic CMD shell or is there a better alternative?
Also where do I get the DB files from? I have an SQL file and some CSV files in the Data Folder but no actual TradeDangerous.DB file or do I have to create that first?
I have read through the help and it seems to assume you already have a Database setup.

Am I misssing something?
 
Last edited:
CMD is fine. Navigate to the folder where you have your trade.py and you can <Shift>+<Right Mouse Click> and "Open command window here"
For price data visit http://www.davek.com.au/td/default.asp and download the latest TradeDangerous.prices file. This goes into the \data folder of your TradeDangerous location.
When you execute your first run command, the TradeDangerous.db will be built.
 
You're most welcome!
Also make sure to spend some time to update the stations you visit in your travels with the available items, prices and their stocks.
For example you could execute the following to update the Sullivan Port station.
Code:
trade.py -v update --notepad -S -0 "Sullivan Port"
This will open the station's data in Notepad in the following format:
Code:
@ ALDERAMIN/Sullivan Port
   + Chemicals
      Explosives                  0       0       n/a      n/a
      Hydrogen Fuels              0       0       n/a      n/a
      Mineral Oil                 0       0       n/a      n/a
      Pesticides                  0       0       n/a      n/a
   + Consumer Items
[...]
In order, the fields after the item are the sell price, buy price, demand amount and stock amount.
You also need to delete any line for an item that is not listed at all by a station.
You should end up with something as:
Code:
@ ALDERAMIN/Sullivan Port
   + Chemicals
      Explosives                175     186       n/a   36761H
      Hydrogen Fuels            167       0  1010789M      n/a
      Mineral Oil               267       0   206858H      n/a
   + Consumer Items
[...]
Note that I've deleted the Pesticides since Sullivan Port doesn't have this item (not sure what this means, maybe the item is illegal there?). For the Explosives, the stock of '36761H' is taken from the game where the station is selling 36761 Explosives and this represents a High stock for them. For Hydrogen Fuels, they are looking to buy 1010789 items which represents a Medium demand for this fuel.

At the end of your play session you should take your TradeDangerous.prices file and upload it back to maddavo's site for the greater good of the collective.
 
And on a separate note, it looks to me like TD is insisting on planning routes hoping that the stock for a particular item would have magically increased.
I can't count how many times I've been sent for 40 Bertrandite in my Cobra only to find 1 in stock.
At the moment I'm manually fixing this, when I suspect a fools' errand, by updating the station in cause with the current timestamp then execute the run command to get a different route.

I would suggest that you're not sent to a station which doesn't stock at least the ammount that you're supposed to buy.
Or maybe increase the threshold for the time frame that would represent stale data for a station.
OR maybe identify certain items as rare?
 
Last edited:
Just pushed a change that won't assume any growth of stock units if the item is marked as "L" or "?". If the item is "M" it will assume production of 1 unit per 15 minutes, items marked "H" it assumes 2 units per 10 minutes. I'll add an option to disable this entirely, later.

Previously: It just assumed an increase of 1 unit per minute.
 

ShadowGar

Banned
I've noticed that station names have been changed. How many stations were affected is unknown. So far I have found 10 stations with different names. I would assume that more have been changed also.
 
I've created a beta 3 branch to help me incorporate changes to item, category, station etc names. This also includes a touch-up of the .prices file: I now use '?' for unknown and '-' for 'n/a', as well as using the buy/sell prices to prompt sensible defaults for the demand/stock values to better match the in-game ui.
 

wolverine2710

Tutorial & Guide Writer
kfsone. I was trying to get the trade dangerous.prices file from your wiki (https://bitbucket.org/kfsone/tradedangerous/wiki/Price Data). I get the error: You do not have access to the wiki. I DO have an account at bitbucket and have posted in the issues there. Perhaps an authorisation issue with the wiki? That said, on the left side in bitbucket for your repo I don't see a wiki icon either?

Can someone perhaps provide me with a trade dangerous.prices file? Would be appreciated.
 

wolverine2710

Tutorial & Guide Writer

Thanks for the info. Unfortunately I'm getting an error:
System: "ACIHAUT", Station: "Cuffey Plant".

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/td/processdata.asp, line 137

Actions performed. Upgraded to TD 4.70. Copied last SB1 .prices file I had to data dir. Uploaded, got the error, deleted .prices table, ran TD. Uploaded what I believe is a new .prices file (virgin) and uploaded again. Same error ;-( I must be something wrong....
 

wolverine2710

Tutorial & Guide Writer
Michael Brookes supplied the crowd source project with a list of 755 star systems. You can find it here. Its being analyzed. Also cmdr Chromatix wrote there: "That looks suspiciously like we now have galaxy-centred coordinates, rather than Sol-centred". Head over the crowd source thread for details.
 
@maddavo

I've just pushed my Beta 3 changes to the main branch so we can start supporting Beta 3 properly. I tried your System.csv but there were some systems missing (e.g. 14 Herculis), which left stations stranded.
 

wolverine2710

Tutorial & Guide Writer
@maddavo I've just pushed my Beta 3 changes to the main branch so we can start supporting Beta 3 properly. I tried your System.csv but there were some systems missing (e.g. 14 Herculis), which left stations stranded.
With SB3 they changed/tweaked the procedurally generated (PG) mechanism. It will happen again with Gamma - mentioned by Michael Brookes. Some SB2 systems are no longer in the pill. Some systems don't have a station/platform any longer. It has been discussed in the crowd source project thread. See post #1006. The partial list supplied by Michael Brookes is a list of systems that have economies. Which I interpret as having a station/platform. 14 Herculis is NOT on that list. From what you write it seems it HAD an economy in the past. This can have happened with more stations. Hope the mentioned thread/post help also a bit further.
 
Last edited:

wolverine2710

Tutorial & Guide Writer
Is this program still basically a route planner or has someone setup a system where we can enter commodities and prices?

The OP describes the functionality of TD quite well actually. You can manually input prices with the update command.
$ python trade.py --help
usage: trade.py [-h] [--debug] [--detail] [--quiet] [--db DB] [--cwd CWD]
{buy,nav,local,run,update} ...

Trade run calculator

Common Switches:
-h, --help Show this help message and exit.
--debug, -w Enable diagnostic output.
--detail, -v Increase level of detail in output.
--quiet, -q Reduce level of detail in output.
--db DB Specify location of the SQLite database. Default:
./data/TradeDangerous.db
--cwd CWD, -C CWD Change the directory relative to which TradeDangerous
will try to access files such as the .db, etc.

Commands:
{buy,nav,local,run,update}
buy Find places to buy a given item within range of a
given station.
nav Calculate a route between two systems.
local Calculate local systems.
run Calculate best trade run.
update Update prices for a station.

For help on a specific command, use the command followed by -h.

$ python trade.py update --help
usage: trade.py update [-h] [--editor EDITOR] [--all] [--zero] [--supply]
[--timestamps] [--force-na]
[--sublime | --notepad | --npp | --vim]
station

Required Arguments:
station Name of the station to update.

Optional Switches:
-h, --help Show this help message and exit.
--editor EDITOR Generates a text file containing the prices for the
station and loads it into the specified editor.
--all DEPRECATED - See --supply and --timestamps instead.
--zero DEPRECATED - See --force-na instead.
--supply, -S Includes demand and stock (supply) values in the update.
--timestamps, -T Includes timestamps in the update.
--force-na, -0 Forces 'unk' supply to become 'n/a' by default
--sublime Like --editor but uses Sublime Text (2 or 3), which is
nice.
--notepad Like --editor but uses Notepad.
--npp Like --editor but uses Notepad++.
--vim Like --editor but uses vim.

Generates a human-readable version of the price list for a given station and
opens it in the specified text editor. The format is intended to closely
resemble the presentation of the market in-game. If you change the order items
are listed in, the order will be kept for future edits, making it easier to
quickly check for changes.
TD basically is an engine which can be called from a GUI. I think 2-3 cmdrs are/were looking into this.
 
Yes.. the op does describe the functionality well.

I will rephrase my question..

Of course previously, the data was scraped.
Sloopy's new version has all the traders using the program.. manually entering in prices and sharing with a central database.

I am unsure if the data entered in manually to TD is shared in this way.. ??

Personally I do not have anywhere near the time to trade enough that entering in my Own data/prices would help me at all..
If the data is shared.. it would be useful.
 
Back
Top Bottom