Skip to content

Commit

Permalink
feat: add --maxage to sell command
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeonus committed May 11, 2024
1 parent 02ac0c6 commit ab34568
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tradedangerous/commands/sell_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
metavar='N.NN',
type=float,
),
ParseArgument('--age', '--max-days-old', '-MD',
help = 'Maximum age (in days) of trade data to use.',
metavar = 'DAYS',
type = float,
dest = 'maxAge',
),
AvoidPlacesArgument(),
PadSizeArgument(),
MutuallyExclusiveGroup(
Expand Down Expand Up @@ -165,6 +171,9 @@ def run(results, cmdenv, tdb: TradeDB):
continue
if station.system in avoidSystems:
continue
maxAge, stnAge = cmdenv.maxAge, station.dataAge or float("inf")
if maxAge and stnAge > maxAge:
continue

row = ResultRow()
row.station = station
Expand Down

0 comments on commit ab34568

Please sign in to comment.