この戦略は,ビットコインおよび他の暗号通貨の15分周期に適用される総合的な取引戦略である.これは,トリプル指数移動平均,平均実際の波動幅,およびバランスライングラフを含む,複数の指標を統合し,ストップ・ローズなどのリスク管理機構を有している.
この戦略は以下の複数の指標を用いています.
三重指数移動平均 ((TEMA):高点,低点,閉盤価格に基づいて,異なる長さと源を持つ3つのTEMAを使用する.
平均実際の波動幅 ((ATR):EMAを平らにしたカスタムATRを使用して市場の波動率を計算する.
超トレンド指標:ATRと倍数に基づいてトレンド方向を決定する.
単純移動平均 ((SMA):短周期TEMAに対するSMAは平滑値として計算する.
バランスラインの閉盤価格: 傾向の追加確認のために.
短期のTEMAが長期のTEMA2つより高く,超トレンド指標が看板で,短期のTEMAがSMAより高く,平衡線の閉盘価格が前日より高く,買取シグナルが生成される.
短期TEMAが長期TEMAの2つ以下で,超トレンド指数が下落し,短期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 ')