mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-20 12:20:29 +08:00
BUG: fixed potential issue with refreshing the stats in live mode
This commit is contained in:
@@ -37,7 +37,7 @@ def initialize(context):
|
||||
context.base_price = None
|
||||
context.current_day = None
|
||||
|
||||
context.RSI_OVERSOLD = 50
|
||||
context.RSI_OVERSOLD = 55
|
||||
context.RSI_OVERBOUGHT = 65
|
||||
context.CANDLE_SIZE = '5T'
|
||||
|
||||
@@ -244,7 +244,7 @@ def analyze(context=None, perf=None):
|
||||
|
||||
if __name__ == '__main__':
|
||||
# The execution mode: backtest or live
|
||||
live = False
|
||||
live = True
|
||||
|
||||
if live:
|
||||
run_algorithm(
|
||||
|
||||
@@ -680,7 +680,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
|
||||
if new_orders != self._last_orders:
|
||||
self.performance_needs_update = True
|
||||
|
||||
self._last_orders = new_orders
|
||||
self._last_orders = copy.deepcopy(new_orders)
|
||||
|
||||
if self.performance_needs_update:
|
||||
self.perf_tracker.update_performance()
|
||||
|
||||
Reference in New Issue
Block a user