In-Development TradeDangerous: power-user trade optimizer

When you say

"I want to go from somewhere in the a couple of jumps of sol to somewhere in the vicinity of lave"

Do you mean

trade.py run ... --from sol --start-jumps 2 --to lave --end-jumps 5 ...
 
When you say

"I want to go from somewhere in the a couple of jumps of sol to somewhere in the vicinity of lave"

Do you mean

trade.py run ... --from sol --start-jumps 2 --to lave --end-jumps 5 ...

No, I mean't "within a couple of jumps of sol" to "somewhere in the vicinity of lave".

"--from sol --start-jumps 2" => within a couple of jumps of sol
"--to lave --end-jumps 5" => the vicinity of lave

[nth edit: I have some serious edit fail going on today, I'm just gonna go fly :)]
 
Last edited:
@kfsone

your new parameters broke the normal from - to - route for me, if i want to go from a specific station to another specific station. e.g. for some bulletin board missions and take the most usefull commodities to fill up my cargo room with me.

Code:
trade run --cap 4 --ly 18.50 -vvv --cr 3000000 --fr 78ursae/roming --to hebo/krylo
Traceback (most recent call last):
  File "C:\Users\BD\Documents\tradedangerous\trade.py", line 97, in <module>
    main(sys.argv)
  File "C:\Users\BD\Documents\tradedangerous\trade.py", line 71, in main
    results = cmdenv.run(tdb)
  File "C:\Users\BD\Documents\tradedangerous\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "C:\Users\BD\Documents\tradedangerous\commands\run_cmd.py", line 596, in run
    validateRunArguments(tdb, cmdenv)
  File "C:\Users\BD\Documents\tradedangerous\commands\run_cmd.py", line 432, in validateRunArguments

    checkStationSuitability(cmdenv, cmdenv.destPlace, '--to')
NameError: name 'checkStationSuitability' is not defined
 
Guys can either one of you delete the HILL PA HSI/Reilly Terminal; Personal Weapons

I have zeroed it and uploaded to maddavo at least three times now and it just keeps coming back after every update.
 
@kfsone

your new parameters broke the normal from - to - route for me, if i want to go from a specific station to another specific station. e.g. for some bulletin board missions and take the most usefull commodities to fill up my cargo room with me.

Code:
trade run --cap 4 --ly 18.50 -vvv --cr 3000000 --fr 78ursae/roming --to hebo/krylo
Traceback (most recent call last):
  File "C:\Users\BD\Documents\tradedangerous\trade.py", line 97, in <module>
    main(sys.argv)
  File "C:\Users\BD\Documents\tradedangerous\trade.py", line 71, in main
    results = cmdenv.run(tdb)
  File "C:\Users\BD\Documents\tradedangerous\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "C:\Users\BD\Documents\tradedangerous\commands\run_cmd.py", line 596, in run
    validateRunArguments(tdb, cmdenv)
  File "C:\Users\BD\Documents\tradedangerous\commands\run_cmd.py", line 432, in validateRunArguments

    checkStationSuitability(cmdenv, cmdenv.destPlace, '--to')
NameError: name 'checkStationSuitability' is not defined

Should be fixed.

- - - - - Additional Content Posted / Auto Merge - - - - -

Guys can either one of you delete the HILL PA HSI/Reilly Terminal; Personal Weapons

I have zeroed it and uploaded to maddavo at least three times now and it just keeps coming back after every update.

I just pulled from Maddavos, I don't see Personal Weapons listed at that station:

Code:
@ HILL PA HSI/Reilly Terminal
   + Chemicals
      Explosives                  206     223          ?    17916M  2015-01-09 09:41:13
...
   + Waste
      Biowaste                     15      20          ?     9805M  2015-01-09 09:41:13
      Chemical Waste              107       0          ?         -  2015-01-09 09:41:13
      Scrap                        70       0          ?         -  2015-01-09 09:41:13
   + Weapons
      Non-Lethal Weapons         1606    1661          ?     1579M  2015-01-09 09:41:13
      Reactive Armour            1878    1920          ?     1444M  2015-01-09 09:41:13
 
Besides, I can't find what I count as a half-decent, cross-platform, UI tool for Python 3. I'm half tempted to rewrite TD in either C# or Go. Then again, I may just rewrite the core in C++ as a service with a Thrift API to let your-choice-of-interface query it.

Wouldn't C++ make the most sense performance and portability wise?

I mean, we would probably have to compile that thingy daily.
 
I just pulled from Maddavos, I don't see Personal Weapons listed at that station:
He probably fixed them after my post, or something else happened. For sure I submitted my zeroed .prices file there several times and it just kept bouncing back. Anyways fixed now, all good.
 
It there any way set default values or tell it to use settings from a file?

For example, I want to avoid all destinations requiring a permit. Instead of using the --avoid and list all systems I know of it would be nice if I can just do it once and then remove a system if I get the permit.
Would also be nice to not have to supply --jumps-per and --capacity every time, but that I can live with :)

Othewise, great program. I'm getting to like it more and more.
 
It there any way set default values or tell it to use settings from a file?

For example, I want to avoid all destinations requiring a permit. Instead of using the --avoid and list all systems I know of it would be nice if I can just do it once and then remove a system if I get the permit.
Would also be nice to not have to supply --jumps-per and --capacity every time, but that I can live with :)

Othewise, great program. I'm getting to like it more and more.

I save my commands to a text file, and use copy/paste from notepad personally
 
Wouldn't C++ make the most sense performance and portability wise?

I mean, we would probably have to compile that thingy daily.

Performance wise, yes, but you'd probably still want a front end. So what I may wind up doing is writing a C++ back-end service and simply implementing the CLI tools in Python or something as a sample client. That way it would be possible to write a GUI client in, say, C# or Mono.

- - - - - Additional Content Posted / Auto Merge - - - - -

It there any way set default values or tell it to use settings from a file?

For example, I want to avoid all destinations requiring a permit. Instead of using the --avoid and list all systems I know of it would be nice if I can just do it once and then remove a system if I get the permit.
Would also be nice to not have to supply --jumps-per and --capacity every time, but that I can live with :)

Othewise, great program. I'm getting to like it more and more.

The .ini work got pushed back. At the moment the closest thing is the scripts directory, which lets you use a bunch of short cuts. For example (the first line is the one I typed, the second one is one that the script outputs so you know what command it actually ran)

Code:
[color=gold]$ tdrun miletusstation --to nandjalato -e 2 --max 2.5[/color]
$ /c/dev/trade/trade.py run -vv --ly 16.11 --empty 23.69 --cap 96 --jumps 6 --cr 1615418 --from "miletusstation" --to nandjalato -e 2 --max 2.5
LU VELORUM/Miletus Station -> LUGH/Read Gateway (score: 264147.035520)
  Load from LU VELORUM/Miletus Station (8ls/star, Unk/bm, Lrg/pad):
       96 x Progenitor Cells      6,143cr each,    589,728cr total,  data from 35hrs vs 34hrs
  Jump LU VELORUM -> LHS 40 -> CORE SYS SECTOR DL-Y D116 -> CORE SYS SECTOR ON-T B3-7 -> LHS 6031 -> PARUTIS
  Unload at PARUTIS/Parmitano Station (1,507ls/star, Unk/bm, Lrg/pad) => Gain 131,232cr (1,367cr/ton) => 1,746,650cr
  Load from PARUTIS/Parmitano Station (1,507ls/star, Unk/bm, Lrg/pad):
       96 x Gold                  8,921cr each,    856,416cr total,  data from 34hrs vs 32hrs
  Jump PARUTIS -> LHS 6031 -> CORE SYS SECTOR ON-T B3-7 -> HILL PA HSI -> LUGH
  Unload at LUGH/Read Gateway (313ls/star, No/bm, Med/pad) => Gain 133,056cr (1,386cr/ton) => 1,879,706cr
  ----------------------------------------------------------------------------
  Finish at LUGH/Read Gateway (313ls/star, No/bm, Med/pad) gaining 264,288cr => est 1,879,706cr total

See the scripts/README.txt for setup instructions.
 

wolverine2710

Tutorial & Guide Writer
EDDN is taking of and its data is being used by quite a few commanders which build tools for it. BUT we need more data. Atm it primarily comes from OCR tools like EliteOCR and RegualtedNoise which upload to EDDN. It would be great if there were tools/plugins for TD which uploads (the latest prices) to EDDN. Afaik kfsone is working on optimizing the internals of TD so EDDN support will probably be a low priority for him. Perhaps a commander here is willing to create an EDDN upload program... There is an experimental JSON exporter for the prices. Its TD/<dir>/misc/prices-json-exp.py. Perhaps that one could be used to make uploading easier. Uploading is a matter of a POST with a JSON structure in it to EDDN.

Wrt TD using the EDDN data. It looks as if in the near future we will have one or more validator services for EDDN which cleans up the data. Its being discussed in the EDDN thread, poist #325. Hence there will an EDDN publisher which will provide clean data. I'm hoping that at point (preferably earlier) the old existing emdn-tap.py tool will be revived. That way TD (as long as you run EDDN-tap.py) will always be up to date ;-)
 
Last edited:
6.6.1 is unhappy, or Maddavo's data is unhappy. One of the two:

Code:
D:\Gadgets\TradeDangerous>trade.py import --plug=maddavo --opt stncsv --opt syscsv
Connecting to server: http://www.davek.com.au/td/System.csv
data/System.csv: 1,455,789/1,455,789 bytes |  32.97KB/s | 100.00%
Connecting to server: http://www.davek.com.au/td/station.asp
data/Station.csv: 162,038/162,038 bytes |  56.09KB/s | 100.00%
NOTE: Stale/missing local copy, downloading full .prices file.
Connecting to server: http://www.davek.com.au/td/prices.asp
import.prices: 8,409,430/8,409,430 bytes |  78.51KB/s | 100.00%
NOTE: Rebuilding cache file: this may take a moment.
*** INTERNAL ERROR: NOT NULL constraint failed: ShipVendor.station_id
CSV File: D:\Gadgets\TradeDangerous\data\ShipVendor.csv:190
SQL Query: INSERT INTO ShipVendor (station_id,ship_id) VALUES((SELECT Station.station_id FROM Station INNER JOIN System
USING(system_id) WHERE System.name = ? AND Station.name = ?),(SELECT Ship.ship_id FROM Ship WHERE Ship.name = ?))
Params: ['HR 5451', 'Fraser Station', 'Asp Explorer']

Upd: Tested with 6.5.0 - Complained about some missing stations, but didn't bomb on the SQL like that.
 
Last edited:
6.6.1 is unhappy, or Maddavo's data is unhappy. One of the two:

Code:
D:\Gadgets\TradeDangerous>trade.py import --plug=maddavo --opt stncsv --opt syscsv
Connecting to server: http://www.davek.com.au/td/System.csv
data/System.csv: 1,455,789/1,455,789 bytes |  32.97KB/s | 100.00%
Connecting to server: http://www.davek.com.au/td/station.asp
data/Station.csv: 162,038/162,038 bytes |  56.09KB/s | 100.00%
NOTE: Stale/missing local copy, downloading full .prices file.
Connecting to server: http://www.davek.com.au/td/prices.asp
import.prices: 8,409,430/8,409,430 bytes |  78.51KB/s | 100.00%
NOTE: Rebuilding cache file: this may take a moment.
*** INTERNAL ERROR: NOT NULL constraint failed: ShipVendor.station_id
CSV File: D:\Gadgets\TradeDangerous\data\ShipVendor.csv:190
SQL Query: INSERT INTO ShipVendor (station_id,ship_id) VALUES((SELECT Station.station_id FROM Station INNER JOIN System
USING(system_id) WHERE System.name = ? AND Station.name = ?),(SELECT Ship.ship_id FROM Ship WHERE Ship.name = ?))
Params: ['HR 5451', 'Fraser Station', 'Asp Explorer']

Upd: Tested with 6.5.0 - Complained about some missing stations, but didn't bomb on the SQL like that.

kfsone's station.csv had two stations that were not present in maddavo's stations.csv file. That seems to be fixed now. I'm just getting errors trying to download the large prices file.
 
kfsone's station.csv had two stations that were not present in maddavo's stations.csv file. That seems to be fixed now. I'm just getting errors trying to download the large prices file.

Usually it's the other way around and missing stations in kfsone's cause (non-critical) errors due to missing stations - hence I always download.

I'm not seeing any problems with the downloads though. Give your Internet a kick maybe?
 
EDDN is taking of and its data is being used by quite a few commanders which build tools for it. BUT we need more data. Atm it primarily comes from OCR tools like EliteOCR and RegualtedNoise which upload to EDDN. It would be great if there were tools/plugins for TD which uploads (the latest prices) to EDDN. Afaik kfsone is working on optimizing the internals of TD so EDDN support will probably be a low priority for him. Perhaps a commander here is willing to create an EDDN upload program... There is an experimental JSON exporter for the prices. Its TD/<dir>/misc/prices-json-exp.py. Perhaps that one could be used to make uploading easier. Uploading is a matter of a POST with a JSON structure in it to EDDN.
TradeDangerous has like 0.1% data that EDDN has. The greatest downside of it is lack of data. Just relax, if they plug TradeDangerous data into EDDN you wont even notice it :)
 
TradeDangerous has like 0.1% data that EDDN has. The greatest downside of it is lack of data. Just relax, if they plug TradeDangerous data into EDDN you wont even notice it :)

What it lacks in size it makes up for in accuracy. The big trade databases are full of crud atm.
 
Hello there,

I unfortunately have to divide my posts up as I have not had much to say on these forums so my account is brand new and needs at least 2 posts for me to fully share my tricks with you.

So Stay tuned follow down a couple more posts and it'll be there I hope otherwise i'll have to find someone else to post this for me :)

BruteMan
 
Last edited:
Well I have done everything the forums said i needed to do to register and make posts but it keeps thinking i have hyperlinks in this paste.. here goes try #5 at this post.

Anyway been enjoying the program allot and it reminds me of the throwback days to MSdos and allot of command line work and with that came a education for me in batch files so without further ado here I present to you a basic batch file that will generate some basic trade routes. It doesn't use all the advanced features like the x52 or the avoid or via commands. It will generate a route based on your answers to the questions it asks into a text document you can then open and read without squinting at that bad word wrapped command window. note its generating the most detailed reports as i didn't see a need to multi-variable the verbose details.

Feel free to use it trash it modify it or use it to mop up your canteen with all i ask is if you make any great breakthroughs and improvements you reshare this here with the rest of us to benefit from.

Here is the batch file just create a text document in your EDTD folder where you have your trade.py sitting and rename it to "(yourchoiceofname).bat"

Then take the code below and paste it into that file using any text editor I use Notepad ++ but anything will work.

Code:
@echo off
CLS
Echo Trade Dangerous Batch script Ver 1.0 by Bruteman.
Echo Please note all questions must be answered in lower case no CAPS LOCK please!
Echo This Script outputs your run to a text document you can easily open and view.
Echo.
Echo -------Warning------- 
Echo.
Echo This script will overwrite any output file named the same.
Echo I.E. if you make a run and call it run1 it will make run1.txt
Echo If you run it again with the same output name run1.txt will be overwritten.
Echo You have been Warned!
Echo.


Set /p python= "Where is Python.exe? (Enter your path e.g. c:\python34) :"
goto :Start


:Start
Set /p update= "Do you want to update your trade data? (y/n) :"
If %update% ==y (goto :update) else (goto :Setup)


:update
%python%\python.exe trade.py import --plug=maddavo --opt=syscsv --opt=stncsv
goto :Setup


:Setup
Set /p textdoc= "What do you want to name the text document? (e.g. run1 = run1.txt) :"
Set /p capacity= "How much cargo space can you carry? :"
Set /p credits= "How much Credits do you have? :"
Set /p lyper= "How far can you jump loaded? (00.00) :"
Set /p emptyly= "How far can you jump empty? (00.00) :"
Set /p from= "Where are you now? enter(System/Station) no spaces) :"
Echo.
Echo Next question is where you're going to errors may happen in making your run if you set a destination but do not have enough hops or jumps to get there. Please if you're getting errors adjust your Jumps and Hops or enter "1" for anywhere.
Echo.
Echo Because of the problems with setting a destination currenlty it will try and get you within 2 jumps of where your asking.
Echo.
Set /p to= "Where are you going to? enter(System/Station) no spaces or (1) for anywhere :"
Set /p hops= "How may trade hops do you want? (enter a number 1-10) :"
Set /p jumps= "How many jumps are you willing to make between hops? (enter a number 1-10) :"
Set /p maxdays= "how many days old of data do you want to use? (1 - 30) :"
goto :Run


:Run
Echo.
Echo I am now building your run this can take a while depending on your choices.
Echo Give it a good 5 mins if it does not come back hit CTRL-C a few times to cancel... 
Echo.
If %to% ==1 (goto :Run1) else (goto :Run2)


Rem - Run1 = a command with any destination
:Run1
%python%\python.exe trade.py run --cap %capacity% --cr %credits% --ly-p %lyper% --empty-ly %emptyly% --from %from% --hop %hops% --jump %jumps% --max %maxdays% -vvv >%textdoc%.txt
goto :Done


Rem - Run 2 = a command with a set destination
:Run2
%python%\python.exe trade.py run --cap %capacity% --cr %credits% --ly-p %lyper% --empty-ly %emptyly% --from %from% --to %to% --end 2 --hop %hops% --jump %jumps% --max %maxdays% -vvv >%textdoc%.txt
goto :Done


:Done
Echo.
Echo Either you have an error or I finished the run look inside the folder for your text document.
Echo. 
Set /p again= "Do you want to make a new run or exit? (y/e) "
If %again% ==y (goto :Start) else (goto :End)


:End
Echo Goodbye thanks for using Trade Dangerous Batch script by Bruteman!
Pause

If your good with Batch files please modify this as you see fit to fit your needs I tried to comment or make it clear what its doing and where it is doing it in here and you can shortcut this to a icon on your desktop and just run it no need to leave a cmd window open all the time or to keep a copy paste of all your commands.

The reason it asks for your python directory is because some others like me run both Python 2.x as well as 3.x in the same system I tried to write the batch file so it will only ask for it it in the start if your going to make multiple runs in the 1 execution of the batch file.

if you don't want it to ask you all the time where python is simply change:

Set /p python= "Where is Python.exe? (Enter your path e.g. c:\python34) :"

to

Set python=c:\python34

or wherever your python 3.4 directory is make sure you leave out the last \

i.e. X:\Python not X:\Python\

Enjoy,

Bruteman.
 
TradeDangerous brings traders together

The galaxy is big. But somehow probably due to the draw of good prices I just bumped into fellow TD user @Snake_Man at Vo Dock in LHS 142. Haha, what are the odds.
 
Back
Top Bottom