
Die Double Bottom Reverse Average DCA-Gitterstrategie verwendet hauptsächlich die lineare Preisreversie und die DCA-Strategie, um die Grid-Positionierung schrittweise zu realisieren. Es beurteilt die Reversimöglichkeiten anhand der Double Bottom Reverse-Form.
Die Strategie beginnt damit, zu beurteilen, ob die K-Linie zwei aufeinanderfolgende Bottom-of-the-Wall-Preise hat, die gleich sind, was als “double bottom” bezeichnet wird. Wenn ein Double-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-Bottom-
Konkret wird zunächst der ATR-Wert der letzten 14 K-Linien über ta.atr berechnet, der dann in Kombination mit den letzten 5 K-Linien berechnet wird, um die Preisschwankungen zu ermitteln. Dies ist der Hauptparameter, der verwendet wird, um den Grid-Bereich zu bestimmen. Der Grid-Bereich ist in 4 Preispunkte unterteilt, nämlich Basispreis + Schwankungen, Basispreis + 0,75-fache Schwankungen, und so weiter.
Die Strategie setzt außerdem eine Stop-Loss- und eine Stop-Out-Position ein. Der Stop-Loss-Preis ist der Mindestpreis für die doppelte Basis - Minimum Bounce-Bereich, der Stop-Preis ist das Fünffache des Einstiegspreises + ATR-Indikator. Beide Preise werden in Echtzeit aktualisiert, wenn die Position nicht 0 ist.
Diese Strategie hat folgende Vorteile:
Die wichtigsten Risiken sind:
Die Strategie kann auch in folgenden Richtungen optimiert werden:
Die DCA-Gitterstrategie mit doppeltem Bottom-Reverse-Even-Line verwendet verschiedene technische Mittel, darunter Preisform, Even-Line-Indikator und Gitterhandel. Sie bietet Vorteile wie die Genauigkeit der Urteilszeit, Kostenkontrolle und Rücknahme-Schutz. Die Optimierungsmöglichkeiten für die Strategie sind groß und verdienen eine gründliche Untersuchung und Anwendung.
/*backtest
start: 2024-02-12 00:00:00
end: 2024-02-19 00:00:00
period: 3m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © cherepanovvsb
//@version=5
strategy("Reversal (only long)", overlay=true, margin_long=1, margin_short=1,initial_capital=1000,commission_type = strategy.commission.percent,commission_value =0.1,currency='USD', process_orders_on_close=true)
plotshape(low == low[1], style=shape.triangleup, location=location.belowbar, color=color.blue, title="1 Setup")
plotshape(low == low[1] and low[1]==low[2], style=shape.triangleup, location=location.belowbar, color=color.red, title="Triple Setup")
ATRlenght = input.int(title="ATR length for taking profit", defval=14, group="Strategy Settings")
rewardMultiplier= input.int(title="ATR multiplier", defval=5, group="Strategy Settings")
Volatility_length=input.int(title='Volatility length',defval=5,group="Strategy Settings")
Volatility_multiplier=input.float(title='Volatility multiplier',defval=0.5,step=0.1, group="Strategy Settings")
Candles_to_wait=input.int(title='How many candles to wait after placing orders grid?',defval=4,group="Strategy Settings")
// Get ATR
atr1 = ta.atr(ATRlenght)
//Get volatility values (not ATR)
float result = 0
for i = 0 to Volatility_length
result+=high[i]-low[i]
volatility=result*Volatility_multiplier/Volatility_length
//Validate entrance points
validlow = low [2]== low[1] and not na(atr1)
validlong = validlow and strategy.position_size == 0 and low[1]<low
// Calculate SL/TP
longStopPrice = low[1]-syminfo.mintick
longStopDistance = close - longStopPrice
longTargetPrice = close + (longStopDistance * rewardMultiplier)
strategy.initial_capital = 50000
//Assign all variables
var tradeStopPrice = 0.0
var tradeTargetPrice = 0.0
var point1=0.0
var point2=0.0
var point3=0.0
var point4=0.0
var contracts = int(strategy.initial_capital/close)/4
if validlong
tradeStopPrice := longStopPrice
tradeTargetPrice := longTargetPrice
point1:=low[1]+volatility
point2:=low[1]+volatility*0.75
point3:=low[1]+volatility*0.5
point4:=low[1]+volatility*0.25
strategy.entry ("Long1", strategy.long,limit=point1,qty=contracts, when=validlong)
strategy.entry ("Long2", strategy.long,limit=point2,qty=contracts, when=validlong)
strategy.entry ("Long3", strategy.long,limit=point3,qty=contracts, when=validlong)
strategy.entry ("Long4", strategy.long,limit=point4,qty=contracts, when=validlong)
stopcondition = ta.barssince(validlong) == Candles_to_wait
strategy.cancel("Long1",when=stopcondition)
strategy.cancel("Long2",when=stopcondition)
strategy.cancel("Long3",when=stopcondition)
strategy.cancel("Long4",when=stopcondition)
strategy.exit(id="Long Exit", limit=tradeTargetPrice, stop=tradeStopPrice, when=strategy.position_size > 0)
plot(strategy.position_size != 0 or validlong ? tradeStopPrice : na, title="Trade Stop Price", color=color.red, style=plot.style_linebr, linewidth=3)
plot(strategy.position_size != 0 or validlong ? tradeTargetPrice : na, title="Trade Target Price", color=color.green, style=plot.style_linebr, linewidth=3)
plot(strategy.position_size != 0? point1 : na, title="Long1", color=color.green, style=plot.style_linebr, transp=0)
plot(strategy.position_size != 0? point2 : na, title="Long2", color=color.green, style=plot.style_linebr, transp=0)
plot(strategy.position_size != 0? point3 : na, title="Long3", color=color.green, style=plot.style_linebr, transp=0)
plot(strategy.position_size != 0? point4 : na, title="Long4", color=color.green, style=plot.style_linebr, transp=0)