Create script for analysing trade logs files.
Usage:
tradelog [-h|--help] [FILTER] [COMMAND] [LOG [LOG ...]]
If no arguments are provided, the script just prints logs to stdout
.
Only one command per run is supported.
list-tick
- prints list of all the tickersprofit
- prints total profitpos
- prints values of holding positions sorted by pricelast-price
- prints the last known price for every tickerhist-ord
- prints histogram of the count of transactions of ticker- in case
-w
argument is not provided, one transaction is represented by one#
character, otherwise-w
is the count of#
characters in line with maximum value (maximum value/2
is represented byWIDTH/2
#
characters)
- in case
graph-pos
- prints histogram version ofpos
-w
argument specifies maximum width graph. That means, line with maximum value is represented by 100% ofWIDTH
. In case-w
is not provided, every character should represent the value of1000
.- Positive values are represented by character
#
and negative values are represented by!
.
-
-a DATETIME
- filters transactions after provided date(YYYY-MM-DD HH:MM:SS)
-
-b DATETIME
- filters transactions before provided date(YYYY-MM-DD HH:MM:SS)
-
-t TICKER
- filters transactions for providedTICKER
-
-w WIDTH
- sets maximum width of generated graphs byhist-ord
andgraph-pos
commands- only one
-w
argument in arguments is allowed, exit with error in case of multiple-w
arguments
- only one
-
-h|--help
- prints help, then exits with exit code0
The program should process logs compressed in .gz
files also.
In case no files are provided in arguments, the program reads stdin
.
Do not modify/delete provided files.
DATETIME;TICKER;TRANSACTION TYPE;UNIT PRICE;CURRENCY;VOLUME;ID
- Format of
DATETIME
isYYYY-MM-DD HH:MM:SS
TICKER
is name articleTICKER
could not contains whitespace(s) or;
TRANSACTION TYPE
- type of transaction (sell
/buy
) decimal dot is represented as.
CURRENCY
- code of currency (EUR
,USD
, ...)VOLUME
- represents the value of units in a transactionID
not rated yet