Fisher变换动态阈值趋势跟踪策略基于Fisher变换指标来识别价格趋势的变化。该策略使用Fisher变换将价格归一化到一个标准尺度,以便更容易地检测潜在的趋势反转点。通过动态调整阈值,该策略能够适应不同的市场条件,提高趋势识别的准确性。当Fisher变换值越过正负阈值时,策略会产生买卖信号,以跟踪市场趋势。
Fisher变换动态阈值趋势跟踪策略通过Fisher变换指标和动态阈值,识别价格趋势的变化,自适应不同的市场状态。该策略能够较好地捕捉市场趋势,实现趋势跟踪交易。策略的优势在于动态阈值调整、减少价格噪音干扰以及直观的图表展示。但同时也存在参数优化风险、趋势识别滞后、震荡市表现欠佳、极端行情风险等问题。通过参数优化、信号过滤、止损止盈、仓位管理等措施,可以进一步提升该策略的稳健性和盈利能力。
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Qiuboneminer - Fisher Transform", overlay=true)
// Parámetros
Len = input.int(10, minval=1)
mult1 = input.int(1, minval=1)
threshold = 2.6
// Función Fisher Transform
fish(Length, timeMultiplier) =>
var float nValue1 = na
var float nFish = na
xHL2 = hl2
xMaxH = ta.highest(xHL2, Length * timeMultiplier)
xMinL = ta.lowest(xHL2, Length * timeMultiplier)
nValue1 := 0.33 * 2 * ((xHL2 - xMinL) / (xMaxH - xMinL) - 0.5) + 0.67 * nz(nValue1[1])
nValue2 = if nValue1 > 0.99
0.999
else if nValue1 < -0.99
-0.999
else
nValue1
nFish := 0.5 * math.log((1 + nValue2) / (1 - nValue2)) + 0.5 * nz(nFish[1])
nFish
// Cálculo del Fisher Transform para mult1
Fisher1 = fish(Len, mult1)
// Condiciones de entrada y salida
longCondition = Fisher1 > nz(Fisher1[1]) and nz(Fisher1[1]) <= nz(Fisher1[2]) and Fisher1 < -threshold
shortCondition = Fisher1 < nz(Fisher1[1]) and nz(Fisher1[1]) >= nz(Fisher1[2]) and Fisher1 > threshold
// Estrategia de entrada
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Ploteo del Fisher Transform
plot(Fisher1, color=(Fisher1 > nz(Fisher1[1]) ? color.rgb(34, 255, 0) : color.rgb(255, 0, 212)), title="Fisher TF:1")
// Ploteo de líneas de umbral
hline(threshold, "Umbral Superior", color=color.rgb(255, 0, 0), linestyle=hline.style_dotted)
hline(-threshold, "Umbral Inferior", color=#008704, linestyle=hline.style_dotted)