
これは海取引の法則に基づくトレンド追跡戦略である. この戦略は,トレンドの方向と取引ポジションの規模を決定するためにATR (平均リアル波幅) を使用する. 価格が過去数時間の最高価格または最低価格を破るとき,戦略はポジションを多めに開くか空にする.
この戦略の核心は,ATR指標を使用してトレンドの方向と取引のポジションの規模を決定することです.ATR指標は市場の変動を測定し,適切なストップポイントとポジションの規模を決定するのに役立ちます.戦略の主要なステップは以下のとおりです.
このようにして,この戦略は強いトレンドの動きを捉えながらも,リスクを厳密に制御することができます.ATR指標の使用は,市場変動に適応するためにポジションの規模を動的に調整するのに役立ちます.
これらのリスクに対処するために,以下のような解決策を考慮することができます.
この戦略の安定性と収益性をさらに向上させることができます.
TURTLE-ATRブリンブレイク戦略は,海取引法に基づくトレンド追跡戦略である.この戦略は,トレンドの方向と取引ポジションの規模を決定するためにATR指標を使用し,過去の一段の価格の最高値または最低値を破ってポジションを開き,トレンドが逆転するまでポジションを保持する.この戦略の優点は,強烈なトレンドの動きを捉えることができることであり,リスクを厳密に制御することです.しかし,この戦略は,トレンドの逆転,市場の揺れ,パラメータの感受性などのリスクにも直面しています.
/*backtest
start: 2023-05-28 00:00:00
end: 2024-06-02 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © luisfeijoo22
//@version=5
strategy("Estrategia de las tortugas_ES", overlay=true, pyramiding=3)
// Parámetros
atrLength = input.int(20, "Longitud del ATR")
atrFactor = input.float(2, "Factor del ATR")
entryBreakout = input.int(20, "Breakout de entrada")
exitBreakout = input.int(10, "Breakout de salida")
longOnly = input.bool(false, "Solo largos")
shortOnly = input.bool(false, "Solo cortos")
// Cálculo del ATR
atr = ta.atr(atrLength)
// Cálculo de los niveles de breakout
longEntry = ta.highest(high, exitBreakout)[1]
longExit = ta.lowest(low, exitBreakout)[1]
shortEntry = ta.lowest(low, exitBreakout)[1]
shortExit = ta.highest(high, exitBreakout)[1]
// Cálculo del tamaño de la posición
nContracts = math.floor((strategy.equity * 0.01) / (atrFactor * atr))
// Filtra las fechas según el rango deseado
// in_range = time >= timestamp(year(start_date), month(start_date), dayofmonth(start_date))
// Condiciones de entrada y salida
longCondition = not longOnly and close > longEntry and time >= timestamp("2023-03-15")
if longCondition
strategy.entry("Long", strategy.long, qty = nContracts)
shortCondition = not shortOnly and close < shortEntry and time >= timestamp("2023-03-15")
if shortCondition
strategy.entry("Short", strategy.short, qty = nContracts)
strategy.exit("Exit Long", "Long", stop = longExit)
strategy.exit("Exit Short", "Short", stop = shortExit)
// Visualización de los niveles de breakout
plot(longEntry, "Entrada larga", color.green, style = plot.style_line)
plot(longExit, "Salida larga", color.red, style = plot.style_line)
plot(shortEntry, "Entrada corta", color.green, style = plot.style_line)
plot(shortExit, "Salida corta", color.red, style = plot.style_line)