Build a performance analysis service that analysis profit/loss and other metrics of a trading system

Job ID: 34985103

Budget: €250 – €750 EUR

IMPORTANT: If you are interested in this project please describe in your own words what you need to do for this project so that I see if you understand the task. Applications that dont have that will be ignored.

The following shall be implemented in Python /you can use NumPy or other frameworks that may be helpful.

1) Implement a class that is responsible for performance metrics. Each method will get a list of (Meta-)Orders (will send class definition later - it is a class that defines a trade incl. price, quantity, etc. ) that need to be analyzed.
Each method shall be unit tested with 100% code coverage. You will need to implement a method that generates some dummy data for testing purposes (later the data will come from DB - I will implement that)

In the performance metrics please calculate:
1) get_pnl(orders, is_percent, granularity) #granularity means iE daily, hourly, 10min, etc. and basically groups the PnL for each period. if is_percent is True then calculate relative PnL else absolute numbers
1.1) get_pnl_excluding_fees(orders, is_percent, granularity) # dont substract fees from profits
2) get_execution_ratio(orders, granularity) #Get the % of orders executed vs cancelled again with granularity
3) get_sharpe_ratio(orders) # Calculate the Sharpe Ratio for the orders (use PnL method) See Python implementation here: https://www.quantstart.com/articles/Sharpe-Ratio-for-Algorithmic-Trading-Performance-Measurement/
4) get_max_drawdown(orders, granularity) # Get the biggest drawdown per day/hour/etc
5) get_max_profit(orders, granularity) # Get the biggest profit per day/hour/etc

There should be second class for calculating some other metrics that you will also test as the performance metrics class:
1) get_avg_liquidity_supplied(orders,granularity) #Calculate the how much volume there is per hours/minute/day/etc submitted in orders (iE open/partiallyfilled orders)
2) get_volatility_of_market(tickers, granularity) #Calcualte the vola of an asset over a tiemframe with granulairty. See https://www.wikihow.com/Calculate-Historical-Stock-Volatility
3) get_num_of_executed_buys_vs_sells_in_timeframe(orders,granularity) #Calculate the number of FILLED/EXECUTED buy and sell orders per timeframe (iE hourly/daily/etc)

NOTE: All methods should be able to calculate any timeframe and also the absolute numer (iE PnL for the entire set of orders)