Skip to content
All hypotheses

Hypotheses

Freqtrade 'Supertrend' by @juankysoriano (Juan Carlos Soriano), faithful port: triple-Supertrend long-only entry/exit with stepped ROI table, -26.5% trailing stoploss, on LINKUSDT.BINANCE_SPOT 1h

Faithful line-for-line translation of the Freqtrade open-source strategy 'Supertrend' (https://github.com/freqtrade/freqtrade-strategies/blob/f3340ce11f5bdf62f598522e64d1f5638eaa13f5/user_data/strategies/Supertrend.py,…

Hypothesis

Faithful line-for-line translation of the Freqtrade open-source strategy 'Supertrend' (https://github.com/freqtrade/freqtrade-strategies/blob/f3340ce11f5bdf62f598522e64d1f5638eaa13f5/user_data/strategies/Supertrend.py, GPL-3.0, author @juankysoriano / Juan Carlos Soriano, who gets the credit). The original runs on 1h candles and goes long only. It enters when three 'buy' Supertrend indicators all read 'up' and leaves when three separate 'sell' Supertrend indicators all read 'down'. Exits also come from a stepped……Show moreShow less

Faithful line-for-line translation of the Freqtrade open-source strategy 'Supertrend' (https://github.com/freqtrade/freqtrade-strategies/blob/f3340ce11f5bdf62f598522e64d1f5638eaa13f5/user_data/strategies/Supertrend.py, GPL-3.0, author @juankysoriano / Juan Carlos Soriano, who gets the credit). The original runs on 1h candles and goes long only. It enters when three 'buy' Supertrend indicators all read 'up' and leaves when three separate 'sell' Supertrend indicators all read 'down'. Exits also come from a stepped minimal-ROI table, a -26.5% stoploss and the trailing-stop settings. The parameter values are the hyperopted defaults in buy_params/sell_params. These override the IntParameter defaults (4/14): buy (multiplier, period) = (4,8), (7,9), (1,8); sell (multiplier, period) = (1,16), (3,18), (6,18). VENUE CHOICE: the original is a long-only, unlevered Freqtrade strategy, i.e. spot. Platform routing therefore puts it on BINANCE_SPOT (CASH, 0.10% taker per side, ~0.20% RT). The instrument is LINKUSDT.BINANCE_SPOT 1-HOUR (catalog has bars from 2019-01-16 to 2026-10-01, ~67k bars). We chose LINK instead of BTC because BTC is ~44-62% of the corpus and LINK spot has no recorded use. LINK is also volatile enough that the 8.7% / 5.8% / 2.9% ROI targets are reachable within the ROI time windows. SUPERTREND DEFINITION (technical.indicators.supertrend, per freqtrade-strategies issue #30 comment 853042401), computed per (multiplier m, period p): TR = TA-Lib TRANGE (max(high-low, |high-prev_close|, |low-prev_close|)); ATR = simple moving average of TR over p bars (SMA, NOT Wilder smoothing); basic_ub = (high+low)/2 + m*ATR; basic_lb = (high+low)/2 - m*ATR. final_ub and final_lb start at 0.0. For i >= p: final_ub[i] = basic_ub[i] if (basic_ub[i] < final_ub[i-1] or close[i-1] > final_ub[i-1]) else final_ub[i-1]; final_lb[i] = basic_lb[i] if (basic_lb[i] > final_lb[i-1] or close[i-1] < final_lb[i-1]) else final_lb[i-1]. ST starts at 0.0. For i >= p: if ST[i-1]==final_ub[i-1] and close[i] <= final_ub[i] then ST=final_ub[i]; elif ST[i-1]==final_ub[i-1] and close[i] > final_ub[i] then ST=final_lb[i]; elif ST[i-1]==final_lb[i-1] and close[i] >= final_lb[i] then ST=final_lb[i]; elif ST[i-1]==final_lb[i-1] and close[i] < final_lb[i] then ST=final_ub[i]; else 0.0. Direction STX = 'down' if ST>0 and close<ST; 'up' if ST>0 and close>=ST; empty/undefined (neither up nor down) if ST<=0 or not yet warmed up. IMPLEMENTATION NOTE: the original computes all 630 hyperopt-range combinations in populate_indicators. That is only for the hyperopt search. The developer must compute ONLY the 6 used Supertrends, each as an O(1) incremental state machine (rolling TR deque for the SMA plus prev final_ub/final_lb/ST/close). Do NOT recompute over history each bar: recent sandbox_timeout deaths came from exactly that. Equality tests ST[i-1]==final_ub[i-1] should compare against the stored previous value (same float object semantics, i.e. track which band ST is on with a state flag equivalent to the equality). CAVEAT: the source does `_, stx = ftt.supertrend(...)` and its docstring says the call returns a (value, direction) tuple. If the installed `technical` version returns a DataFrame instead, the unpacking would yield column names. We translate the documented intent (the direction series), not that possible library mismatch. Performance claims of the original (hyperopted with ShortTradeDurHyperOptLoss on 2021+ data) are treated as unverified; our fee-inclusive backtest decides.

Analysis

Supertrend

Backtest and paper results are hypothetical. Trading involves risk of loss.