In-Development TradeDangerous: power-user trade optimizer

Its a problem with stations that now sell and buy the same item. They only show supply, demand is blank and thus TD thinks there is no demand. However there is a demand, it just does not show.
I think this is due to passive powers that give +% to consumption and supply- especially for stations that before only had supply. They now suddenly also got a demand.
I manually update TD to include those stations that I frequent regularly, but as soon as I do an import from either a mobile api or an OCR the item is not considered to be sellable in TD again.

I'm fairly certain TD ignores demand values. If there's a price it can be sold, TD will consider selling it there, whatever the demand.
 
Its not the case. When I told TD to do a trade check between two stations it gave me a 600/t with coffee and tea.
However I am trading imp. slaves with over 3000/t over the same station. So TD is not considering this trade due to something.
.
If I use TD to check what I can sell to this station- imp. slaves is not in the list. So TD is missing it for some reason.
I can only see this to demand being blank (demand is not 0 - it is nothing in the demand box) or TD gets confused when you can buy and sell the same item.
What is 100% sure is that TD is not considering this trade opportunity for one reason or the other.
.
Just to be clear. I have made over 50 mill on this trade route over the last couple of days.
 
Last edited:
Code:
v7.2.0 Jun 14 2015:
. (Orphu) Created an import plugin that uses Frontier's Mobile API,
    - See README.md for more help,
    - Use "trade.py import -P edapi" to get started,
    - Able to optionally upload prices it pulls to EDDN:
        trade.py imp -P edapi -O eddn
. (maddavo) Fixed/merged lots of new systems,
 
I jumped on the 7.2.0 as soon as I saw this.

I am liking the edapi plugin. I have my voice attack profile launch it with the "Pull List" Command so I can quickly update even if I am not trading.

One thing I did notice is now when I update I am getting something that I didn't get before, and I am not sure if its an error or not.

Code:
Traceback (most recent call last):
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\trade.py", line 104, in <module>
    main(sys.argv)
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\trade.py", line 77, in main
    results = cmdenv.run(tdb)
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\commands\commandenv.py", line 80, in run
    return self._cmd.run(results, self, tdb)
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\commands\import_cmd.py", line 124, in run
    if not plugin.run():
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\plugins\maddavo_plug.py", line 708, in run
    self.import_corrections()
  File "C:\Users\Kevin\Documents\Gaming Related\EliteDangerous\Tools\kfsone-tradedangerous\plugins\maddavo_plug.py", line 232, in import_corrections
    db.execute(stmt, binds)
sqlite3.IntegrityError: UNIQUE constraint failed: Station.system_id, Station.name

Is this an error or something else?
 
Last edited:
I just got rid of some duplicate values in the corrections.csv that were causing an error. The import plugin works again now.
 
Still seeing the error :( Pulled current repo (as zip file if that makes difference) directly before running python trade.py import --plug=maddavo --opt=corrections --opt=csvs

...
NOTE: Added local station placeholder for THOSIAO/FOCER ORBITAL (#41432)
NOTE: Added local station placeholder for TSOHOCK/RERSCHEL TERMINAL (#41433)
NOTE: Added local station placeholder for VANAYEQUI/CBUSS HUB (#41434)
NOTE: Placeholder stations are added to the local DB only (not the .CSV).
Use 'trade.py export --table Station' if you /need/ to persist them.
NOTE: Import complete: 773204 new items over 14,252 stations in 8,147 systems
NOTE: Importing Corrections
Traceback (most recent call last):
File "trade.py", line 104, in <module>
main(sys.argv)
File "trade.py", line 77, in main
results = cmdenv.run(tdb)
File "C:\Temp\TradeDangerous\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "C:\Temp\TradeDangerous\commands\import_cmd.py", line 124, in run
if not plugin.run():
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 708, in run
self.import_corrections()
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 232, in import_corrections
db.execute(stmt, binds)
sqlite3.IntegrityError: UNIQUE constraint failed: Station.system_id, Station.name

running python trade.py import --plug=maddavo --opt=csvs had same effect, tried to do corrections without the corrections switch passed anyway. Running python trade.py import --plug=maddavo got the prices fine as expected without trying to do the corrections and no error.
 
Last edited:
Still seeing the error :( Pulled current repo (as zip file if that makes difference) directly before running python trade.py import --plug=maddavo --opt=corrections --opt=csvs

...
NOTE: Added local station placeholder for THOSIAO/FOCER ORBITAL (#41432)
NOTE: Added local station placeholder for TSOHOCK/RERSCHEL TERMINAL (#41433)
NOTE: Added local station placeholder for VANAYEQUI/CBUSS HUB (#41434)
NOTE: Placeholder stations are added to the local DB only (not the .CSV).
Use 'trade.py export --table Station' if you /need/ to persist them.
NOTE: Import complete: 773204 new items over 14,252 stations in 8,147 systems
NOTE: Importing Corrections
Traceback (most recent call last):
File "trade.py", line 104, in <module>
main(sys.argv)
File "trade.py", line 77, in main
results = cmdenv.run(tdb)
File "C:\Temp\TradeDangerous\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "C:\Temp\TradeDangerous\commands\import_cmd.py", line 124, in run
if not plugin.run():
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 708, in run
self.import_corrections()
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 232, in import_corrections
db.execute(stmt, binds)
sqlite3.IntegrityError: UNIQUE constraint failed: Station.system_id, Station.name

running python trade.py import --plug=maddavo --opt=csvs had same effect, tried to do corrections without the corrections switch passed anyway. Running python trade.py import --plug=maddavo got the prices fine as expected without trying to do the corrections and no error.

Try this:

Code:
trade import -P maddavo -O stations
trade import -P maddavo -O corrections,exportcsv

Then use this for usual imports:
Code:
trade import -P maddavo -O corrections,stations,exportcsv

- - - Updated - - -

Some station/market stats as of now:

41406 Stations in 19011 Systems
Distance9345 (<1000Ls), 4624 (1000Ls - 10000Ls), 1863 (>10000Ls), 25574 unknown
Pad6816 L pad, 9185 M pad, 25405 unknown
Market14320 (14320) markets with prices, 20437 markets without prices, 3619 no markets, 3030 unknown
Market / Pad5523 L-pad markets with prices, 4870 M-pad markets with prices, 3927 unknown pad markets with prices
 
Last edited:
Sadly no, still

NOTE: Importing Corrections
Traceback (most recent call last):
File "trade.py", line 104, in <module>
main(sys.argv)
File "trade.py", line 77, in main
results = cmdenv.run(tdb)
File "C:\Temp\TradeDangerous\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "C:\Temp\TradeDangerous\commands\import_cmd.py", line 124, in run
if not plugin.run():
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 708, in run
self.import_corrections()
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 232, in import_corrections
db.execute(stmt, binds)
sqlite3.IntegrityError: UNIQUE constraint failed: Station.system_id, Station.name

Cloned td via git in case it was an error via the zip version but still same response :( Is it just me seeing this?
 
I don't have the latest git version - I'll get it and have a look.

------UPDATE------

Mmm. I updated TD and ran import - worked OK. (I do keep some of my data files though)

Maybe try doing a buildcache before the import:
Code:
trade buildcache -fi

Continuing testing I made a new directory and used a vanilla TD from the git. Then ran the following 3 commands:
Code:
trade import -P maddavo -O corrections,stations,shipvendors,exportcsv,usefull,force
trade import -P maddavo -O corrections,stations,shipvendors,exportcsv,use2d,force
trade import -P maddavo -O corrections,stations,shipvendors,exportcsv,use3h,force

This WORKED OK.

The only thing I can think is maybe something might still be hanging around your data directory? I'm not sure where the corrections.csv file goes when it is D/L'd - maybe get rid of the old one if it is there.
 
Last edited:
Hi,

I have question / suggestion about the edscupdate.py

Is there any possibility to send new data like "oneliner"

Code:
python3 edscupdate.py --cmdr boozeman --oneliner "HR 406" "373.64, 427.01, 398.63, 537.18, 427.12"

Where those distances are from Sol, New Yembo, Vesuvit, HIP 79884 and Asellus Australis.

I get the distances on galaxy map, draw them on paper and then write them on spreadsheet. After a long exploration trip I just want to run some csv-file in a do-while loop here.

Erroreous entries can be write on error.log for manual updating, checking, etc :)
 
Last edited:
Hi,

I have question / suggestion about the edscupdate.py

Is there any possibility to send new data like "oneliner"

Code:
python3 edscupdate.py --cmdr boozeman --oneliner "HR 406" "373.64, 427.01, 398.63, 537.18, 427.12"

Where those distances are from Sol, New Yembo, Vesuvit, HIP 79884 and Asellus Australis.

I get the distances on galaxy map, draw them on paper and then write them on spreadsheet. After a long exploration trip I just want to run some csv-file in a do-while loop here.

Erroreous entries can be write on error.log for manual updating, checking, etc :)

Try using "submit-distances.py" instead :) But no, it still doesn't support allowing you to input the distances like that. Both tools are reliant on prompting - you submit the names of places and it asks you to verify the distances.
 
Last edited:
Sadly no, still

NOTE: Importing Corrections
Traceback (most recent call last):
File "trade.py", line 104, in <module>
main(sys.argv)
File "trade.py", line 77, in main
results = cmdenv.run(tdb)
File "C:\Temp\TradeDangerous\commands\commandenv.py", line 80, in run
return self._cmd.run(results, self, tdb)
File "C:\Temp\TradeDangerous\commands\import_cmd.py", line 124, in run
if not plugin.run():
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 708, in run
self.import_corrections()
File "C:\Temp\TradeDangerous\plugins\maddavo_plug.py", line 232, in import_corrections
db.execute(stmt, binds)
sqlite3.IntegrityError: UNIQUE constraint failed: Station.system_id, Station.name

Cloned td via git in case it was an error via the zip version but still same response :( Is it just me seeing this?

I too am getting this error both before and after updating TD this morning
 
I too am getting this error both before and after updating TD this morning

Update:I've fixed this by first running

Code:
trade.py import --plug maddavo --opt=csvonly,shipvendors,stations,systems

i.e. everything bar corrections. I immediately then ran

Code:
trade.py import --plug maddavo --opt csvs,csvonly

Corrections ran correctly this time, and since then the error has gone?
 
Something bad crept in for sure. As above I cleared my data dir manually at Davo's suggestion and did a full update. It's all working nicely and noticeably faster than before.
 
After you clone from git, your first step should be:

Code:
trade.py buildcache -fi
or
Code:
trade.py buildcache -fiq

I think we've reached a point where I should make '-i' a default behavior and simply introduce a flag to disable it (although I can't remember the last time I wanted TD to *not* do -i).
 
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.
 
Back
Top Bottom