
이 전략은 Jancok Strategycs v3라고 불리며, 이동 평균 (MA), 이동 평균 수렴 스캐들 (MACD), 상대적으로 강한 지표 (RSI) 및 평균 실제 범위 (ATR) 를 기반으로 한 다중 지표 트렌드 추적 전략입니다. 이 전략의 주요 아이디어는 여러 지표의 조합을 사용하여 시장 추세를 판단하고 트렌드 방향으로 거래하는 것입니다.
이 전략은 다음의 네 가지 지표를 사용하여 시장의 흐름을 판단합니다.
이 전략의 거래 논리는 다음과 같습니다.
“Jancok Strategycs v3”은 다중 지표 조합을 기반으로 한 트렌드 추적 전략으로, 이동 평균, MACD, RSI 및 ATR과 같은 지표를 통해 시장 추세를 판단하고, 동적 스톱 손실 및 추적 스톱 손실과 같은 위험 관리 수단을 사용하여 위험을 제어하고 수익을 최적화한다. 이 전략의 장점은 트렌드 판단 정확도가 높고, 위험 관리는 유연하고 적응력이 강하다. 그러나 가짜 신호, 파라미터 설정 민감성 및 블랙 스윙 사건과 같은 특정 위험도 존재한다.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 1h
basePeriod: 15m
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/
// © financialAccou42381
//@version=5
strategy("Jancok Strategycs v3", overlay=true, initial_capital=100, currency="USD")
// Inputs
short_ma_length = input.int(9, title="Short MA Length", minval=1)
long_ma_length = input.int(21, title="Long MA Length", minval=1)
atr_multiplier_for_sl = input.float(2, title="ATR Multiplier for Stop Loss", minval=1.0)
atr_multiplier_for_tp = input.float(4, title="ATR Multiplier for Take Profit", minval=1.0)
volume_ma_length = input.int(20, title="Volume MA Length", minval=1)
volatility_threshold = input.float(1.5, title="Volatility Threshold", minval=0.1, step=0.1)
use_trailing_stop = input.bool(false, title="Use Trailing Stop")
trailing_stop_atr_multiplier = input.float(2.5, title="Trailing Stop ATR Multiplier", minval=1.0)
// Calculating indicators
short_ma = ta.sma(close, short_ma_length)
long_ma = ta.sma(close, long_ma_length)
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
atr = ta.atr(14)
volume_ma = ta.sma(volume, volume_ma_length)
volatility = atr / close
// Plotting indicators
plot(short_ma, color=color.red)
plot(long_ma, color=color.blue)
// Defining entry conditions with added indicators and filters
long_condition = ta.crossover(short_ma, long_ma) and (macdLine > signalLine) and (volume > volume_ma) and (volatility < volatility_threshold)
short_condition = ta.crossunder(short_ma, long_ma) and (macdLine < signalLine) and (volume > volume_ma) and (volatility < volatility_threshold)
// Entering trades with dynamic stop loss and take profit based on ATR
if (long_condition)
strategy.entry("Long", strategy.long)
if use_trailing_stop
strategy.exit("Exit Long", "Long", trail_points=atr * trailing_stop_atr_multiplier, trail_offset=atr * 0.5)
else
strategy.exit("Exit Long", "Long", loss=atr * atr_multiplier_for_sl, profit=atr * atr_multiplier_for_tp)
if (short_condition)
strategy.entry("Short", strategy.short)
if use_trailing_stop
strategy.exit("Exit Short", "Short", trail_points=atr * trailing_stop_atr_multiplier, trail_offset=atr * 0.5)
else
strategy.exit("Exit Short", "Short", loss=atr * atr_multiplier_for_sl, profit=atr * atr_multiplier_for_tp)