From 5d71f14d4ddb316d0503a25c4cddd0317019c906 Mon Sep 17 00:00:00 2001 From: Shile Wen <55765642+shilewenuw@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:33:30 -0700 Subject: [PATCH 1/2] updated readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a1b847..98cef2e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Want to be able to easily log trades of any type of security and measure perform - drawdown: vertical distance between peak and trough of net profits - volatility of returns: measures deviation of returns distribution - kurtosis: measures tails of returns distribution - - probability of winning on a trade: self-explanatory - Kelly Criterion: estimate of optimal portfolio allocation - And more - visualize performance: @@ -40,7 +39,7 @@ Returns a tuple in the format (# shares, position size), position size is (# sha ``` get_positions() ``` -Returns a dict of current security holdings in form of {security: {'shares': # shares, 'avg_share_price': average share price1}, another_security: {'shares': # shares, 'avg_share_price': average share price1}, ...}, where the key corresponding to a security is the string passed through the log() method. +Returns a dict of current security holdings in form of {security: {'shares': # shares, 'position_size': position size}, another_security: {'shares': # shares, 'position_size': position size}, ...}, where the key corresponding to a security is the string passed through the log() method. *** ``` clear_all_positions(get_price_func, closure_date) From 7b864d922c304261a68b07776d329d8534e42abf Mon Sep 17 00:00:00 2001 From: Shile Wen <55765642+shilewenuw@users.noreply.github.com> Date: Thu, 30 Apr 2020 21:34:03 -0700 Subject: [PATCH 2/2] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 98cef2e..77db9f6 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,8 @@ print(logger.get_positions()) # example of how to use clear_all_positions(), # replace get_price() with a real api call or any other price getter -def get_price(security, dt): - return len(security) + dt.timetuple().tm_yday +fake_api_method = lambda security, dt: len(security) + dt.timetuple().tm_yday +get_price = lambda security, dt: fake_api_method(security, dt) logger.clear_all_positions(get_price, datetime.today()) # shows the statistics in a graphs in a pop up window. since it calls plt.show()