Skip to content

Commit

Permalink
Fix usage of an item from BTContainer in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hroff-1902 committed Feb 11, 2020
1 parent da03c36 commit 29f7c50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/optimize/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, List, NamedTuple
from typing import Dict, List, NamedTuple, Optional

import arrow
from pandas import DataFrame
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/optimize/test_backtest_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 29f7c50

Please sign in to comment.