Status when starting a new project on Chat GPT

This commit is contained in:
DaM
2026-03-01 16:50:15 +01:00
parent 547a909965
commit 2ec51d0daa
10 changed files with 1232 additions and 510 deletions

View File

@@ -20,6 +20,8 @@ class RSIStrategy(Strategy):
overbought_threshold: Umbral de sobrecompra (default: 70)
"""
strategy_id = "rsi"
def __init__(self, rsi_period: int = 14, oversold_threshold: float = 30, overbought_threshold: float = 70):
params = {
@@ -33,7 +35,31 @@ class RSIStrategy(Strategy):
self.rsi_period = rsi_period
self.oversold = oversold_threshold
self.overbought = overbought_threshold
@classmethod
def parameters_schema(cls) -> dict:
return {
"rsi_period": {
"type": "int",
"min": 1,
"max": 200,
"default": 14,
},
"oversold": {
"type": "float",
"min": 0,
"max": 100,
"default": 30,
},
"overbought": {
"type": "float",
"min": 0,
"max": 100,
"default": 70,
},
}
def init_indicators(self, data: pd.DataFrame) -> pd.DataFrame:
"""
Calcula el RSI