In-Development TradeDangerous: power-user trade optimizer

Code:
[b]
v6.13.1 Mar 06 2015
. (kfsone) "shipvendor" command:
  - Default action is now to list ships at given station, e.g.
    trade.py shipvendor galileo
  - Added "--name-sort" (--name) to sort list by ship name,
. (kfsone) Fixed some problems with maddavo's import,
. (kfsone) Added "WARNING" level events (use -qq to disable),
. (kfsone) Fixed #195 "local" ValueError when no stations listed,
+ Dry411S: ShipVendors
[/b]

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

Just tried a reload of data..

trade.py import --plug maddavo --opt stations --opt systems

got

NOTE: WUONANIE/Picacio Station (#12772) updated in local db: mkt('?'=>'Y')
NOTE: XI-2 CAPRICORNI/Bouch Terminal (#13458) added to local db: ls=0, mkt=Y, bm=?, yard=?, pad=?, mod=2015-03-06 09:38:00
Traceback (most recent call last):
File "E:\trade\trade.py", line 102, in <module>
main(sys.argv)
File "E:\trade\trade.py", line 76, in main
results = cmdenv.run(tdb)
File "E:\trade\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "E:\trade\commands\import_cmd.py", line 101, in run
if not plugin.run():
File "E:\trade\plugins\maddavo_plug.py", line 461, in run
self.import_stations()
File "E:\trade\plugins\maddavo_plug.py", line 288, in import_stations
lsFromStar = int(values[2])
ValueError: invalid literal for int() with base 10: '11.5'


So yup, something is bugged....

Nope, is now fixed....

Yeah - see my post above yours, I'd fixed it a half hour earlier :)
 
Pad size doesn't seem to be working correctly at version b712e2885ed8 :

Code:
D:\Gadgets\TradeDangerous>trade.py run --ca 208 --ly 16.79 --cr 2407548 --ins 1072607 --fr cerno/kanw -s 3 -vvv -p L
KAO ZIYI/Gillekens Hub -> COSI/Arrhenius Hub (score: 903223.939200)
Start CR:  1,334,941
Hops    :          2
Jumps   :          4
Gain CR :    902,935
Gain/Hop:    451,468
Final CR:  2,237,876

  Load from KAO ZIYI/Gillekens Hub (no details):
      193 x Gold                       6,892cr vs   10,305cr, 5 days vs 23 days, total:  1,330,156cr
        4 x Lithium                    1,014cr vs    1,867cr, 5 days vs 23 days, total:      4,056cr
       11 x Synthetic Fabrics             11cr vs      101cr, 5 days vs 23 days, total:        121cr
... etc

Unless I'm misreading the destructions, when specifying pad size it should only give unknowns if you include a '?' (e.g. -p L?) whilst I'm requesting known large pads only

'KAO ZIYI','Gillekens Hub',0,'?','?','?','?','2015-03-03 19:32:09'

Not a large pad (well, maybe but we don't know)

Update:

I checked and the station is a medium, so ran trade.py station to update it and re-ran the above command - which still wanted to send me to the medium station.

Load from LF 8 +16 41/Wright Vision (Unk/bm, Med/pad)

This might be coincidence, hard to tell, but it doesn't seem to do this unless in combination with -s, without -s, I only get large pad stations.
 
Last edited:
I can not find a function to delete market data I previously entered.
How can I delete the market data of a station or system (or clear all data)?
Is it possible to delete all data that is older than a given time?
 
Pad size doesn't seem to be working correctly at version b712e2885ed8 :

Code:
D:\Gadgets\TradeDangerous>trade.py run --ca 208 --ly 16.79 --cr 2407548 --ins 1072607 --fr cerno/kanw -s 3 -vvv -p L
KAO ZIYI/Gillekens Hub -> COSI/Arrhenius Hub (score: 903223.939200)
Start CR:  1,334,941
Hops    :          2
Jumps   :          4
Gain CR :    902,935
Gain/Hop:    451,468
Final CR:  2,237,876

  Load from KAO ZIYI/Gillekens Hub (no details):
      193 x Gold                       6,892cr vs   10,305cr, 5 days vs 23 days, total:  1,330,156cr
        4 x Lithium                    1,014cr vs    1,867cr, 5 days vs 23 days, total:      4,056cr
       11 x Synthetic Fabrics             11cr vs      101cr, 5 days vs 23 days, total:        121cr
... etc

Unless I'm misreading the destructions, when specifying pad size it should only give unknowns if you include a '?' (e.g. -p L?) whilst I'm requesting known large pads only

'KAO ZIYI','Gillekens Hub',0,'?','?','?','?','2015-03-03 19:32:09'

Not a large pad (well, maybe but we don't know)

Update:

I checked and the station is a medium, so ran trade.py station to update it and re-ran the above command - which still wanted to send me to the medium station.

Load from LF 8 +16 41/Wright Vision (Unk/bm, Med/pad)

This might be coincidence, hard to tell, but it doesn't seem to do this unless in combination with -s, without -s, I only get large pad stations.

The rules are intended to be relaxed when you specify a single origin, I'm guessing it's only finding one origin and using that one.

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

I can not find a function to delete market data I previously entered.
How can I delete the market data of a station or system (or clear all data)?
Is it possible to delete all data that is older than a given time?

There's no explicit tool for this, but methods you can use right now:

1. Update all the prices to zero (this effectively removes them),
2. Use one of the editor update methods, e.g., trade.py update --notepad yourstation, delete all the prices.
3. Open data/TradeDangerous.prices and remove the entry for the station, then do a trade.py buildcache -f -i -q
 
The rules are intended to be relaxed when you specify a single origin, I'm guessing it's only finding one origin and using that one.

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



There's no explicit tool for this, but methods you can use right now:

1. Update all the prices to zero (this effectively removes them),
2. Use one of the editor update methods, e.g., trade.py update --notepad yourstation, delete all the prices.
3. Open data/TradeDangerous.prices and remove the entry for the station, then do a trade.py buildcache -f -i -q

Speaking of which.. I'm working on adding a feature to my frontend right now that will automate that process. Just Ctrl+Click the editor button and it will grab the prices, zero them out, and produce a clean updated.prices file. I won't be automating the re-import however, since it serves as a confirmation to make sure the user -really- wants to wipe their commodity data for that station. Nothing stops the user from setting that .prices file as their default import file however, if the convenience is more important than the safety.

I should be pushing that in an update either today or tomorrow.
 
Hello all,
It has been about 30 pages since I last visit this great thread. Was wondering if any of the front ends that people said they were working on every made it to the wild? -Thanks
 
Hello all,
It has been about 30 pages since I last visit this great thread. Was wondering if any of the front ends that people said they were working on every made it to the wild? -Thanks
There's a link in the signature in the post above yours.
 
I have written a small shell-like interface for TradeDangerous called "itrade".
You can directly run the TradeDangerous commands from it, but it also provides some nice features like variables and aliases with optional place holders and some other helpful functions.
It's written in just a few hours in Python like TradeDangerous itself, so don't expect a GUI or anything too fancy. If you don't want to work on the command line at all it's not for you, but for me it makes things much easier than working directly with trade.py.

You can download it here:
View attachment 19471

Please read the itrade.txt for instructions:
Code:
itrade

itrade presents the user with a shell-like interface to directly call trade.py.
It also provides several helpful functions to simplify the calls.


- Setup -
In the directory where "itrade.py" is located there has to be a "itrade.ini" (if not, create one).
This file must contain the following section:
[MAIN]
tradepath = C:\path\to\trade dangerous
logpath = c:\path\to\Elite Dangerous\Logs

tradepath is the path to the directory where trade.py is located.
logpath is optional, but needed for certain features to get the current system name.

- Basic function -
Commands
:q

Running itrade.py presents a shell-like user interface to directly call trade.py.
Whatever you type will be used as command line parameters for trade.py:
>>: run --cap 4 --credits 20000 --ly 7
	-> trady.py run --cap 4 --credits 20000 --ly 7
>>: --help
	-> trade.py --help

You can use
>>: :q
to quit itrade.
Notice the ':' before the 'q'. This prefix is always used for the special functions provided by itrade.


- Variables -
Variables are used for storing simple values you need regularly.

-- Defining variables --
Commands
:var
:delvar

You can create variables that are persisted and can be used in your calls.
For example when you always fly with a capacity of 4, you might want to declare a variable for that:
>>: :var cap 4

Usage ":var [NAME] [VALUE]"
Everything after the NAME will be used as value (including spaces!).
Omitting the VALUE prints the current value, omitting the NAME prints a list of all defined variables.

Variables are delete with the command :delvar
Usage ":delvar [NAME]"

-- Using variables --
To use variable you have to put them in semicolons:
:var cap 4
>>: run --cap ;cap; --credits 20000 --ly 7
This is the same as
>>: run --cap 4 --credits 20000 --ly 7

-- Predefined variables --
There are predefined variables (well, one at the moment) that cannot be assigned manually.
sys : Holds the current system name from the log file (verbose logging must be enabled).
If using 'sys', you will be asked to confirm the system name from the logs by simply pressing enter,
or you can enter a different name, when it could not be retrieved correctly from the logs.

Usage is the same as for normal variables:
>>: run --from ;sys; --cap 4 --credits 20000 --ly 7

-- Important rules for variables --
You should never use variables in varaibles (e.g. ":var a ;b;").
This is not supported and depending on parameter and order ";b;" might or might not be replaced with the value of a variable "b".

Even if the value of a variable contains quotes, it is always bound to one parameter.
>>: :var station Burnell Station
>>: run --from Sol/;station;
This would result in the following trade.py call:
trade.py --from "Sol/Burnell Station"
That is working fine.
However
>>: :var ly --ly 7
>>: run --from Sol/;station; ;ly;
Would not work, as it would be called as:
trade.py --from "Sol/Burnell Station" "--ly 7"

If you want a simplification like this, you should look into aliases (documented later in this document).


- Aliases -
Aliases are used for storing abbreviations of commonly used commands.
Commands
:alias
:delalias

Usage ":alias [NAME] [COMMAND]"
Omitting the COMMAND prints the current COMMAND, omitting the NAME prints a list of all defined aliases.

Aliases are delete with the command :delalias
Usage ":delalias [NAME]"

-- Simple aliases --
Aliases are defined like variables, but you can store a whole command in them.
>>: :alias myrun run --cap 4 --credits 20000 --ly 7

Then you can just type "myrun" and it executes the whole command.

!Important!
Aliases are called without the ':'-prefix. So variables cannot be named like a basic trade.py option (e.g run).

-- Aliases with variables --
Variables can be used in aliases
>>: :var cap 4 
>>: :alias myrun run --from ;sys; --cap ;cap; --credits 20000 --ly 7
>>: myrun
	-> run --from SOL --cap 4 --credits 20000 --ly 7

-- Aliases with place holders --
You can define place holders in aliases with {0}, {1} .. {n}:
>>: :alias myrun run --from {0} --cap {1}
The place holders will be replaced with the arguments you type after the alias (you can use variables):
>>: myrun ;sys;/Station 4
	-> run --from SOL/Station --cap 4

The place holder ids must be starting with 0 and be continuously.
Additional typed arguments that are not needed for place holders will be appended to the call of the alias:
>>: :alias myrun run --cap 4 --credits 20000 --ly 7
>>: myrun --from SOL/Station
	-> run --cap 4 --credits 20000 --ly 7 --from SOL/Station

-- Aliases calling other aliases --
If the first option defined in alias is the name of another alias, then that alias will be invoked.
Place holders are evaluated for each alias individually (the arguments of the first alias are used for the place holders of the second).
Example:
>>: :alias myrun run --fr {0} --cap 4 --credits {1} --ly 7
>>: :alias myrun2 myrun ;sys;/{0}
>>: myrun2 Station 20000 -v
	-> run -fr SOL/Station --cap 4 --credits 20000 --ly 7 -v

!Important!
Do not create infinite loops like
>>: :alias a b
>>: :alias b c
>>: :alias c a
>>: a


- Integrated python functions -
If your input starts with ':' and is no itrade function, what you type after the ':' will be evaluated as a python expression:
>>: : 4 * 6.8 / 2.1
12.95238095238095

If you type '::' a python shell will open (if the python executable is in your PATH).
 
Last edited:
what was the --emp and -md commands for again?

and how do i use --opt=csvs? whats the entire command is it likw trade.py --opt=csvs

and --max 0.5 dosent work its saying
Code:
trade.py: ERROR: ambiguous option: --max could match --max-days-old, --max-routes
 
Last edited:
I want to update the station data for stations I'm visiting when I find information missing or false and have a few questions about that:

What is the right way to measure the distance between station and star?
For example the databases (including TradeDangerous) I found say that Mokosh/Lubin Orbital is 1071 LS from the star, but when docked at the station, it looks like 1041 LS:
Screenshot_0000.jpg
Is that wrong data in the databases or is measuring done differently?
Additionally, where can I see in game which is the maximum landing pad size supported by a station?

If I find that data is wrong or missing, can I just correct it and eventually create Pull Requests for the corrected csv-files?
 
small variations like that in ls from star are common and can be attributed to people measuring the distance when exiting fsd at the star itself. eliptical orbits would also account for reasonably trivial differences. Max landing pad size can be picked up easily - all outpost types are M maximum, all others (ie fly inside to dock) are L maximum.

EDIT : I've seen a few large stations without shipyards or even markets, so the rest of the info needs to be gleaned from the system map and actually docking.
 
Last edited:
What is the right way to measure the distance between station and star?

hi,
i do it this way:
(assuming the current system is a simple one-star/planets-system(which are the most))

- go in the system map for this station
- identify the planet which is orbited by this station
- look for the distance this planet has from the star, shown as "SEMI MAJOR AXIS"
(the greatest diameter, which the ellipse has this planet, is the "major axis".
so, the "semi major axis" describes the greatest distance this planet has from its star,
which is the common measure also for the station, as the distance from the star)

- this distance in lightseconds, is what is sought
(1 AU = 500 ls (precisly: 1AU = 499,0047838061 lightseconds))



ps.: of course, this value changes constantly, so it can be assumed that the value,
which appears in the navigationpanel is the momentary value

psps.: maybe someone else can explain this question in a better way and in more detail
 
Last edited:
Hi,

I really love TD, so I also made my own user interface. It's "menu-based" Linux bash script what I can run on ssh-shell on Steam Overlay web-browser. I can now trade, manage stations/prices and do some settings stuff with no hassle. Some settings like credits, capacity, insurance, etc. can be stored at config-file and can be changed anytime when needed.

The codingstyle of that "thing" is so horrible! So no sources available in public at the moment. :-D

Main menus:

Code:
*********************************************
****    TRADE DANGEROUS BASH FRONTEND    ****
****       [C] CMDR Boozeman 2015        ****
*********************************************


Press enter if menu does not show


1) Trade
2) Manage Data
3) Settings
4) Quit

1) Trade to           3) Show Markets       5) Return
2) Trade Towards      4) Show Market Items

1) List Stations       4) Remove Station      7) Return
2) Add Station         5) Import Prices
3) Update Station      6) Export Station.csv

1) Current Settings          3) Git pull Trade Dangerous
2) Update Settings           4) Return

Example Update Station

Code:
****    UPDATE STATION    ****


STAR/Station Name
kin/Grigson Escape
Station Informantion:


System    Dist
  /  Station         StnLs Age/days Mkt BMk Shp Pad Itms
--------------------------------------------------------
KIN       0.00
  /  Shaikh Mines       20     0.84 Yes Yes  No Med   65
  /  Grigson Escape     40        - Yes  No  No Med    0


LS From Star (Blank=No change):


Shipyard (Y|y/N|n/?) (Blank=No change:


Market (Y|y/N|n/?) (Blank=No change):


Black Market (Y|y/N|n/?) (Blank=No Change):


Landing Pad Size (S|s/M|m/L|l/?) (Blank=No Change):


NOTE: No changes.


Stations on system
System    Dist
  /  Station         StnLs Age/days Mkt BMk Shp Pad Itms
--------------------------------------------------------
KIN       0.00
  /  Shaikh Mines       20     0.84 Yes Yes  No Med   65
  /  Grigson Escape     40        - Yes  No  No Med    0
 
New commodity appeared in 1.2 - Painite.

Edit item.csv thusly (don't have diff on my doze box, so you get this ;))

Code:
'Minerals','Bauxite',1
'Minerals','Bertrandite',2
'Minerals','Coltan',3
'Minerals','Gallite',4
'Minerals','Indite',5
'Minerals','Lepidolite',6
'Minerals','Painite',7
'Minerals','Rutile',8
'Minerals','Uraninite',9
 
what was the --emp and -md commands for again?

and how do i use --opt=csvs? whats the entire command is it likw trade.py --opt=csvs

and --max 0.5 dosent work its saying
Code:
trade.py: ERROR: ambiguous option: --max could match --max-days-old, --max-routes

trade.py --help
trade.py <option> --help

--max is ambiguous because there are 2 arguments that start --max . You need to add more characters e.g. --max-days-old
 
Adding systems without stations

Firstly, love tradedangerous, and love learning to use it </grovel>

I'm not sure why this question has not been asked before (at least I cant find where its been asked) but how can I add a system that has no stations?

It's my understanding that even if there are no stations in a system TD will still need this data to accurately plot a course? I'm sure I've seen some systems listed in jump routes that don't have stations so how can I add my own?

I have already used maddavo's instructions to calculate positions and have entered those systems into both EDSC and ROSS (eddb) but unlike the station and price data which is updated through maddavo's site/plugin, the system.csv is NOT updated.

Do I have to manually edit TD's System.csv? If so, can you suggest an appropriate mac friendly tool to do so (TextEdit can't cut it) and how can I export these new systems back to other TD users?

Again love TD, long live the TD, etc,etc,
 
Back
Top Bottom