• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

CoinAlpha/pnl-analysis: Jupyter notebook to calculate trading profit and loss

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

CoinAlpha/pnl-analysis

开源软件地址:

https://github.com/CoinAlpha/pnl-analysis

开源编程语言:

Jupyter Notebook 82.2%

开源软件介绍:

Trading Performance

This notebook retrieves your trade data from Binance to calculate the pnl from your trading.

The methodology for calculating PNL is:

  1. Calculate the total amount of net base asset purchased (or sold) and the total amount of quote asset spent (or received)
  2. Calculate the value of these changes based on current asset spot price
  3. Calculate the value of the fees paid out in the trades

Note that this methodology is one way of trying to evaluate the benefit if your trading activity, i.e. doing something versus doing nothing. This does not capture any changes in portfolio value due to general market movements that may result in the appreciation of the value of base assets and quote assets.

Requirements

  • Python 3.x

    pip install -r requirements.txt

    jupyter lab

Usage

Method 1 :

clone the repo, open the jupyter notebook, fill keys, run the notebook locally

Method 2 :

Go to colab : https://colab.research.google.com/notebooks/intro.ipynb?utm_source=scs-index#recent=true
open from github

Method 3 :

Use a ready to go collab notebook(recommanded) :
https://drive.google.com/file/d/1Z6Q0tX7Czj4w0FnliSiqmi-qUG9AfPeI/view?usp=sharing

Instructions

Step 0) Select Runtime => Run all

Step 1) Input your read only API keys

Step 2) Input trading pair and start date

Step 3) click start

Notes

  • % gain and loss is based on your current balance of base and quote asset. This may not be a comprehensive figure if (1) you have made deposits/withdrawals within the period being analyzed, and (2) if you are trading multiple pairs with overlapping base and quote assets

Supported Exchanges:

  • binance
  • kucoin
  • ascendex

Comments / bugs / suggestions

Please email [email protected].
Please email [email protected].




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap