In-Development TradeDangerous: power-user trade optimizer

trade.py run --cr 2000000 --cap 532 --ly 12.02 -vvv --avoid edwardsring,chiherculis --fr aulinenterprise

I don't know if it make a difference but it's --ly-per in the run cmd
You can check the aged of the data quick with

Code:
./trade.py local aulinenterprise --ly 12 -v
.
 
Thanks for the xmas gift update, much appreciated :)

Now that I run the new version, first I imported new data with:
Code:
trade.py import --plug=maddavo --opt=syscsv --opt=stncsv -v
then I run query:
Code:
trade.py run --cr 2000000 --cap 532 --ly 12.02 -vvv --avoid edwardsring,chiherculis --fr aulinenterprise
and results say 18days old data. Then I run:
Code:
trade.py update -T --editor=nano aulin/enterprise
and the prices (with few exceptions, not the results query showed though) are dated 2014-12-24 02:27:00

Any ideas where I went wrong? :eek:

Hrm - that's a presentation issue; it's telling you that the item's selection is based on data that is 18 days old, which is the data from the destination, Chango:

Code:
$ trade.py local aulin -v --ly 4
System              Dist
  /  Station                                Dist Age/days BMkt Pad
------------------------------------------------------------------
AULIN               0.00
  /  Aulin Enterprise                          ?     5.87    ?   ?
  /  Edwards Ring                              ?    16.71    ?   ?
  /  Kuo City                                  ?        -    ?   ?
I BOOTIS            3.53
  /  Chango Dock                               ?    18.31    ?   ?

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

I don't know if it make a difference but it's --ly-per in the run cmd
You can check the aged of the data quick with

Code:
./trade.py local aulinenterprise --ly 12 -v
.

The parser lets you type the minimum unique letters, so "--ly-per" becomes "--ly" until there's a conflicting argument. That's how all the abbreviations work, e.g. "--cr" for "--credits", etc.

A counter example: "--ls-per" won't abbreviate to "--ls" because of "--lsp".
 
Last edited:
BONUS XMAS PRESENT:

Just pushed a change that tries to favor shorter supercruise times; this is the "light second penalty" (--ls-penalty or --lsp).

This takes a percentage, the default is 0.5 (half a percent) and it reduces the score of trades *to* a station by this much for every 1000ls you have to supercruise from the star to get there.

It's not perfect -- if there are two stations 50ls apart orbiting something 85,000ls out from the star, you probably won't see that run.

You can disable it with "--lsp=0".

But what I want is an option to avoid runs over 10,000ls

That's hand-waving. You don't want an 82,000ls run that isn't considerably more profitable than 2 400ls runs.

I've made the "run -v" output include distance-to-station when we know the value. This change is going to provide a softer alternative to hard cut-offs and if you experiment with using "--route" when you're not seeing very favorable results, will better equip you as a trader overall.

8x --- snip --- x8

v6.3.1 [wip]
. (kfsone) Added "--ls-penalty" ("--lsp") for biasing "run" calculations
in favor of shorter supercruise times.
+ Stations, data: kfsone

v6.3.0 Dec 23 2014
. (OpenSS) Script for Windows users (see scripts/README.txt)!
. (kfsone) Added support for pad sizes at stations,
. (kfsone) Revamped output from "local", "buy", "sell" and "olddata".
- "--ages" is the default now (so the option is not needed),
- Added pad size display,
- Improved black market display,
- Changed '+' to '/' for consistency on station lines,
. (bgol) Fixed weirdness with rangeCache
. (bgol/kfsone) Fixed jump distances and performance of "nav" command
+ Stations, Data: kfsone

v6.2.4 Dec 21 2014
. (kfsone) Experimental "add-station" command in misc,
. (kfsone) Added "--near" to olddata command,
. (kfsone) Route calculation performance,
. (kfsone) Added "Black Market" flag to station data,
. (kfsone) Added Black Market indicators to "local" command,
. (kfsone) Reorganized Ship and ShipVendor data (prices are ship based now),
. (kfsone) Draft version of "jsonprices",
. (gazelle) Auto-completion for bash users (see scripts/README.txt)
. (gazelle) Nice overhaul of the csv export command
. (kfsone) Fix for UTF-8 decoding error,
. (kfsone) Rebuild cache before .prices file after downloading .csvs
. (maddavo) Combat Stabilisers do exist
+ Systems, Stations, Data: Maddavo, Gazelle, Kfsone, many others

v6.2.3 Dec 17 2014
. (kfsone) "maddavo" import plugin:
. --opt=skipdl will use previous downloads
. added timestamp tracking/checking (data/maddavo.stamp)
. don't rebuild the cache if nothing new was downloaded,
. use "-v" to see stats on what updates you've downloaded,
. use "-q" to see less output when using the plugin
. (kfsone) Changed "nav" to show station count with "-v" instead of "--stations"
. (kfsone) Removed the StationLink table - cache builds should be MUCH faster

v6.2.2 Dec 17 2014
. (kfsone) Removed Alloys, Combat Stabilisers, Cotton and Plastics
[there was no entry for them anywhere in the price database]
. (kfsone) Plugins can now have their own options
maddavo's plugin will take --option=syscsv and
--option=stncsv to download those .csv files
. (kfsone) Added "--download" option to "import" to stop after downloading
. (kfsone) Added "--url" option to "import", e.g.
trade.py import --download --url http://kfs.org/td/prices kfs.prices
. (kfsone) "--check --mfd" should now work if you have 64-bit drivers
. (kfsone) Added "--max-days" to run command
+ Stations, ships: kfsone

v6.2.1 Dec 12 2014
. (kfsone) Added "olddata" command
. (kfsone) "run" (with -vv) will now show data age
. (kfsone) Gamma 2.0.5 renamed "Slaves" category to "Slavery"
. (kfsone) "sell" now has a --ages option too
. (kfsone) "buy" and "sell" --near now checks the station/system too
. (kfsone) "buy" now shows average cost if you specify --detail (-v)
. (kfsone) "sell" now shows average value if you specify --detail (-v)
. (kfsone) Fixed item name matching (--avoid)
. (kfsone) Fixed use of via in "run"
. (kfsone) Exposed cache.regeneratePricesFile()
. (kfsone) Call regeneratePricesFile() after calling plugin.finish()
. (kfsone) General code cleanup (removed buildLinks and loadTrades)
. (kfsone) Added VisualStudio pyproj (great for performance analysis)
+ Stations, distances, ship data: gazelle, gulasch, kfsone, mseven
 
Last edited:
I guess if it would be possible you guys had done this already but I'll ask anyways; is there any way to make trade.py to EXPORT data same as it now imports from maddavo's site?

Its kind of painful now to upload TradeDangerous.prices file manually.
 
I guess if it would be possible you guys had done this already but I'll ask anyways; is there any way to make trade.py to EXPORT data same as it now imports from maddavo's site?

Its kind of painful now to upload TradeDangerous.prices file manually.

When you edit, it creates a file called "updated.prices". It even tells you this:

Code:
$ "/c/dev/trade/trade.py" update -GF -wx=-240 -wy=200 mckeering
NOTE:
. The Update UI is still somewhat experimental.
. Press CTRL-C here to abort editing, or else just close the window to save.
. Use '-q' to hide this message,
. '-F' to make the update window appear infront of Elite: Dangerous (Windowed),
. '-A' to force all items to show if stuff is missing from a station.
[b]- Copy of changes saved as 'updated.prices'[/b]

You only need to upload that file.

Mad and I are working on an automatic export.

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

NOTE: If you get "ERROR: 46" trying to update, please get the latest code. This is a bug I recently introduced that is only exposed when an item isn't sold anywhere (there are no stations selling "platinum" in maddavo's database right now)
 
BONUS XMAS PRESENT:

Just pushed a change that tries to favor shorter supercruise times; this is the "light second penalty" (--ls-penalty or --lsp).

This takes a percentage, the default is 0.5 (half a percent) and it reduces the score of trades *to* a station by this much for every 1000ls you have to supercruise from the star to get there.

It's not perfect -- if there are two stations 50ls apart orbiting something 85,000ls out from the star, you probably won't see that run.

You can disable it with "--lsp=0".

But what I want is an option to avoid runs over 10,000ls

That's hand-waving. You don't want an 82,000ls run that isn't considerably more profitable than 2 400ls runs.

I've made the "run -v" output include distance-to-station when we know the value. This change is going to provide a softer alternative to hard cut-offs and if you experiment with using "--route" when you're not seeing very favorable results, will better equip you as a trader overall.

8x --- snip --- x8

v6.3.1 [wip]
. (kfsone) Added "--ls-penalty" ("--lsp") for biasing "run" calculations
in favor of shorter supercruise times.
+ Stations, data: kfsone

v6.3.0 Dec 23 2014
. (OpenSS) Script for Windows users (see scripts/README.txt)!
. (kfsone) Added support for pad sizes at stations,
. (kfsone) Revamped output from "local", "buy", "sell" and "olddata".
- "--ages" is the default now (so the option is not needed),
- Added pad size display,
- Improved black market display,
- Changed '+' to '/' for consistency on station lines,
. (bgol) Fixed weirdness with rangeCache
. (bgol/kfsone) Fixed jump distances and performance of "nav" command
+ Stations, Data: kfsone

v6.2.4 Dec 21 2014
. (kfsone) Experimental "add-station" command in misc,
. (kfsone) Added "--near" to olddata command,
. (kfsone) Route calculation performance,
. (kfsone) Added "Black Market" flag to station data,
. (kfsone) Added Black Market indicators to "local" command,
. (kfsone) Reorganized Ship and ShipVendor data (prices are ship based now),
. (kfsone) Draft version of "jsonprices",
. (gazelle) Auto-completion for bash users (see scripts/README.txt)
. (gazelle) Nice overhaul of the csv export command
. (kfsone) Fix for UTF-8 decoding error,
. (kfsone) Rebuild cache before .prices file after downloading .csvs
. (maddavo) Combat Stabilisers do exist
+ Systems, Stations, Data: Maddavo, Gazelle, Kfsone, many others

v6.2.3 Dec 17 2014
. (kfsone) "maddavo" import plugin:
. --opt=skipdl will use previous downloads
. added timestamp tracking/checking (data/maddavo.stamp)
. don't rebuild the cache if nothing new was downloaded,
. use "-v" to see stats on what updates you've downloaded,
. use "-q" to see less output when using the plugin
. (kfsone) Changed "nav" to show station count with "-v" instead of "--stations"
. (kfsone) Removed the StationLink table - cache builds should be MUCH faster

v6.2.2 Dec 17 2014
. (kfsone) Removed Alloys, Combat Stabilisers, Cotton and Plastics
[there was no entry for them anywhere in the price database]
. (kfsone) Plugins can now have their own options
maddavo's plugin will take --option=syscsv and
--option=stncsv to download those .csv files
. (kfsone) Added "--download" option to "import" to stop after downloading
. (kfsone) Added "--url" option to "import", e.g.
trade.py import --download --url http://kfs.org/td/prices kfs.prices
. (kfsone) "--check --mfd" should now work if you have 64-bit drivers
. (kfsone) Added "--max-days" to run command
+ Stations, ships: kfsone

v6.2.1 Dec 12 2014
. (kfsone) Added "olddata" command
. (kfsone) "run" (with -vv) will now show data age
. (kfsone) Gamma 2.0.5 renamed "Slaves" category to "Slavery"
. (kfsone) "sell" now has a --ages option too
. (kfsone) "buy" and "sell" --near now checks the station/system too
. (kfsone) "buy" now shows average cost if you specify --detail (-v)
. (kfsone) "sell" now shows average value if you specify --detail (-v)
. (kfsone) Fixed item name matching (--avoid)
. (kfsone) Fixed use of via in "run"
. (kfsone) Exposed cache.regeneratePricesFile()
. (kfsone) Call regeneratePricesFile() after calling plugin.finish()
. (kfsone) General code cleanup (removed buildLinks and loadTrades)
. (kfsone) Added VisualStudio pyproj (great for performance analysis)
+ Stations, distances, ship data: gazelle, gulasch, kfsone, mseven

Awesome addition kfsone. I can assume then, that during Station appending you'll require distance from Sun to Station. Can you say whether or not the Trade.bat author will update the file to include the new parameter? Thank you developing, what is to me, the best trading application for Elite Dangerous to date.
 
Due to the increased need to crowdsource station data, I have updated the upload function at Maddavo's market share. It now accepts prices files AND/OR Station files (Station.csv). The station files should be in the new format including blackmarket and max_pad_size fields.
 
Last edited:
Does anyone know he pad sizes? AFAIK starports have large pads and outposts have medium. Anything else?

All Coriolis, Ocellus and Orbis starports have Small, Medium and Large pads, so put 'L' in the max_pad_size column of the Station.csv .
Any ship can land at these stations.

Outposts can have different module configurations either Small only OR Small and Medium. I'm pretty sure Unsanctioned outposts only have Small pads - that would be 'S' in the max_pad_size column. If the outpost has a Medium pad (usually only one if it has any) then that's 'M'.

Sidewinders, Eagles, Vipers, Haulers, I think even Cobras will land on a Small pad. The Asp and Lakon6 require a Medium pad.
 
Outposts can have different module configurations either Small only OR Small and Medium. I'm pretty sure Unsanctioned outposts only have Small pads - that would be 'S' in the max_pad_size column. If the outpost has a Medium pad (usually only one if it has any) then that's 'M'.

I think to remember a patch note where they changed all outpost to have one medium pad size, hence my question.

edit: found it (Beta 3.9 Change log):
- Criminal Outposts can now accept medium sized ships
 
Last edited:
I apologise if I am being immensely dense here but can this script be used to find the most efficient route between, say 50, stations. I have a list of places I would like to visit and I do not care about the order.

The run command calculates with trading & prices and as far as I can tell the nav command does allow the --via variable?

Can some one point out my mistake/s? Can give the code I was trying.
 
I apologise if I am being immensely dense here but can this script be used to find the most efficient route between, say 50, stations. I have a list of places I would like to visit and I do not care about the order.

The run command calculates with trading & prices and as far as I can tell the nav command does allow the --via variable?

Can some one point out my mistake/s? Can give the code I was trying.

Do you actually want to visit all 50 stations in one go or do you just want to visit some of them?

Code:
trade.py run ... --from StationA --to stationX --via stationB,stationC,stationD,...,station50 --hops 51

Now - given that tight a constraint, it might not be able to pull it off. So you might need to say "--hops 52" or "--hops 53".

I will eventually add a travelling-salesman solver to "nav" but the emphasis right now is on trading related stuff and data gathering.
 
Will you support rare goods - trade.py choked on the following import.

+ Unknown
The Waters Of Shintara 8270 8251 ? - 2014-12-24 23:38:00
 
Will you support rare goods - trade.py choked on the following import.

+ Unknown
The Waters Of Shintara 8270 8251 ? - 2014-12-24 23:38:00

Is that an actual thing? You can always just add it to your data/Item.csv locally.
 
Last edited:
Will you support rare goods - trade.py choked on the following import.

+ Unknown
The Waters Of Shintara 8270 8251 ? - 2014-12-24 23:38:00

You should skip rare commodities for now. TD doesn't know about them.

Is that an actual thing? You can always just add it to your data/Item.csv locally.

It' a "Rare commodity" which value increase with distance, see this thread: Rare Commodities List!

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

Ah, so does that mean that all stations are either M or L - there are no S anymore?

My question exactly!
 
HI,

I am running trade.py import --maddavo --option=stncsv --option=syscsvm and every day it gives me errors when building the cache... missing stations..
should it build the cache without errors by now ? what am i doing wrong ?
 
HI,

I am running trade.py import --maddavo --option=stncsv --option=syscsvm and every day it gives me errors when building the cache... missing stations..
should it build the cache without errors by now ? what am i doing wrong ?

No 'm' at the end. What errors do you get? Also, you don't have to run the syscsv option - that doesn't change very often - only once or twice a week maybe.
 
If someone's near the system below can you tell me which of these is right and which is wrong?

Code:
'Albicevci','Dobrovolski Survey',0,'N','M'
'Albicevci','Dubrovolski Survey',0,'N','M'
 
Back
Top Bottom