fixes, old way to handle strategies
This commit is contained in:
@ -7,8 +7,10 @@ class MaCrossStrategy(BaseStrategy):
|
||||
A strategy based on a fast Simple Moving Average (SMA) crossing
|
||||
a slow SMA.
|
||||
"""
|
||||
def __init__(self, strategy_name: str, params: dict, log_level: str):
|
||||
super().__init__(strategy_name, params)
|
||||
# --- FIX: Changed 3rd argument from log_level to trade_signal_queue ---
|
||||
def __init__(self, strategy_name: str, params: dict, trade_signal_queue):
|
||||
# --- FIX: Passed trade_signal_queue to the parent class ---
|
||||
super().__init__(strategy_name, params, trade_signal_queue)
|
||||
self.fast_ma_period = self.params.get('short_ma') or self.params.get('fast') or 0
|
||||
self.slow_ma_period = self.params.get('long_ma') or self.params.get('slow') or 0
|
||||
|
||||
@ -26,4 +28,3 @@ class MaCrossStrategy(BaseStrategy):
|
||||
df.loc[df['fast_sma'] < df['slow_sma'], 'signal'] = -1
|
||||
|
||||
return df
|
||||
|
||||
|
||||
Reference in New Issue
Block a user