From 255a43c98e75d18fe0a6bc04c513467c7ce85ffe Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 25 Apr 2020 17:25:18 +0200 Subject: [PATCH] Update price timeout example --- docs/strategy-advanced.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index dcb8018f9..39e92d651 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -56,7 +56,6 @@ class Awesomestrategy(IStrategy): !!! Note For the above example, `unfilledtimeout` must be set to something bigger than 24h, otherwise that type of timeout will apply first. - ### Custom order timeout example (using additional data) ``` python @@ -77,7 +76,7 @@ class Awesomestrategy(IStrategy): ob = self.dp.orderbook(pair, 1) current_price = ob['bids'][0][0] # Cancel buy order if price is more than 2% above the order. - if order['price'] > current_price * 1.02: + if current_price > order['price'] * 1.02: return True return False @@ -86,7 +85,7 @@ class Awesomestrategy(IStrategy): ob = self.dp.orderbook(pair, 1) current_price = ob['asks'][0][0] # Cancel sell order if price is more than 2% below the order. - if order['price'] < current_price * 0.98: + if current_price < order['price'] * 0.98: return True return False ```