이 전략은 비트 코인 및 기타 암호화폐에 적용되는 15분 시간 주기에서의 통합 거래 전략이다. 그것은 트리플 지수 이동 평균, 평균 실제 변동의 폭, 그리고 균형 라인 그래프를 포함한 여러 지표들이 구매 및 판매 신호를 생성하는 것을 통합하고, 동시에 스톱 손실과 같은 위험 관리 장치가 있다.
이 전략은 다음과 같은 여러 지표를 사용합니다.
트리플 지수 이동 평균 ((TEMA): 다양한 길이와 소스의 3 개의 TEMA를 사용하여 각각 최고점, 낮은 점 및 종결 가격을 기반으로 계산한다.
평균 실제 변동의 폭 ((ATR): EMA의 평평한 사용자 정의 ATR을 사용하여 시장 변동률을 계산한다.
트렌드 지표: ATR과 배수를 기반으로 트렌드 방향을 결정한다.
간단한 이동 평균 ((SMA): 단기 TEMA에 대한 SMA를 평형값으로 계산한다.
균형계 종식 가격: 추가 확정 트렌드에 쓰인다.
짧은 기간 TEMA가 두 개의 긴 기간 TEMA보다 높고, 초향 지표가 부진하고, 짧은 기간 TEMA가 SMA보다 높고, 균형 라인 종료 가격이 전날보다 높을 때, 구매 신호가 발생한다.
단기 TEMA가 두 개의 장기 TEMA보다 낮고, 오버 트렌드 지표가 하락하고, 단기 TEMA가 SMA보다 낮고, 평형 라인 종료 가격이 전날보다 낮을 때, 판매 신호를 생성한다.
스톱 스톱 손실은 입점 가격의 각각 1%와 3%로 설정한다. 또한 수수료 요소를 고려한다.
트렌드, 변동률, 형태 등 여러 요소 지표가 결합되어 판단의 정확도를 높여서 잘못된 신호를 피할 수 있다.
합리적인 스톱스트로드 설정은 수익을 고정시킬 수 있고, 단독 손실을 효과적으로 제한할 수 있다.
지표의 매개 변수는 시장의 변화에 따라 최적의 조합을 찾기 위해 유연하게 조정할 수 있습니다.
수수료 요소를 추가하면 재검토 결과가 실제 거래 성과에 더 가깝게 될 수 있습니다.
과다한 측정치 조합은 또한 잘못된 판단을 초래할 수 있으며, 측정치의 실효성을 신중하게 평가할 필요가 있다.
긴 주기보다 15분간 작동하는 것은 갑작스러운 사건의 영향을 더 많이 받으며, 우연한 사고의 위험이 더 크다.
이 전략은 안정성을 보장하기 위해 더 긴 기간과 여러 시장에서 검증되어야 합니다.
다중 지표 조합은 많은 변수를 가져오고, 모든 변수 조합을 최적화하는 데 시간이 오래 걸립니다.
각 지표의 실제 증진 효과를 재검토하고, 과잉 지표 사용을 피한다.
더 많은 시장에서 테스트 파라미터 최적화 결과를 안정적이고 안정적으로 보장합니다.
이동 상쇄, 상쇄 상쇄 등의 방법으로 위험을 더욱 통제한다.
미끄러지점 비용 등으로 재검토가 더 현실화된다.
이 전략은 여러 지표와 위험 제어 메커니즘을 통합하여 비트코인 15분 주기 거래에 설계되었다. 최적화 할 여지가 많으며 지표 효과를 평가하는 심도 있는 피드백, 광범위한 시장 안정성 테스트, 그리고 더 많은 실장 고려 요소를 추가하여 다중 요소 전략에서 최적의 파라미터 조합을 찾습니다. 지속적으로 최적화하고 검증하면 이 전략은 암호화폐의 고주파 거래의 효과적인 도구가 될 수 있습니다.
/*backtest
start: 2023-08-25 00:00:00
end: 2023-09-09 00:00:00
period: 10m
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/
// © deperp
//@version=5
strategy('3kilos', shorttitle='3kilos BTC 15m', overlay=true, initial_capital=100000, max_bars_back=5000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.07, pyramiding=0)
short = input.int(50, minval=1)
srcShort = input(high, title='TEMA short')
long = input.int(100, minval=1)
srcLong = input(low, title='TEMA long 2')
long2 = input.int(350, minval=1)
srcLong2 = input(close, title='TEMA long 3')
atrLength = input.int(550, title='ATR Length', minval=1)
mult = input.float(3, title="Multiplier", minval=0.5, step=1)
smaPeriod = input.int(100, title="SMA Period", minval=1)
takeProfitPercent = input.float(1, title="Take Profit (%)", minval=0.1) / 100
stopLossPercent = input.float(3, title="Stop Loss (%)", minval=0.1) / 100
tema(src, length) =>
ema1 = ta.ema(src, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
3 * (ema1 - ema2) + ema3
tema1 = tema(srcShort, short)
plot(tema1, color=color.new(color.red, 0), linewidth=2)
tema2 = tema(srcLong, long)
plot(tema2, color=color.new(color.blue, 0), linewidth=2)
tema3 = tema(srcLong2, long2)
plot(tema3, color=color.new(color.green, 0), linewidth=2)
// Custom ATR calculation with EMA smoothing
atr_ema(src, length) =>
trueRange = math.max(math.max(high - low, math.abs(high - close[1])), math.abs(low - close[1]))
emaTrueRange = ta.ema(trueRange, length)
emaTrueRange
// Calculate ATR with EMA smoothing
atr = atr_ema(close, atrLength)
// Calculate Supertrend
var float up = na
var float dn = na
var bool uptrend = na
up := na(up[1]) ? hl2 - (mult * atr) : uptrend[1] ? math.max(hl2 - (mult * atr), up[1]) : hl2 - (mult * atr)
dn := na(dn[1]) ? hl2 + (mult * atr) : uptrend[1] ? hl2 + (mult * atr) : math.min(hl2 + (mult * atr), dn[1])
uptrend := na(uptrend[1]) ? true : close[1] > dn[1] ? true : close[1] < up[1] ? false : uptrend[1]
// Calculate SMA
sma = ta.sma(tema1, smaPeriod)
// Heikin-Ashi Close
haTicker = ticker.heikinashi(syminfo.tickerid)
haClose = request.security(haTicker, timeframe.period, close)
// Trend determination using Heikin-Ashi Close
longC = tema1 > tema2 and tema1 > tema3 and uptrend and tema1 > sma and haClose > haClose[1]
shortC = tema1 < tema2 and tema1 < tema3 and not uptrend and tema1 < sma and haClose < haClose[1]
alertlong = longC and not longC[1]
alertshort = shortC and not shortC[1]
useDateFilter = input.bool(true, title="Begin Backtest at Start Date",
group="Backtest Time Period")
backtestStartDate = input(timestamp("1 Jan 2023"),
title="Start Date", group="Backtest Time Period",
tooltip="This start date is in the time zone of the exchange " +
"where the chart's instrument trades. It doesn't use the time " +
"zone of the chart or of your computer.")
inTradeWindow = true
stopLossLevelLong = close - atr * mult
stopLossLevelShort = close + atr * mult
longTakeProfitLevel = close * (1 + takeProfitPercent)
longStopLossLevel = close * (1 - stopLossPercent)
shortTakeProfitLevel = close * (1 - takeProfitPercent)
shortStopLossLevel = close * (1 + stopLossPercent)
if inTradeWindow and longC
strategy.entry('Long', strategy.long, comment='Long')
strategy.exit("TP Long", "Long", limit=longTakeProfitLevel, stop=longStopLossLevel, comment="TP/SL Long")
if inTradeWindow and shortC
strategy.entry('Short', strategy.short, comment='Short')
strategy.exit("TP Short", "Short", limit=shortTakeProfitLevel, stop=shortStopLossLevel, comment="TP/SL Short")
// Alerts
alertcondition(longC, title='Long', message=' Buy Signal ')
alertcondition(shortC, title='Short', message=' Sell Signal ')