12 lines
370 B
Python
12 lines
370 B
Python
from abc import ABC, abstractmethod
|
|
from core.models import Signal
|
|
|
|
class Strategy(ABC):
|
|
name = "base"
|
|
|
|
def __init__(self, timeframe: str, params: dict):
|
|
self.timeframe, self.p = timeframe, params
|
|
|
|
@abstractmethod
|
|
def on_bar(self, symbol: str, df) -> "Signal | None":
|
|
"""df = barres clôturées uniquement. Retourne un Signal ou None."""
|