波動性突破戦略

作者: リン・ハーンチャオチャン開催日:2023年12月13日 14:36:04
タグ:

img

概要

波動性突破戦略 (Volatility Breakthrough Strategy) は,価格が波動性パターンの主要なサポートまたはレジスタンスレベルを突破したときに購入および売却操作を行う戦略である.この戦略は,主要な取引機会を特定するために複数の技術指標を組み合わせます.

戦略原則

この戦略は主にボリンジャーミドルバンド,48日間のシンプル・ムービング・アベア (SMA),MACDおよびADXの4つの技術指標に基づいています.具体的論理は:

  1. 閉じる価格が48日SMA以上または以下を横断する際の取引機会を検討する.

  2. 閉じる価格がボリンジャー・ミドルバンドを突破すると,入場信号として機能します.

  3. MACDは0以上または0未満で,傾向の方向性を決定する補助指標として機能する.

  4. ADXは25以上で,トレンドではない市場をフィルタリングします.

上記4つの条件が満たされたら,ロングまたはショートにします.

戦略 の 利点

この戦略は,傾向指標と変動指標を組み合わせています.主な利点は以下の通りです.

  1. 48日間のSMAは,過度に頻繁な取引と中長期のトレンドのロックをフィルタリングします.

  2. Bollinger Middle Bandのブレイクアウトは,強いストップロスの機能を持つ主要なサポート/レジスタンスブレイクアウトポイントを把握する.

  3. MACDは主要なトレンドの方向性を判断し,トレンドに反する取引を避けます.

  4. ADXはトレンドではない市場をフィルターし 戦略の勝率を向上させます

要するに この戦略は 取引頻度を制御し キーポイントを把握し 傾向の方向を決定し 不正な動きをフィルタリングすることで 比較的高い勝利率を得ています

戦略 の リスク

この戦略の主なリスクは,

  1. 波動性のある市場では,ボリンジャーミドルバンドは取引機会を過剰に引き起こす可能性があり,過剰な取引につながります.

  2. ADXインジケーターは,トレンドと無効な動きの決定にいくつかのエラーがあります.

  3. 比較的高い引き上げリスクで,ある程度のリスクを負うことができる投資家に適しています.

オプティマイゼーションの方向性

この戦略は,次の側面でさらに最適化できます.

  1. ATR インジケーターを追加してストップ・ロストポイントを設定し,ストップ・ロスト毎に減算します.

  2. 中間線誘発頻度を減らすためにボリンガーパラメータを最適化する.

  3. トレード強さを判断するために取引量またはトレンド強さの指標を追加し,弱い逆転取引を避ける.

概要

概要すると,この波動性突破戦略は,全体として比較的成熟しており,波動性の高い市場における主要な取引点を効果的に把握しています.傾向と波動性の指標を組み合わせ,リスクとリターンのバランスをとっています.さらなる最適化により,より安定した過剰リターンを得ることが期待されています.


/*backtest
start: 2023-12-11 00:00:00
end: 2023-12-12 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/
// © 03.freeman
//Volatility Traders Minds Strategy (VTM Strategy)
//I found this startegy on internet, with a video explaingin how it works.
//Conditions for entry:
//1 - Candles must to be above or bellow the 48 MA (Yellow line)
//2 - Candles must to break the middle of bollinger bands
//3 - Macd must to be above or bellow zero level;
//4 - ADX must to be above 25 level
//@version=4
strategy("Volatility Traders Minds Strategy (VTM Strategy)", shorttitle="VTM",overlay=true)
source = input(close)
//MA
ma48 = sma(source,48)
//MACD
fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)

MACD = ema(source, fastLength) - ema(source, slowlength)
aMACD = ema(MACD, MACDLength)
delta = MACD - aMACD

//BB

length = input(20, minval=1)
mult = input(2.0, minval=0.001, maxval=50)

basis = sma(source, length)
dev = mult * stdev(source, length)

upper = basis + dev
lower = basis - dev

//ADX
adxThreshold = input(title="ADX Threshold", type=input.integer, defval=25, minval=1)
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
	up = change(high)
	down = -change(low)
	plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
    minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
	truerange = rma(tr, len)
	plus = fixnan(100 * rma(plusDM, len) / truerange)
	minus = fixnan(100 * rma(minusDM, len) / truerange)
	[plus, minus]

adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)

sig = adx(dilen, adxlen)

//  Strategy: (Thanks to JayRogers)
// === STRATEGY RELATED INPUTS ===
//tradeInvert     = input(defval = false, title = "Invert Trade Direction?")
// the risk management inputs
inpTakeProfit   = input(defval = 0, title = "Take Profit Points", minval = 0)
inpStopLoss     = input(defval = 0, title = "Stop Loss Points", minval = 0)
inpTrailStop    = input(defval = 0, title = "Trailing Stop Loss Points", minval = 0)
inpTrailOffset  = input(defval = 0, title = "Trailing Stop Loss Offset Points", minval = 0)

// === RISK MANAGEMENT VALUE PREP ===
// if an input is less than 1, assuming not wanted so we assign 'na' value to disable it.
useTakeProfit   = inpTakeProfit  >= 1 ? inpTakeProfit  : na
useStopLoss     = inpStopLoss    >= 1 ? inpStopLoss    : na
useTrailStop    = inpTrailStop   >= 1 ? inpTrailStop   : na
useTrailOffset  = inpTrailOffset >= 1 ? inpTrailOffset : na

// === STRATEGY - LONG POSITION EXECUTION ===
enterLong() => close>ma48 and close>basis and delta>0 and sig>adxThreshold  // functions can be used to wrap up and work out complex conditions
//exitLong() => jaw>teeth or jaw>lips or teeth>lips
strategy.entry(id = "Buy", long = true, when = enterLong() )    // use function or simple condition to decide when to get in
//strategy.close(id = "Buy", when = exitLong() )                  // ...and when to get out

// === STRATEGY - SHORT POSITION EXECUTION ===
enterShort() => close<ma48 and close<basis and delta<0 and sig>adxThreshold
//exitShort() => jaw<teeth or jaw<lips or teeth<lips
strategy.entry(id = "Sell", long = false, when = enterShort())
//strategy.close(id = "Sell", when = exitShort() )

// === STRATEGY RISK MANAGEMENT EXECUTION ===
// finally, make use of all the earlier values we got prepped
strategy.exit("Exit Buy", from_entry = "Buy", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)
strategy.exit("Exit Sell", from_entry = "Sell", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)

// === Backtesting Dates === thanks to Trost

testPeriodSwitch = input(false, "Custom Backtesting Dates")
testStartYear = input(2020, "Backtest Start Year")
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testStartHour = input(0, "Backtest Start Hour")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,testStartHour,0)
testStopYear = input(2020, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(31, "Backtest Stop Day")
testStopHour = input(23, "Backtest Stop Hour")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,testStopHour,0)
testPeriod() =>
    time >= testPeriodStart and time <= testPeriodStop ? true : false
isPeriod = testPeriodSwitch == true ? testPeriod() : true
// === /END

if not isPeriod
    strategy.cancel_all()
    strategy.close_all()

もっと