From 9685c09c1a58ff36bf1e836a15fcdbb3ca049bc9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 15 Sep 2018 20:28:36 +0200 Subject: [PATCH 1/3] Add offset to "get_trades_for_order" --- freqtrade/exchange/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index f663420e0..e3d51a16f 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -591,7 +591,8 @@ class Exchange(object): if not self.exchange_has('fetchMyTrades'): return [] try: - my_trades = self._api.fetch_my_trades(pair, since.timestamp()) + # Allow 5s offset to catch slight time offsets (discovered in #1185) + my_trades = self._api.fetch_my_trades(pair, since.timestamp() - 5) matched_trades = [trade for trade in my_trades if trade['order'] == order_id] return matched_trades From 51b3eb78d78dc2cec70c34e10b2d4e6efd53ba9e Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 15 Sep 2018 20:38:09 +0200 Subject: [PATCH 2/3] Add section about about clock accuracy to readme.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 02b870209..2b44c99ad 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,10 @@ to understand the requirements before sending your pull-requests. ## Requirements +### Uptodate clock + +The clock must be uptodate, ideally syncronized to a NTP server rather frequently. Drifting time can lead to losses. + ### Min hardware required To run this bot we recommend you a cloud instance with a minimum of: From 30ae5829f5c200b234df17a3bb8d58fad948ed68 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 16 Sep 2018 11:24:49 +0200 Subject: [PATCH 3/3] Fix SED command for macos Mac uses the bsd version, where -i without backup is not allowed. --- docs/installation.md | 2 +- install_ta-lib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 0fecfcf78..1ceda6b1c 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -267,7 +267,7 @@ Official webpage: https://mrjbq7.github.io/ta-lib/install.html wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz tar xvzf ta-lib-0.4.0-src.tar.gz cd ta-lib -sed -i "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h +sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h ./configure --prefix=/usr make make install diff --git a/install_ta-lib.sh b/install_ta-lib.sh index 18e7b8bbb..d8ae2eeaa 100755 --- a/install_ta-lib.sh +++ b/install_ta-lib.sh @@ -1,6 +1,6 @@ if [ ! -f "ta-lib/CHANGELOG.TXT" ]; then tar zxvf ta-lib-0.4.0-src.tar.gz - cd ta-lib && sed -i "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h && ./configure && make && sudo make install && cd .. + cd ta-lib && sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h && ./configure && make && sudo make install && cd .. else echo "TA-lib already installed, skipping download and build." cd ta-lib && sudo make install && cd ..