Align interfaces and strategy templates

This commit is contained in:
Matthias
2022-05-07 11:55:49 +02:00
parent 3f68c3b68e
commit f1a72e448a
7 changed files with 20 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
from datetime import datetime
from typing import Optional
import talib.abstract as ta
from pandas import DataFrame
@@ -151,7 +152,8 @@ class StrategyTestV2(IStrategy):
return dataframe
def adjust_trade_position(self, trade: Trade, current_time: datetime, current_rate: float,
current_profit: float, min_stake: float, max_stake: float, **kwargs):
current_profit: float,
min_stake: Optional[float], max_stake: float, **kwargs):
if current_profit < -0.0075:
orders = trade.select_filled_orders('buy')

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
from datetime import datetime
from typing import Optional
import talib.abstract as ta
from pandas import DataFrame
@@ -185,7 +186,8 @@ class StrategyTestV3(IStrategy):
return 3.0
def adjust_trade_position(self, trade: Trade, current_time: datetime, current_rate: float,
current_profit: float, min_stake: float, max_stake: float, **kwargs):
current_profit: float,
min_stake: Optional[float], max_stake: float, **kwargs):
if current_profit < -0.0075:
orders = trade.select_filled_orders(trade.entry_side)