In-Development TradeDangerous: power-user trade optimizer

It's because I was using "stock_level > 0" as a constraint on loading the data, ugh!

Ah, and I thought it's because there is no stock available. What about:
Code:
if item.stock > 0 and item.stock < maxQty:
in tradecalc.py, line 172?

Fixed, committed & pushed. Grab the latest version and you won't have the problem.

Thanks for the quick fix. I changed the exported prices.tmp to include all fields and also update the timestamp/demand/stock.

I see you have added a new switch "--full" for the "nav" calculation. Does the "run" adapt to the quantity of the cargo? It doesn't look like it, because it's suggesting "BD+47 2112 -> AULIN" with full cargo in my cobra, which isn't possible.

Anyway, thanks for the calculator and open source it. It's much appreciated.
 

wolverine2710

Tutorial & Guide Writer
I'm still using TD. Thankfully they day FD changed there policy I had emdn-tap.py so I have the most up to date data. Still making a lot of money. There are a few routes which do have changed. I wanted to update my .prices file but I'm a bit baffled what each column means. Especially the columns which end with L3, L2. Would it be possible for you to explain what each column represents?
 

wolverine2710

Tutorial & Guide Writer
@all. Does perhaps someone have a .prices file with the latest emdn-tap entries AND additional changes to reflect the current prices. If so I would appreciate it if you could share that file. I can upload my latest .prices file should some one be interested in it.
 
I'm still using TD. Thankfully they day FD changed there policy I had emdn-tap.py so I have the most up to date data. Still making a lot of money. There are a few routes which do have changed. I wanted to update my .prices file but I'm a bit baffled what each column means. Especially the columns which end with L3, L2. Would it be possible for you to explain what each column represents?

The columns are
name, sell, buy, timestamp, demand "L" demandlevel, stock "L" stocklevel
 
Code:
@ ACIHAUT/Cuffey Plant
   + Chemicals
      Hydrogen Fuels             47     48   2014-09-22 04:00:01 demand       0L0 stock  645104L3
      Mineral Oil               163      0   2014-09-22 04:00:01 demand   26551L2 stock       0L0
      Explosives                147    163   2014-09-22 04:00:01 demand       0L0 stock   63298L1
      --------------         ------ ------   ------------------- ---------------- ---------------
      name                     sell    buy   timestamp                     demand          supply

name      .. the name of the item
sell      .. the credits you get when you sell the item
buy       .. the credits you have to pay for the item
timestamp .. date and time of the update (format: YYYY-MM-DD HH:MM:SS)
demand    .. the demand of the item (format: demand xxxxxxxLy)
             xxxxxxx .. the quantity of the demand
             y       .. the level of the demand, 0=NONE, 1=LOW, 2=MED, 3=HIGH
supply    .. the stock of the item (format: stock xxxxxxxLy)
             xxxxxxx .. the quantity of the stock
             y       .. the level of the stock, 0=NONE, 1=LOW, 2=MED, 3=HIGH
 

wolverine2710

Tutorial & Guide Writer
Code:
@ ACIHAUT/Cuffey Plant
   + Chemicals
      Hydrogen Fuels             47     48   2014-09-22 04:00:01 demand       0L0 stock  645104L3
      Mineral Oil               163      0   2014-09-22 04:00:01 demand   26551L2 stock       0L0
      Explosives                147    163   2014-09-22 04:00:01 demand       0L0 stock   63298L1
      --------------         ------ ------   ------------------- ---------------- ---------------
      name                     sell    buy   timestamp                     demand          supply

name      .. the name of the item
sell      .. the credits you get when you sell the item
buy       .. the credits you have to pay for the item
timestamp .. date and time of the update (format: YYYY-MM-DD HH:MM:SS)
demand    .. the demand of the item (format: demand xxxxxxxLy)
             xxxxxxx .. the quantity of the demand
             y       .. the level of the demand, 0=NONE, 1=LOW, 2=MED, 3=HIGH
supply    .. the stock of the item (format: stock xxxxxxxLy)
             xxxxxxx .. the quantity of the stock
             y       .. the level of the stock, 0=NONE, 1=LOW, 2=MED, 3=HIGH

@Gazelle and Codec. Thanks a lot commanders. Somehow I missed that info...
 
Ah, and I thought it's because there is no stock available. What about:
Code:
if item.stock > 0 and item.stock < maxQty:
in tradecalc.py, line 172?

Well, three problems - if you were in a Cobra you'd need see stations that had 36 fish or 37 fish (that's two of the problems) and you'd still not see stations that had -1 to indicate "unknown" :)

I see you have added a new switch "--full" for the "nav" calculation. Does the "run" adapt to the quantity of the cargo? It doesn't look like it, because it's suggesting "BD+47 2112 -> AULIN" with full cargo in my cobra, which isn't possible.

The cargo calculator assumes you have a full load, but what it can't account for is the weight of your outfitting - the default C2 laser adds weight. And it doesn't do any adaptive stuff yet.

I probably want to add a config system that lets you describe your ship so that you don't have to keep specifying it.
 
I'm still using TD. Thankfully they day FD changed there policy I had emdn-tap.py so I have the most up to date data. Still making a lot of money. There are a few routes which do have changed. I wanted to update my .prices file but I'm a bit baffled what each column means. Especially the columns which end with L3, L2. Would it be possible for you to explain what each column represents?

If you just care about prices, it's

trade.py update --notepad Aulin

and then I set it up to look like the columns in-game. It remembers the order of items so you can shuffle them around to match the order they show up in-game.

I personally like to use Sublime Text, but if you want to use something like notepad++ or something you can use "--editor" and tell it where the editor is.
 

wolverine2710

Tutorial & Guide Writer
Thanks for the reply. Yesterday I edited the "Trade Dangerous.prices" file which works but changing the data and perhaps stock/demand is more time consuming then just filling in the selling/buying prices with trade.py update.

I've tested the last method this morning. my observations:

  1. trade.py update aulin --notepad. Works fine.
  2. trade.py update aulin --editor "C:\Program Files (x86)\Notepad++\notepad++.exe". Open notepad++, on the prompt it shows the command finishing directly and I see the following message: "- No changes detected - doing nothing. Briljant!". The file stays open in notepad++ but after a while it detects that the file no longer exists. Perhaps the way notepad++ works.
  3. trade.py aulin --notepad. When I edit ONE commodity and save and I look at the trade dangerous.prices file I notice that the timestamp for ALL commodities for that station have changed. Hence it makes it impossible for me to detect later what I did change manually.
  4. Related to 3 but probably by design. Using trade.py updates resets all stock/demand to -1L-1

May I ask what the design reason for point 3 is?
 
Last edited:
2. trade.py update aulin --editor "C:\Program Files (x86)\Notepad++\notepad++.exe". Open notepad++, on the prompt it shows the command finishing directly and I see the following message: "- No changes detected - doing nothing. Briljant!". The file stays open in notepad++ but after a while it detects that the file no longer exists. Perhaps the way notepad++ works.
That's because notepad++ is running asynchronous and returns immediately after the command is executed. Maybe there is a commandline options to not do this? I don't have notepad++ but after a quick look at the online help you may try: "-multiInst -nosession"

3. trade.py aulin --notepad. When I edit ONE commodity and save and I look at the trade dangerous.prices file I notice that the timestamp for ALL commodities for that station have changed. Hence it makes it impossible for me to detect later what I did change manually.
The importer only checks if you have changed the file and not if you have changed a line inside the file. All items inside the file will be imported with a new timestamp. If you want your own timestamp you will need to add this inside the file. I have changed the trade.py so that it will export all columns with the update command:
trade.py, line 535 from
Code:
prices.dumpPrices(args.db, file=tmpFile, stationID=stationID, debug=args.debug)
to
Code:
prices.dumpPrices(args.db, withModified=True, file=tmpFile, stationID=stationID, debug=args.debug)
WARNING: If you delete an item in the file it will also be deleted in the database!

4. Related to 3 but probably by design. Using trade.py updates resets all stock/demand to -1L-1
That's because you didn't supply the numbers. -1 means "I don't know"
 

wolverine2710

Tutorial & Guide Writer
@gazelle. Thanks for the all the information. Have played with TD all day. Kfsone has created a very nice and extremely fast tool.
 
Last edited:
I'm going to be scarce this week, on-boarding at a new job. If you grab the latest TradeDangerous.sql, I've added a half dozen new stations. If you look in data/TradeDangerous.sql you can see how its done. What I'm missing are stars =/ That's going to be a bit more interesting, and will either need to be done by triangulation (that is, for each new star, find the distance to 3 or is it 4, other known stars).

I saw there was a discussion between gazelle/wolverine but I didn't read it yet guys, sorry.

I may have time to stop and take a look Sunday.

-Oliver
 

Harbinger

Volunteer Moderator
I'm going to be scarce this week, on-boarding at a new job. If you grab the latest TradeDangerous.sql, I've added a half dozen new stations. If you look in data/TradeDangerous.sql you can see how its done. What I'm missing are stars =/ That's going to be a bit more interesting, and will either need to be done by triangulation (that is, for each new star, find the distance to 3 or is it 4, other known stars).

I saw there was a discussion between gazelle/wolverine but I didn't read it yet guys, sorry.

I may have time to stop and take a look Sunday.

-Oliver

Thanks for the tool, I've been using it to keep a personal log of prices as I travel in Beta 2.

A couple of things I've noticed since the update:

Gallium and Beryllium were both moved from Minerals to Metals.

The cargo space of ships is no longer set in stone. I've only personally got as far as a hauler so far but by default that vessel now has an 8 tonne cargo space. You can increase this by upgrading or replacing modules so perhaps a feature to define cargo space via the command line would be useful. (I've been editing it manually in the sql file)
 

Harbinger

Volunteer Moderator
Extra systems courtesy of the coordinates on the spreadsheet Michael Brookes released:

http://pastebin.com/MQD1Afkn

NOTE: Index 270 (Training) and Index 271 (Destination) should be removed. I think Micheal Brookes included them in the spreadsheet as they have bases but they doesn't exist in the playable galaxy. They're only used in the tutorials.

I actually had them both come up in route planning ;)

Code:
trade.py nav --ship hauler --full --ly 7.37 eranin wyrd
From ERANIN to WYRD with 7.37ly per jump limit.
System                         (Jump Ly)
----------------------------------------
ERANIN                         (   0.00)
TRAINING                       (   2.40)
AULIN                          (   5.51)
BD+47 2112                     (   7.16)
WYRD                           (   5.12)

Code:
trade.py nav --ship hauler --full --ly 7.53 asellusprimus aulin
From ASELLUS PRIMUS to AULIN with 7.53ly per jump limit.
System                         (Jump Ly)
----------------------------------------
ASELLUS PRIMUS                 (   0.00)
DESTINATION                    (   6.88)
AULIN                          (   4.95)
 
Last edited:

ShadowGar

Banned
I started to add in systems, stations and prices and then realized a huge issue.

Brookes didn't give us all of the systems. Those systems in the list all have markets in them.

I flew to the other side of the bubble and have been logging those markets. Problem is that you have to jump to non-market systems to get to the next market systems. As that we don't have data..no routes will populate.
 
We have that under way to scope out the new systems. If you want to help please add data.
Use this form to submit readings
https://docs.google.com/forms/d/10YY66ZnpJph8PvyKIFOYcv6amvRHq79SFSybZzQAZE8/viewform

The most optimal way, is to jump to one of these intermediate systems that we don't have coordinates for, and then enter the distances to preferrably 5 or 6 known systems picked from the galactic map. We can then solve some equations and triangulate exactly where this system is. You can throw in some unknown distances too if you like, more data is more power!
 
Back
Top Bottom