Giter Site home page Giter Site logo

ninjabot-portfolio-balancer's Introduction

Ninjabot Portfolio Balancer

Example of strategy that balances a given portfolio with weights.

Related Discussion: rodrigo-brito/ninjabot#65

Downloading Data

ninjabot download --pair BTCUSDT --timeframe 1d --days 365 --output ./data/btc.csv
ninjabot download --pair ETHUSDT --timeframe 1d --days 365 --output ./data/eth.csv
ninjabot download --pair DOTUSDT --timeframe 1d --days 365 --output ./data/dot.csv
ninjabot download --pair ADAUSDT --timeframe 1d --days 365 --output ./data/ada.csv

How to execute

go run main.go

Teorical Wallet

20% of BTC
20% of ETH
20% of DOT
20% of ADA
20% of USDT (free cash)

The strategy will buy or sell each week to balance the portfolio.

Backtest result

INFO[2021-11-19 22:45] [SETUP] Using paper wallet                   
INFO[2021-11-19 22:45] [SETUP] Initial Portfolio = 1000.000000 USDT 
+---------+--------+-----+------+---------+--------+---------+----------+
|  PAIR   | TRADES | WIN | LOSS |  % WIN  | PAYOFF | PROFIT  |  VOLUME  |
+---------+--------+-----+------+---------+--------+---------+----------+
| ETHUSDT |     24 |  24 |    0 | 100.0 % |  0.000 |  755.49 |  2747.22 |
| ADAUSDT |     22 |  22 |    0 | 100.0 % |  0.000 | 1293.77 |  3982.54 |
| BTCUSDT |     19 |  15 |    4 | 78.9 %  |  1.185 |  220.34 |  3471.36 |
| DOTUSDT |     24 |  19 |    5 | 79.2 %  |  8.688 |  990.18 |  4027.96 |
+---------+--------+-----+------+---------+--------+---------+----------+
|   TOTAL |     89 |  80 |    9 |  89.9 % |  2.596 | 3259.78 | 14229.09 |
+---------+--------+-----+------+---------+--------+---------+----------+

--------------
WALLET SUMMARY
--------------
619.457127 ADA = 948.361987 USDT
0.019902 BTC = 1819.799873 USDT
26.713543 DOT = 2450.025785 USDT
0.272265 ETH = 3010.440556 USDT

TRADING VOLUME
ADAUSDT        = 3982.54 USDT
BTCUSDT        = 3471.36 USDT
DOTUSDT        = 4027.96 USDT
ETHUSDT        = 2747.22 USDT

1249.341469 USDT
--------------
START PORTFOLIO = 1000.00 USDT
FINAL PORTFOLIO = 4259.78 USDT
GROSS PROFIT    =  3259.782025 USDT (325.98%)
MARKET (B&H)    =  784.12%
MAX DRAWDOWN    =  -37.48 %
VOLUME          =  14229.09 USDT
COSTS (0.001*V) =  14.23 USDT (ESTIMATION) 
--------------

image

ninjabot-portfolio-balancer's People

Contributors

rodrigo-brito avatar

Stargazers

Robert - Long Street Labs avatar farik avatar  avatar Ramil Amerzyanov avatar vedasky.z avatar Roman avatar Oscar Baudenay avatar Anton Dvorson avatar Victor avatar Jorge Luna avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

obtfx ee3316 ezquant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.