
Trata-se de uma estratégia de negociação automatizada baseada na identificação de padrões de preços de gráficos. A estratégia toma decisões de negociação principalmente através da identificação de padrões de preços duplos e duplos no mercado, monitorando a movimentação dos preços por meio da definição de períodos de tempo específicos e executando automaticamente as instruções de negociação quando surgem padrões de preços qualificados.
A lógica central da estratégia é identificar o duplo topo e o duplo fundo do mercado por meio de métodos de análise técnica. A implementação inclui os seguintes passos-chave:
Esta é uma estratégia de negociação automatizada concebida de forma razoável e prática. Ao identificar com precisão as formas de dupla base e dupla cima no mercado, combinada com uma configuração de parâmetros flexível e um mecanismo de controle de vento perfeito, é capaz de capturar efetivamente as oportunidades de reversão de curto prazo do mercado. Embora haja alguns riscos, a estratégia tem potencial de se tornar uma ferramenta de negociação confiável com otimização e aperfeiçoamento contínuos.
/*backtest
start: 2024-12-04 00:00:00
end: 2024-12-11 00:00:00
period: 3m
basePeriod: 3m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Double Bottom and Top Hunter", overlay=true)
// Parametreler
length = input.int(100, title="Dönem Uzunluğu", defval=100)
lookback = input.int(100, title="Geriye Dönük Kontrol Süresi", defval=100)
// İkili Dip ve Tepe Bulma
low1 = ta.lowest(low, length)
high1 = ta.highest(high, length)
low2 = ta.valuewhen(low == low1, low, 1)
high2 = ta.valuewhen(high == high1, high, 1)
doubleBottom = (low == low1 and ta.lowest(low, lookback) == low1 and low == low2)
doubleTop = (high == high1 and ta.highest(high, lookback) == high1 and high == high2)
// İşlem Açma Koşulları
longCondition = doubleBottom
shortCondition = doubleTop
// İşlem Kapatma Koşulları
closeLongCondition = ta.highest(high, length) > high1 and low < low1
closeShortCondition = ta.lowest(low, length) < low1 and high > high1
// İşlem Açma
if (longCondition)
strategy.entry("Long", strategy.long, qty=1)
if (shortCondition)
strategy.entry("Short", strategy.short, qty=1)
// İşlem Kapatma
if (closeLongCondition)
strategy.close("Long")
if (closeShortCondition)
strategy.close("Short")
// Grafik Üzerinde Göstergeler ve ZigZag Çizimi
plotshape(series=longCondition, title="İkili Dip Bulundu", location=location.belowbar, color=color.green, style=shape.labelup, text="LONG")
plotshape(series=shortCondition, title="İkili Tepe Bulundu", location=location.abovebar, color=color.red, style=shape.labeldown, text="SHORT")
// var line zigzagLine = na
// if (doubleBottom or doubleTop)
// zigzagLine := line.new(x1=bar_index[1], y1=na, x2=bar_index, y2=doubleBottom ? low : high, color=doubleBottom ? color.green : color.red, width=2)
// Zigzag çizgisini sürekli güncelleme
// line.set_xy1(zigzagLine, bar_index[1], na)
// line.set_xy2(zigzagLine, bar_index, doubleBottom ? low : high)