In-Development TradeDangerous: power-user trade optimizer

If you are using Maddavo's with -O csvs and you were getting an error, grab latest code - added a check for bad modified timestamps that should prevent the current problem breaking your import.
 
Can you copy & paste what you're doing (press alt+space if you're in windows to get the command window) or take a screenshot?

If you have Python installed "for all users" then you should be able to type:

Code:
[I]C:\...> [/I] [B]trade.py[/B]

and get something other than "command not found" :) If that's the case, you should next be able to type

Code:
[I]C:\...> [/I] [B]trade.py local sol --ly 6 -vv[/B]

and get some info about systems near sol.

You probably then want to import some data, and if you're ok with using "maddavo"s crowd-sourced data (http://www.davek.com.au/td/) you can do that by typing:

Code:
tdimad -O csvs

there are also some "helper" batch files in the "scripts" directories. For more on those, see the wiki or the scripts/README.txt file (just open it in notepad or something).

-Oliver

- - - Updated - - -

Just landed a new update with ~300 new systems and "--shorten" argument to "run" command.

--shorten requires "--to"; it does the same thing that "--to" does, but it will allow routes that reach the destination in less than --hops jumps to be considered and at the end of the route calculations it will compare routes based on their average Gain Per Ton (gpt).

This will get stuck on loops if there's a really good loop between you and your destination (I just had this happen on the way to Shinrarta, someone had input a really bad price for Gold that produced >3000cr/ton profits, I shoulda used --max-gpt, duh).

-Oliver

here is what im doing:

C:\Users\User\Documents\trade>cd ""
C:\Users\User\Documents\trade

C:\Users\User\Documents\trade>call cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\User\Documents\trade>python --version
Python 3.4.3

C:\Users\User\Documents\trade>trade.py
C:\Users\User\Documents\trade\trade.py: TradeDangerous provides a set o
f trade database facilities for Elite:Dangerous.

Usage: C:\Users\User\Documents\trade\trade.py <command>

Where <command> is one of:

buildcache Build TradeDangerous cache file from sources
buy Find places to buy a given item within range of a given
station.
export CSV exporter for TradeDangerous database.
import TD data import system. On its own, this command lets you
merge station prices from a '.prices' file (entries in the
file that are older than your local data are not loaded).
local Calculate local systems.
market Lists items bought/sold at a given station.
nav Calculate a route between two systems.
olddata Show oldest data in database.
rares Find rares near your current local.
run Calculate best trade run.
sell Find places to sell a given item within range of a given
station.
shipvendor List, add or update available ships to a station
station Add (or update) a station entry
trade Find places to buy a given item within range of a given
station.
update Update prices for a station.

For additional help on a specific command, such as 'update' use
C:\Users\User\Documents\trade\trade.py update -h

C:\Users\User\Documents\trade>trade.py local sol --ly 6 -vv
C:\Users\User\Documents\trade\trade.py: TradeDangerous provides a set o
f trade database facilities for Elite:Dangerous.

Usage: C:\Users\User\Documents\trade\trade.py <command>

Where <command> is one of:

buildcache Build TradeDangerous cache file from sources
buy Find places to buy a given item within range of a given
station.
export CSV exporter for TradeDangerous database.
import TD data import system. On its own, this command lets you
merge station prices from a '.prices' file (entries in the
file that are older than your local data are not loaded).
local Calculate local systems.
market Lists items bought/sold at a given station.
nav Calculate a route between two systems.
olddata Show oldest data in database.
rares Find rares near your current local.
run Calculate best trade run.
sell Find places to sell a given item within range of a given
station.
shipvendor List, add or update available ships to a station
station Add (or update) a station entry
trade Find places to buy a given item within range of a given
station.
update Update prices for a station.

For additional help on a specific command, such as 'update' use
C:\Users\User\Documents\trade\trade.py update -h

C:\Users\User\Documents\trade>



see i type in the command but i just get the main help screen again. :(
 
Have you tried:
Code:
python trade.py local sol --ly 6 -vv
as command?

/edit1: Ah, found it: Switch of the "Quick Edit-Modus" for the command window.
/edit2: Nope, can't reproduce it anymore, sorry.
 
Last edited:
here is what im doing:

C:\Users\User\Documents\trade>cd ""
C:\Users\User\Documents\trade

C:\Users\User\Documents\trade>call cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

It sounds like Windows / Command are confused about how to launch a .py file; basically the arguments aren't getting passed to the Python executable in a fashion it understands. You can either uninstall/reinstall Python and see if that helps (low probability), or use "python trade.py" as your launch, or make yourself a shortcut by going into the trade directory and typing:

Code:
echo python trade.py %* >td.bat

You should now be able to use "td" instead of typing "trade.py":

Code:
[i]c:\blah\>[/i] td local sol --ly 5 -vv
...
[i]c:\blah\>[/i] td help
 
Hi. I updated TD to the latest version on saturday and it worked to use the new --loop-int option but after running once all I get is :

Code:
D:\TradeDangerous2>trade.py


D:\TradeDangerous2>

It wont do anything.. any ideas?
 
Hi. I updated TD to the latest version on saturday and it worked to use the new --loop-int option but after running once all I get is :

Code:
D:\TradeDangerous2>trade.py


D:\TradeDangerous2>

It wont do anything.. any ideas?

Have you tried reading the post immediately before yours?
 
Thank you, Oliver and Maddavo

As a relatively new elite pilot, but someone who took graph theory in college (a couple of decades ago) I wanted to thank you, Oliver, for writing (and updating) this tool, and Maddavo, for making it so easy to both populate the needed data for our personal use and give back to the crowd by submitting updates.
 
Error updating data

Last night I received the following error and have been unable to update since then.

$ trade.py import -P maddavo -O csvs,csvonlyNOTE: Importing Corrections
NOTE: Importing Systems
PADHYAS position change: -31.625v-1.625, -15.9375v-12.6875, -25.40625v-85.40625
Traceback (most recent call last):
File "./trade.py", line 102, in <module>
main(sys.argv)
File "./trade.py", line 76, in main
results = cmdenv.run(tdb)
File "c:\Users\dan\Source\TradeDangerous\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "c:\Users\dan\Source\TradeDangerous\commands\import_cmd.py", line 111, in run
if not plugin.run():
File "c:\Users\dan\Source\TradeDangerous\plugins\maddavo_plug.py", line 708, in run
self.import_systems()
File "c:\Users\dan\Source\TradeDangerous\plugins\maddavo_plug.py", line 311, in import_systems
commit=False,
File "c:\Users\dan\Source\TradeDangerous\tradedb.py", line 807, in updateLocalSystem
dbname, x, y, z, added, modified
sqlite3.IntegrityError: UNIQUE constraint failed: System.name

I tried a trade.py build -f and that didn't help, nor did deleting the PADHYAS record from the system table. Any more options?
 
Last night I received the following error and have been unable to update since then.
...
I tried a trade.py build -f and that didn't help, nor did deleting the PADHYAS record from the system table. Any more options?

I got the same problem. I had to remove all entries for "PADHYAS" in the System, Station and prices file, then rebuild the cache. Then the import worked after that.
 
Looks like a bug. There is a WHERE clause missing for the UPDATE. Be happy it crashed, otherwise all systems would have been named "PADHYAS". :)
 
Big profit...
3013cr/ton IS possible!!!

Profit Pic.jpg
 
Last edited:
Just explored about 40 unknown systems with economy, thought that there will be many star port large stations to be added into Maddavo's station.csv

Well I was wrong. In all those systems I didn't find any large stations, they were all outposts.

Could it be that all unknown / undiscovered systems are outposts only and those "pre-discovered" ones are with large stations (as well as outposts), maybe developers game design was that large station somehow broadcasts itself to the rest of the systems or something similar.

Have you guys seen this in wider scale or am I just making false assumptions with researching "only 40" systems so far?
 
Well I was wrong. In all those systems I didn't find any large stations, they were all outposts.

Could it be that all unknown / undiscovered systems are outposts only and those "pre-discovered" ones are with large stations (as well as outposts), maybe developers game design was that large station somehow broadcasts itself to the rest of the systems or something similar.

Have you guys seen this in wider scale or am I just making false assumptions with researching "only 40" systems so far?

Nope, I'm in Korro Kung and there is one outpost and one Ocellus station. I'm pretty sure it's not the first unknown system I'm in which does have different station types.
 
Last edited:
Hi all,

I am using this tool for the first time today by typing the following command:
trade.py import --plug=maddavo --option=csvs

Everything works fine, all downloads occur, but then I get 786,255 lines of WARNING Unrecognized item name:

Needless to say that I do not know what could be wrong, if anyone could enlighten me it would be very much appreciated.

I then run a simple run command I get this
c:\Trade>trade.py run -v --credits 1000 --capacity 4 --ly-per 6.96 --jumps 5 --hops 2
NOTE: Import complete: 0 items (0 buy, 0 sell) for 0 stations in 0 systems
C:\Trade\trade.py: Error: There is no trading data for ANY station in the local database. Please enter or import price data.

I have added a 70 second video on youtube showing the problem taking place. You can view it here

EDIT: I downloaded the .prices file manually and added it, and now I get his:
c:\Trade>trade.py run -v --credits 1000 --capacity 4 --ly-per 6.96 --jumps 5 --hops 2
C:\Trade\trade.py: C:\Trade\data\TradeDangerous.prices:10 ERROR Unrecognized item name: "EXPLOSIVES"

So basically I need to import the items, but I have no idea as to how to do this

Regards
Crouz
 
Last edited:
I don't know why but you seem to be missing the Item.csv (and maybe the Category.csv) files.

Download these two files from http://www.davek.com.au/td/ put them into the "data" directory and rebuild the cache (trade.py buildcache -fi). Then try again to import the prices from maddavo.
 
Back
Top Bottom