wilsonfreitas / awesome-quant

A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
https://wilsonfreitas.github.io/awesome-quant/
17.54k stars 2.58k forks source link

Transaction Analysis #143

Open kuatroka opened 1 year ago

kuatroka commented 1 year ago

Hi, before asking this question, I did try to look for the tool I need in the list, but I couldn't find it.

I'm looking for transaction performance analysis tool in Python. Something where I could input a spreadsheet, CSV file, or dataframe with the real open/buy/sell/add/reduce/exit transactions and have the tool spit out the performance metrics on those transactions. Like what was the best transaction in terms of P/L what was the worst one, how many transactions were there? What was the longest? What was the shortest one, etc. What I do find multiple tools that create a portfolio metrics on a forecasted/ephemeral by and hold strategy, but not based on real transaction history. Any help in identifying such a tool would be very much appreciated. Thanks

femtotrader commented 1 year ago

Did you have a look at https://github.com/cuemacro/tcapy it's an Open source TCA (transaction cost analysis) Python library for FX spot

kuatroka commented 1 year ago

Just eyeballing it, it looks more like a transaction cost (brokerage, slippage, etc) analysis and not the P/L analysis. I need the latter. In any case, I'll check it too. Thanks

ikamanu commented 1 year ago

Sharing a thought:

I needed something similar. My need was to generate comprehensive reports for my transaction log after a backtest. I wanted to plot things like trade duration, P/L distribution by day of week (and hour of day), etc.

I couldn't find a tool so i asked ChatGPT to generate python code for me that did what I needed. I described my needs in a few paragraphs, and it worked like a charm. I highly recommend trying it.

Good luck.