Open MarceloLP1 opened 5 years ago
You can just call append_csv
, but the important parameter here to give is param_locs
, which must fit your csv file. There are example csv-files in the folder examples/example_csv/
and their corresponding param_locs can be found close to the top of the file ccgains/trades.py
.
Upon import, for every line in your csv, a Trade
object is created with these parameters in the given order:
kind, dtime, buy_currency, buy_amount, sell_currency, sell_amount, fee_currency='', fee_amount=0, exchange='', mark='', comment='', default_timezone=None)
If your csv has the same amount of columns in the same order, you can just use the default param_locs=range(0, 11)
. There is also an explanation at the top of ccgains/trades.py
, just above the example param_locs.
If it is not clear, please feel free to ask further help. You could also send me an example csv or the header, then we could create the param_locs toghether.
Hi Jurgen.
Many thanks for the fast answer. My idea it's to trait to use your program to calc the capital gain using LIFO model, to then calc my local tax. Other important info it's that I need to process my trade's from my brocker anually report. How I need to do, to send a example .csv file, to undertand the info that I need to process. thanks. M.
Hi, I want to use a custom trade file, in format csv, may be you have some example of csv-file and how to custom the append_csv. [ append_csv(file_name, param_locs=range(0, 11), delimiter=’, ’, skiprows=1, de-fault_timezone=None) ] My idea it's to use your sw to calc the capital gain of trade [ future, options, stocks...], that I export the info in csv format from my broker site. Many thanks.