
이것은 트렌드 추적과 동적 분석을 결합한 양적 거래 전략이다. 이 전략은 삼중 지수 이동 평균 (TEMA), 다중 이동 평균 교차 및 MACD 변이 지표를 사용하여 시장 추세와 진입 시기를 식별한다. 이 전략은 고정된 중지 손실, 이익 목표 및 추적 중지 손실을 포함하여 엄격한 위험 제어 메커니즘을 채택하여 위험과 수익의 최적의 균형을 이룬다.
이 전략은 주로 세 가지 핵심 기술 지표 시스템을 통해 거래 신호를 결정합니다.
거래 신호의 트리거는 다음과 같은 조건을 동시에 충족해야 합니다.
이 전략은 여러 가지 기술 지표 시스템을 통합하여 안정적인 거래 시스템을 구축한다. 그것의 핵심 장점은 여러 가지 확인 메커니즘과 완벽한 위험 제어 시스템이다. 약간의 뒤처진 위험이 있음에도 불구하고, 매개 변수 최적화 및 기능 확장을 통해 전략은 여전히 큰 개선 공간이 있다. 안정적인 수익을 추구하는 거래자의 사용에 적합하다.
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("ITG Scalper Strategy", shorttitle="lokesh_ITG_Scalper_Strategy", overlay=true)
// General inputs
len = input(14, title="TEMA period")
FfastLength = input.int(13, title="Filter fast length")
FslowLength = input.int(18, title="Filter slow length")
FsignalLength = input.int(14, title="Filter signal length")
sl_points = 7 // 5 points stop loss
tp_points = 100 // 100 points target profit
trail_points = 15 // Trailing stop loss every 10 points
// Validate input
if FfastLength < 1
FfastLength := 1
if FslowLength < 1
FslowLength := 1
if FsignalLength < 1
FsignalLength := 1
// Get real close price
realC = close
// Triple EMA definition
ema1 = ta.ema(realC, len)
ema2 = ta.ema(ema1, len)
ema3 = ta.ema(ema2, len)
// Triple EMA trend calculation
avg = 3 * (ema1 - ema2) + ema3
// Filter formula
Fsource = close
FfastMA = ta.ema(Fsource, FfastLength)
FslowMA = ta.ema(Fsource, FslowLength)
Fmacd = FfastMA - FslowMA
Fsignal = ta.sma(Fmacd, FsignalLength)
// Plot EMAs for visual reference
shortema = ta.ema(close, 9)
longema = ta.ema(close, 15)
yma = ta.ema(close, 5)
plot(shortema, color=color.green)
plot(longema, color=color.red)
plot(yma, color=#e9f72c)
// Entry conditions
firstCrossover = ta.crossover(Fmacd, Fsignal) and avg > avg[1]
secondCrossover = ta.crossover(shortema, longema) // Assuming you meant to cross shortema with longema
thirdCrossover = ta.crossover(close, yma)
var bool entryConditionMet = false
if (firstCrossover)
entryConditionMet := true
longSignal = entryConditionMet and secondCrossover and thirdCrossover
// Strategy execution
if (longSignal)
strategy.entry("Long", strategy.long)
entryConditionMet := false // Reset the entry condition after taking a trade
// Calculate stop loss and take profit prices
var float long_sl = na
var float long_tp = na
if strategy.position_size > 0 // Long position
long_sl := close - sl_points
long_tp := close + tp_points
// Adjust stop loss with trailing logic
if (close - long_sl > trail_points)
long_sl := close - trail_points
strategy.exit("Exit Long", "Long", stop=long_sl, limit=long_tp)
// Plotting Buy signals
plotshape(series=longSignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
// Alerts
alertcondition(longSignal, title="Buy Signal", message="Buy Signal")