From 779a4e841984d09d2f2f248f26e639f0993b4ff5 Mon Sep 17 00:00:00 2001 From: FemtoTrader Date: Mon, 13 Feb 2023 10:44:01 +0100 Subject: [PATCH] Using is_deployed to switch from backtest to live --- bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index f0b030e..8f3643f 100644 --- a/bot.py +++ b/bot.py @@ -43,8 +43,8 @@ def rsi_price_event(price, symbol, state: StrategyState): strategy.add_price_event(rsi_price_event, symbol='BTC-USDT', resolution='1h', init=init) strategy.add_price_event(rsi_price_event, symbol='ETH-USDT', resolution='1h', init=init) -results = strategy.backtest(to='2y', initial_values={'USDT': 10000}) -print(results) - -# Take this strategy live by uncommenting this line -# strategy.start() \ No newline at end of file +if blankly.is_deployed: + strategy.start() +else: + results = strategy.backtest(to='2y', initial_values={'USDT': 10000}) + print(results)