Closed maledicente closed 6 months ago
I've been having a bit of trouble getting leverage callback to work with the overlay strategies so let me know how you get on. Need to include 'optional' for the lev callback.
On Wed, Dec 13, 2023 at 9:55 AM Luiz Paulo Nievola @.***> wrote:
I intend to create TS_Wavelet_FFT for future 3x, any tips?
— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/42, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXXUNNIRLV2LENYBMK5VSPLYJDAEZAVCNFSM6AAAAABASDA34CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTQNJTGY3TKNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I include IntParameter to hyper
leverage_optimize = False
can_short = False
leverage_num = IntParameter(low=1, high=5, default=3, space='sell', optimize=leverage_optimize)
def leverage(self, pair: str, current_time: datetime, current_rate: float,
proposed_leverage: float, max_leverage: float, side: str,
**kwargs) -> float:
return self.leverage_num.value
lev_callback it is not a mandatory method but you can include
def lev_callback(self, pair: str, timeframe: str, current_price: float, **kwargs) -> Optional[float]:
# Cauculo da alavancagem
lev = self.calculate_leverage(pair, timeframe, current_price)
# Check if the leverage level is within the limits
if lev > self.exchange.max_leverage:
lev = None
return lev
So did you put the lev callback in the overlay strat?
I find if you run it in the TS_Predict base class it won't run in the overlay.
On Wed, Dec 13, 2023 at 1:32 PM Luiz Paulo Nievola @.***> wrote:
image.png (view on web) https://github.com/nateemma/strategies/assets/39028554/d2e2a138-c901-4091-942f-f53593c47722
— Reply to this email directly, view it on GitHub https://github.com/nateemma/strategies/issues/42#issuecomment-1853077543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXXUNNNKI2LWJI43X6VSKFLYJDZQJAVCNFSM6AAAAABASDA34CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTGA3TONJUGM . You are receiving this because you commented.Message ID: @.***>
I put in TS_Predict, works
I intend to create TS_Wavelet_FFT for future 3x, any tips?