question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moving your config to work with MACD

See original GitHub issue

TLDR;

Add this to the bottom of your config to use the new method, comment out method = MACD to method = percentile. if you don’t use MarketAnalysis you don’t need to do anything.

[MarketAnalysis]
analyseCurrencies = BTC
lendingStyle = 75
MACD_long_win_seconds = 1800
percentile_seconds = 259200

[Daily_min] 
method = MACD
multiplier = 1.05

Moving your config to work with MACD

There are loads of docs around this, so you can read more then once it’s all merged.

This is just a quick note of what’s changed between the releases and how to get back up and running as quickly as possibly.

FAQ

Q: What is this? A: A new method of working out the best rate to lend at. It analyses the moving average and calculates the rate accordingly.

Q: Why should I use this? A: To get better lending rates. At certain times I’ve found this to give vastly superior lending rates than the old percentile method. It uses a method similar to this: http://www.investopedia.com/terms/g/goldencross.asp

Q: Does it work on Poloniex and Bitfinex? A: Yes, though bitfinex still needs some work to get the same volume of data as Polo as we don’t have a coach for it yet.

Q: How can I get more information? A: The docs have loads of information, and I’m usually on Slack.

Differences

If you are moving an old config over, you can compare to the default.cfg.example

Things you may notice (Only applicable if using MarketAnalysis):

  1. There are no text files saved in market_data anymore, only sqlite3 databases
  2. Increased network activity as more data is recorded
  3. A small increase in memory usage
  4. Decreased disk usage in the market_data folder. The DB is more efficient even though we store more data.
  5. You need to have numpy and pandas installed pip install -r requirements.txt

Config changes:

  1. There is a new section called [MarketAnalysis] if you don’t want to analyse the market for better rates, ignore this issue completely and nothing will change for you. If you do want to, it needs be in your config.
  2. There is another new section called [Daily_min] if you want to use the old percentage style analysis you can ignore this section. If you want to use the new MACD style (which generally seems to provide better rates), you need this section.
  3. lendingStyle (used for percentile analysis) has been moved to [MarketAnalysis]
  4. analyseMaxAge has been renamed keep_history_seconds and moved to [MarketAnalysis]
  5. Although analyseMaxAge was rename, in the previous iteration it was used to delete old data as well as server as the time period to calculate from, this time period is now controlled via percentile_seconds
  6. analyseUpdateInterval has been removed, the coach is now used to record data as often as possible.
  7. analyseCurrencies has move to the [MarketAnalysis] section

Config

Minimum required to use MACD:

  1. [MarketAnalysis] section containing:
analyseCurrencies = BTC
lendingStyle = 75
MACD_long_win_seconds = 1800
percentile_seconds = 259200
  1. [Daily_min] section containing:
method = MACD
multiplier = 1.05

Further

There are a lot more tweaks you can carry out and recommended configs in the docs. Turning off hidecoins is probably one of the better ones I’ve found to use.

Hopefully people can play around with the settings and see what works for them. You can start by changing the window sizes. Then changing the multiplier.

I try to aim to keep about 95% - 100% of currency on loan. This way you know you are not lending at too low a rate and always beating the market when you loan.

Special thanks to @kimp on Slack for helping out so much with testing.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
utdrmaccommented, Sep 4, 2017
$ rm -f market_data/*
...
[MarketAnalysis]
analyseCurrencies = BTC,BCH,ETH
lendingStyle = 85
MACD_long_win_seconds = 1800
percentile_seconds = 86400
ma_debug_log = True
keep_history_seconds = 95040

[Daily_min]
method = MACD
multiplier = 1.05

Will report back in a couple hours.

1reaction
utdrmaccommented, Sep 3, 2017
[root@gasgiant bitfinex]# df -lh
Filesystem      Size  Used Avail Use% Mounted on
udev             10M  4.0K   10M   1% /dev
/dev/md0        4.0G  2.7G  1.2G  71% /
tmpfs           495M     0  495M   0% /dev/shm
tmpfs           495M  3.7M  491M   1% /run
tmpfs           248M  1.1M  246M   1% /run/lock
tmpfs           495M     0  495M   0% /sys/fs/cgroup
/dev/md127      2.8T  2.1T  715G  75% /data
/dev/md127      2.8T  2.1T  715G  75% /home
/dev/md127      2.8T  2.1T  715G  75% /apps
/dev/md127      2.8T  2.1T  715G  75% /run/nfs4/data/media

pip freeze: http://termbin.com/8g06

[root@gasgiant bitfinex]# ls -lrth /usr/src/bitfinex/
total 44K
-rw-r--r-- 1 root root 1.1K Aug  7 09:54 LICENSE
-rw-r--r-- 1 root root  518 Aug  7 09:54 docker-compose.yaml
-rw-r--r-- 1 root root  538 Aug  9 17:35 Dockerfile
-rw-r--r-- 1 root root 3.2K Aug  9 17:35 README.md
-rw-r--r-- 1 root root 7.8K Sep  1 10:34 default.cfg.example
drwxr-xr-x 1 root root  254 Sep  1 10:34 docs
-rw-r--r-- 1 root root   38 Sep  1 10:34 requirements.txt
drwxr-xr-x 1 root root  200 Sep  1 10:34 www
drwxr-xr-x 1 root root  100 Sep  1 10:34 tests
drwxr-xr-x 1 root root  180 Sep  1 18:03 plugins
-rwxr-xr-x 1 root root 6.0K Sep  1 19:02 lendingbot.py
-rw-r--r-- 1 root root 7.1K Sep  1 21:56 default.cfg
drwxr-xr-x 1 root root  934 Sep  1 21:56 modules
drwxr-xr-x 1 root root  216 Sep  2 11:08 market_data
[root@gasgiant bitfinex]#
[root@gasgiant bitfinex]# ls -lrth /usr/src/bitfinex/market_data/
total 9.2M
-rw-r--r-- 1 root root  212 Aug  7 09:54 readme.txt
-rw-r--r-- 1 root root  36K Sep  1 21:57 loan_history.sqlite3
-rw-r--r-- 1 root root 1.7M Sep  2 11:08 ETH.db
-rw-r--r-- 1 root root 1.1M Sep  2 11:08 BCH.db
-rw-r--r-- 1 root root    0 Sep  2 11:08 BCH.db-wal
-rw-r--r-- 1 root root  32K Sep  2 11:08 BCH.db-shm
-rw-r--r-- 1 root root    0 Sep  2 11:08 ETH.db-wal
-rw-r--r-- 1 root root  32K Sep  2 11:08 ETH.db-shm
-rw-r--r-- 1 root root 2.4M Sep  2 11:44 BTC.db
-rw-r--r-- 1 root root 4.0M Sep  2 12:01 BTC.db-wal
-rw-r--r-- 1 root root  32K Sep  2 12:02 BTC.db-shm

Config: http://termbin.com/leqf

Read more comments on GitHub >

github_iconTop Results From Across the Web

MACD Trading Strategy - How to Implement Indicator settings
Learn all about the indicator settings for the MACD trading strategy. ... MACD stands for Moving Average Convergence Divergence. It is a ......
Read more >
MACD settings to make the most of your trades - DailyFX
This article takes a brief look at the MACD and the general MACD settings before expanding on how the MACD can be altered...
Read more >
How to Trade the MACD - Investopedia
Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of ...
Read more >
Use MACD With This SPECIAL Settings... BEST ... - YouTube
This MACD settings can be used for intraday trading, and the best result ... *Complete Guide To Moving Average: https://youtu.be/YAP-i_5KTv0 ...
Read more >
Part 4 - Configuring and Using MACD to Trade - YouTube
In the fourth video of our 8 part series, Michael J DiGioia talks about the Moving Average Convergence Divergence indicator.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found