Status when starting a new project on Chat GPT
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user