In-Development TradeDangerous: power-user trade optimizer

Hi !!

I have a quick question, please.
Does the "trade.py export" command export the CSV files to Maddavo's database ?

By the way, I am also trying to upload my shipvendor.csv through Maddavo's website but it is not working.

No. The export command just exports the specified table data in your local DB to csv files. Eg to export your Station table into a Station.csv, use:
Code:
trade export --table Station
But the import plugin can be set to automatically export the csvs after you do an import by specifying the "exportcsv" parameter - I usually use this command:
Code:
trade import -P maddavo -O corrections,stations,shipvendors,exportcsv

To upload files, use the following:
Code:
python -m misc.madupload data/Station.csv
(or whatever other file you want to upload data/ShipVendor.csv or updated.prices etc.)

If you want to make a shortcut batch file, then try this:
Code:
echo python -m misc.madupload data/ShipVendor.csv > upships.bat

Then whenever you want to upload your shipvendor file you just type:
Code:
upships

In this way I have made shortcut commands "madimport", "upships", "upstations", "upprices".
 
Just when I thought the profits couldn't get any bigger...

BigTrade.jpg
 
No. The export command just exports the specified table data in your local DB to csv files. Eg to export your Station table into a Station.csv, use:
Code:
trade export --table Station
But the import plugin can be set to automatically export the csvs after you do an import by specifying the "exportcsv" parameter - I usually use this command:
Code:
trade import -P maddavo -O corrections,stations,shipvendors,exportcsv

"tdimad -O csvs" will do the above plus systems. I've been landing a slow trickle of core systems (I'm using edscupdate.py --ref with sol, lave, waruts, new yembo and shinrarta and grinding that until I have good overlap, but that's stalled because FD haven't fixed the search bug for generated, position-based system names)
 
Is there a way to choose large landing pads only?


EDIT: Nvm, i found it. thanks for making this, its really useful :)
 
Last edited:
Sorry a little bit offtopic.
@maddavo: Have you done that to the EDSC?
maddavo.JPG

Funny! (for those who can't see it, there is clearly written Maddavo topdown)
 
Hi everyone,
I´m pretty new to ED and wanted to give TD a try. Everytime I run the trade.py I just get the description of the available commands and the info abbout additional help. Something obvious I´m missing?
THX in advance,
Schmauch
 
Im unable to get trade.py to run.

every time i try to type a command through SourceTree's cmdprompt all i get is below.

Can anyone help me figure out what im doing wrong?
Capture.PNG
 

wolverine2710

Tutorial & Guide Writer
Hi everyone,
I´m pretty new to ED and wanted to give TD a try. Everytime I run the trade.py I just get the description of the available commands and the info abbout additional help. Something obvious I´m missing?
THX in advance,
Schmauch

From the OP:
USAGE:

For more setup instructions, user guides, etc, please see our wiki: http://kfs.org/td/wiki

Have you tried the commands in the wiki? Do you then also get the behavior you describe?
As you are new to TD perhaps the following is of interest to you: TDHelper the TradeDangerous GUI front end
 
Last edited:
I read the wiki and followed the instructions. No errors and the section "see if it works" behaves nice. But every command results in the general usage description from just running trade.py. I´ve installed TDHelper and encountered some missing database errors. Perhaps I´m blind but there has gat to something I´ve missed as the forum thread here is pointedly empty of similar situations...
 
has Rares --legal been removed or is it a bug? --illegal still works
Code:
C:\Program Files Games\Frontier\TradeDangerous\repository>trade.py rares --ly=120 --legal "WOLF 229"
C:\Program Files Games\Frontier\TradeDangerous\repository\trade.py: ERROR: No items found.
 
Im unable to get trade.py to run.

every time i try to type a command through SourceTree's cmdprompt all i get is below.

Can anyone help me figure out what im doing wrong?
View attachment 46681

According to the above, "Python" is not in your path. What does "echo $PATH" report?

Later on you indicate that when you try to run trade.py from elsewhere it complains about command line usage repeatedly, this seems to happen for some Python installs but I don't have enough data to determine why. See this post: https://forums.frontier.co.uk/showthread.php?t=34986&p=2121686&viewfull=1#post2121686
 
Ok, with TDHelper I got it to work, requests package was missing and some initial data had to be downloaded. Commandline still does not work. THX for your replies. Now I will give it a try ;)
 
I've just merged in a couple of neat Pull Requests. The "fromfile" change may be confusing to some, so any help clarifying it in the README and on the Wiki would be appreciated.

Code:
v7.3.0 Jul 05 2015:
. (ahamid/kfsone) "fromfile" support for command options:
 - All commands will now look for a "fromfile" specifying default arguments
   for that command .tdrc_{cmd} e.g .tdrc_nav or .tdrc_shipvendor,
 - One argument-position per line, "--ly 20" is two lines but "--ly=20" is one,
 - The fromfile argument is replaced with the arguments in the file,
 - Looks in the current directory and then your user directory,
 - You can also use your own fromfile as an argument prefixed with a '+':
     trade.py nav +myfrom.txt
. (Fred Deschenes) "buy" now supports categories e.g.
     trade.py buy --near sol metals,food
 - to find food cartridges, use foodc or "food cartridges",

Fromfiles and rc files:

Specifying a fromfile:

Code:
    trade.py command ... +filename ...

e.g.

Code:
    trade.py nav +sidewinder.args --from sol
    trade.py nav +sidewinder.args --from sol +myargs

A "fromfile" is just a text file with one switch/argument per line, and the "+filename" gets replaced with the list of options from in the file.

Additionally, each command will now look for a file called ".tdrc_<commandname>" e.g. ".tdrc_shipvendor" or ".tdrc_run"; if it finds it, it will add the options from the file immediately after the command.

So: if you create ".tdrc_run" with the following:

Code:
    -vvv
    --progress
    --summary
    --ly
    20
    --empty-ly=30
    --cap
    200
    --hops=1
    --jumps=2
    --avoid
    Imperial Slaves

NOTE: "--ly 20" becomes two lines whereas "--ly=20" would become one.

and then type:

Code:
    trade.py run --from sol --cr 10k

It will be as though you typed:

Code:
    trade.py run -vvv --progress --summary --ly 20 --empty-ly=30 --cap 200 --hops=1 --jumps=2 --avoid "Imperial Slaves" --from sol --cr 10k

Thanks to ahamid for the original version of this code.
 
Seems to not be working for me

Traceback (most recent call last): File "F:\Game Stuff\TradeDangerous\trade.py", line 38, in <module>
from commands import *
File "F:\Game Stuff\TradeDangerous\commands\__init__.py", line 2, in <module>
from commands.commandenv import CommandEnv
File "F:\Game Stuff\TradeDangerous\commands\commandenv.py", line 4, in <module
>
from tradedb import AmbiguityError, System, Station
File "F:\Game Stuff\TradeDangerous\tradedb.py", line 744
yield from self.systemByID.values()
^
SyntaxError: invalid syntax

EDIT: My bad. I have 2.7 and 3.4 and accidentally used 2.7's python.exe.
 
Last edited:
The 3h file dated 6/07/2015 4:52:03 PM is giving the following error

Code:
Traceback (most recent call last):[======              ]  28.8KB [ 28.2MB/s]  32% 
  File "P:\Program Files (x86)\td\trade.py", line 104, in <module>
[==============      ]  65.5KB [ 32.0MB/s]  74% 
    main(sys.argv)
[====================]  88.9KB [ 32.5MB/s] 112% 
  File "P:\Program Files (x86)\td\trade.py", line 77, in main
                                                 
    results = cmdenv.run(tdb)
  File "P:\Program Files (x86)\td\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "P:\Program Files (x86)\td\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 719, in run
    self.import_prices()
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 581, in import_prices
    self.download_prices(lastRunDays)
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 564, in download_prices
    shebang=lambda line: self.check_shebang(line, True),
  File "P:\Program Files (x86)\td\transfers.py", line 187, in download
    makeUnit(fetched / (time.time() - started))
ZeroDivisionError: float division by zero
 
The 3h file dated 6/07/2015 4:52:03 PM is giving the following error

Code:
Traceback (most recent call last):[======              ]  28.8KB [ 28.2MB/s]  32% 
  File "P:\Program Files (x86)\td\trade.py", line 104, in <module>
[==============      ]  65.5KB [ 32.0MB/s]  74% 
    main(sys.argv)
[====================]  88.9KB [ 32.5MB/s] 112% 
  File "P:\Program Files (x86)\td\trade.py", line 77, in main
                                                 
    results = cmdenv.run(tdb)
  File "P:\Program Files (x86)\td\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "P:\Program Files (x86)\td\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 719, in run
    self.import_prices()
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 581, in import_prices
    self.download_prices(lastRunDays)
  File "P:\Program Files (x86)\td\plugins\maddavo_plug.py", line 564, in download_prices
    shebang=lambda line: self.check_shebang(line, True),
  File "P:\Program Files (x86)\td\transfers.py", line 187, in download
    makeUnit(fetched / (time.time() - started))
ZeroDivisionError: float division by zero

Fixed in latest code.
 
Back
Top Bottom