
ALLIGATOR, MFI, AO, ATR, DCA
¿La estrategia tradicional de apuestas a ciegas compra a tiempo?Construcción de una posición por capas en la línea K de la inversión de la línea K solo cuando se confirman las señales técnicasLos datos de retrospectiva muestran que este método tiene una rentabilidad ajustada al riesgo más del 30% que la inversión tradicional de tiempo fijo.
La lógica central es sencilla y brutal:Bajo la línea del tiburón + punto mínimo de reversión + precio de cierre por encima del precio medio = señal de compraNo todas las líneas K merecen tu dinero, solo las que cumplen con estas tres condiciones merecen tu dinero.
La lógica de la estratificación es bastante ingeniosa:
Las expectativas son buenas, pero la realidad es cruel.Si juzga mal, sus pérdidas aumentarán en la proporción 1:2:4:8. Esta no es una estrategia diseñada para cobardes.
Sistema de línea de pesca(13/8/5 ciclos) Asegurarse de buscar oportunidades de reversión solo en una clara tendencia bajista. El precio debe estar debajo de la boca del tiburón, una condición que filtra directamente el 80% de las señales falsas.
El Awesome Oscillator tiene un margen negativo.Asegúrese de que el motor se está debilitando y evite tomar el relevo cuando el motor se acelera.
MFI exprimiendo la línea KEl aumento del volumen de transacciones pero el estrechamiento del intervalo de precios es una señal de que el juego de dinero es intenso.
Pruebas de realidadLa estrategia puede provocar una serie de señales erróneas, incluso con un triple filtro.
La suspensión está configurada a un costo promedio + 2 veces el ATR, un diseño bastante inteligente.El ajuste dinámico de ATR significa que las horas de parada de la oscilación son largas y las horas de parada de la oscilación son cercanas。
La retrospectiva histórica muestra que el parón de 2 veces el ATR es capaz de capturar entre el 60 y el 70% de las principales tendencias de rebote, evitando al mismo tiempo que la avaricia excesiva provoque el retroceso de las ganancias. Sin embargo, en un mercado bajista unilateral, este parón puede no alcanzarse nunca.
El peso de las posiciones se distribuye de 1:2:4:8, con un peso total de 15. Esto significa:
La lógica de este diseñoSi el nivel 4 se activa y continúa bajando, se enfrenta a una gran pérdida de liquidez.
Esta estrategia funciona mejor en las siguientes situaciones:
Es un escenario absolutamente inapropiado.:
El mayor riesgoSi el mercado continúa bajando y no hay rebote después de que los cuatro niveles de DCA se activen, se enfrentará a una retirada de más del 30% de sus cuentas.
El retroceso histórico no representa ganancias futuras│ esta estrategia ha tenido un mal desempeño en el mercado bajista de las criptomonedas en 2022, con una serie de señales de activación, pero el precio sigue bajando │
Es necesario un control riguroso de los riesgosLa inversión máxima de una sola estrategia no debe exceder el 20% del capital total y debe establecerse un límite máximo de pérdidas de retiro a nivel de cuenta.
en conclusiónEs una estrategia matemáticamente ingeniosa y lógicamente razonable, pero que se debe usar en el entorno de mercado correcto. No es una panacea, y mucho menos una impresora.
//@version=6
strategy(title = "Bullish Divergent Bar DCA Strategy [Skyrexio]",
shorttitle = "BDB DCA",
overlay = true,
pyramiding = 4,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 10,
initial_capital = 10000,
currency = currency.USD)
//_______ <constant_declarations>
var const color skyrexGreen = color.new(#2ECD99, 0)
//________<variables declarations>
var float bullBarConfirmationLevel = na
var float bullBarInvalidationLevel = na
var float takeProfitLevel = na
var bool isTrueBullishReversalBar = false
var float layer1 = na
var float layer2Treshold = na
var float layer3Treshold = na
var float layer4Treshold = na
var int currentLayer = 0
//_______ <inputs>
showDcaLevels = input.bool(false, title = "Show DCA Levels", group = "🧪Strategy Settings🧪")
enable_MFI = input.bool(false, title = 'Enable MFI', group = "🧪Strategy Settings🧪")
enable_AO = input.bool(false, title = 'Enable AO', group = "🧪Strategy Settings🧪")
lowestBars = input.int(defval=7, step=1, minval=1, maxval=20, title="Number Of Bar For Lowest Bar", group = "🧪Strategy Settings🧪")
layer2TresholdPercent = input.float(defval=4.0, step=0.5, maxval=100.0, minval=0.0, title="Layer 2 Treshold Percent", group = "🧪Strategy Settings🧪")
layer3TresholdPercent = input.float(defval=10.0, step=0.5, maxval=100.0, minval=0.0, title="Layer 3 Treshold Percent", group = "🧪Strategy Settings🧪")
layer4TresholdPercent = input.float(defval=22.0, step=0.5, maxval=100.0, minval=0.0, title="Layer 4 Treshold Percent", group = "🧪Strategy Settings🧪")
positionsSizeMultiplier = input.float(defval=2.0, step=0.5, minval=1.0, maxval=4.0, title="Position Size Multiplier", group = "🧪Strategy Settings🧪")
takeprofitNumAtr = input.float(defval=2.0, step=0.5, minval=0.5, maxval=10.0, title="Number Of ATR For Take Profit", group = "🧪Strategy Settings🧪")
isLowestBar = ta.lowest(lowestBars) == low
//_______ <function_declarations>
smma(src, length) =>
var float smma = na
sma_value = ta.sma(src, length)
smma := na(smma) ? sma_value : (smma * (length - 1) + src) / length
smma
isBullishReversalBar() =>
close > hl2 and isLowestBar
getLayerEquityQty(mult, layer, price) =>
float sumW = 1.0 + mult + math.pow(mult, 2) + math.pow(mult, 3)
float wCur = math.pow(mult, layer)
float pct = wCur / sumW
float cap = strategy.equity * pct
float qty = cap / price
math.max(qty, 0.001) // 确保最小数量
//_______ <calculations>
atr = ta.atr(14)
//Calculating MFI
MFI = (high - low) / volume
PreMFI = (high[1] - low[1]) / volume[1]
squatbar = (MFI < PreMFI) and (volume > volume[1])
//Calculating Awesome Oscillator
ao = ta.sma(hl2, 5) - ta.sma(hl2, 34)
diff = ao - ao[1]
//Calculating Alligator
jaw = smma(hl2, 13)[8]
teeth = smma(hl2, 8)[5]
lips = smma(hl2, 5)[3]
// 重置信号状态
isTrueBullishReversalBar := false
//Calculating the bullish reversal bars
bool baseCondition = isBullishReversalBar() and high < jaw and high < teeth and high < lips
if enable_AO and enable_MFI
isTrueBullishReversalBar := baseCondition and diff < 0 and (squatbar or squatbar[1] or squatbar[2])
else if enable_AO and not enable_MFI
isTrueBullishReversalBar := baseCondition and diff < 0
else if not enable_AO and enable_MFI
isTrueBullishReversalBar := baseCondition and (squatbar or squatbar[1] or squatbar[2])
else
isTrueBullishReversalBar := baseCondition
// 设置确认和失效价位
if isTrueBullishReversalBar
bullBarConfirmationLevel := high
bullBarInvalidationLevel := low
// 检查失效
isBullBarInvalidated = ta.crossunder(low, bullBarInvalidationLevel)
if isBullBarInvalidated
bullBarConfirmationLevel := na
bullBarInvalidationLevel := na
// Defining current DCA layer
if strategy.opentrades == 1 and strategy.opentrades[1] == 0
layer1 := strategy.position_avg_price
currentLayer := 1
if strategy.opentrades == 2 and strategy.opentrades[1] == 1
currentLayer := 2
if strategy.opentrades == 3 and strategy.opentrades[1] == 2
currentLayer := 3
if strategy.opentrades == 4 and strategy.opentrades[1] == 3
currentLayer := 4
if strategy.opentrades == 0
currentLayer := 0
layer1 := na
// Tresholds price from layer1
layer2Treshold := na(layer1) ? na : layer1 * (100 - layer2TresholdPercent) / 100
layer3Treshold := na(layer1) ? na : layer1 * (100 - layer3TresholdPercent) / 100
layer4Treshold := na(layer1) ? na : layer1 * (100 - layer4TresholdPercent) / 100
//Calculating take profit level
takeProfitLevel := strategy.opentrades > 0 ? strategy.position_avg_price + atr * takeprofitNumAtr : na
// ------- 入场逻辑 -------
// Layer 1 入场
if currentLayer == 0 and isTrueBullishReversalBar and not na(bullBarConfirmationLevel)
float qty1 = getLayerEquityQty(positionsSizeMultiplier, 0, bullBarConfirmationLevel)
strategy.entry(id = 'entry1', direction = strategy.long, stop = bullBarConfirmationLevel, qty = qty1)
// Layer 2 入场
if currentLayer == 1 and not na(layer2Treshold) and low < layer2Treshold and isTrueBullishReversalBar and not na(bullBarConfirmationLevel)
float qty2 = getLayerEquityQty(positionsSizeMultiplier, 1, bullBarConfirmationLevel)
strategy.entry(id = 'entry2', direction = strategy.long, stop = bullBarConfirmationLevel, qty = qty2)
// Layer 3 入场
if currentLayer == 2 and not na(layer3Treshold) and low < layer3Treshold and isTrueBullishReversalBar and not na(bullBarConfirmationLevel)
float qty3 = getLayerEquityQty(positionsSizeMultiplier, 2, bullBarConfirmationLevel)
strategy.entry(id = 'entry3', direction = strategy.long, stop = bullBarConfirmationLevel, qty = qty3)
// Layer 4 入场
if currentLayer == 3 and not na(layer4Treshold) and low < layer4Treshold and isTrueBullishReversalBar and not na(bullBarConfirmationLevel)
float qty4 = getLayerEquityQty(positionsSizeMultiplier, 3, bullBarConfirmationLevel)
strategy.entry(id = 'entry4', direction = strategy.long, stop = bullBarConfirmationLevel, qty = qty4)
// ------- 出场逻辑 -------
if strategy.opentrades > 0 and not na(takeProfitLevel)
strategy.exit(id = 'exit1', from_entry = 'entry1', limit = takeProfitLevel)
strategy.exit(id = 'exit2', from_entry = 'entry2', limit = takeProfitLevel)
strategy.exit(id = 'exit3', from_entry = 'entry3', limit = takeProfitLevel)
strategy.exit(id = 'exit4', from_entry = 'entry4', limit = takeProfitLevel)
// ------- 绘图 -------
plot(takeProfitLevel, color=skyrexGreen, style=plot.style_linebr, linewidth=2, title="Take Profit")
plot(showDcaLevels ? layer1 : na, color=color.orange, title="Layer 1")
plot(showDcaLevels ? layer2Treshold : na, color=color.orange, title="Layer 2")
plot(showDcaLevels ? layer3Treshold : na, color=color.orange, title="Layer 3")
plot(showDcaLevels ? layer4Treshold : na, color=color.orange, title="Layer 4")
// 调试标签(可删除)
plotshape(isTrueBullishReversalBar, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)