Skip to content

Commit

Permalink
Take rebalance threshold from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
hammertoe committed Feb 24, 2019
1 parent 2a9bf30 commit 199a5d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ $ pip install -e .
```

## Config
Create a config file in `config.ini` with definition of your exchange and portfolio percentages.
Create a config file in `config.ini` with definition of your exchange and portfolio percentages, and theshold (percent) that rebalancing is needed:

```
[binance]
api_key = <api key>
api_secret = <api secret>
threshold = 2.0
targets = XRP 40
BTC 20
ETH 20
Expand Down
2 changes: 1 addition & 1 deletion crypto_balancer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def exchange_choices():
print()

rates = fetch_rates(exch, targets.keys())
balancer = SimpleBalancer(targets, args.valuebase)
balancer = SimpleBalancer(targets, args.valuebase, threshold=float(config['threshold']))

base_values = balancer.calc_base_values(balances, rates)
total_base_value = sum(base_values.values())
Expand Down

0 comments on commit 199a5d0

Please sign in to comment.