Fix usage of an item from BTContainer in tests

This commit is contained in:
hroff-1902 2020-02-11 04:17:10 +03:00
parent da03c36875
commit 29f7c5071b
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
from typing import Dict, List, NamedTuple
from typing import Dict, List, NamedTuple, Optional
import arrow
from pandas import DataFrame
@ -30,7 +30,7 @@ class BTContainer(NamedTuple):
profit_perc: float
trailing_stop: bool = False
trailing_only_offset_is_reached: bool = False
trailing_stop_positive: float = None
trailing_stop_positive: Optional[float] = None
trailing_stop_positive_offset: float = 0.0
use_sell_signal: bool = False

View File

@ -364,7 +364,7 @@ def test_backtest_results(default_conf, fee, mocker, caplog, data) -> None:
default_conf["trailing_stop"] = data.trailing_stop
default_conf["trailing_only_offset_is_reached"] = data.trailing_only_offset_is_reached
# Only add this to configuration If it's necessary
if data.trailing_stop_positive:
if data.trailing_stop_positive is not None:
default_conf["trailing_stop_positive"] = data.trailing_stop_positive
default_conf["trailing_stop_positive_offset"] = data.trailing_stop_positive_offset
default_conf["ask_strategy"] = {"use_sell_signal": data.use_sell_signal}