ダイナミックマーク平均トレンド戦略


作成日: 2023-11-15 17:45:13 最終変更日: 2023-11-15 17:45:13
コピー: 0 クリック数: 624
1
フォロー
1621
フォロワー

ダイナミックマーク平均トレンド戦略

概要

この戦略は,ダイナミックマーク平均線の指標に基づいて,ブリン帯とRSIを組み合わせて取引信号フィルタリングを行っており,空白しないトレンドフォロー戦略を実現している.この戦略は,ヘイクラインのクローズオフ価格のダイナミックマーク平均線の変化を計算してトレンドを判断し,ブリン帯と比較して取引信号を発信している.RSIフィルターと組み合わせて,トレンドの勃発点を効果的に識別し,トレンドフォローを実現している.

戦略原則

この戦略の核心は,ヘイク線の閉盘価格の動的マーク平均線の変化を計算することである.具体的には,現在のK線と前2つのK線のマーク平均線差を計算し,感度係数で倍し,正確なマーク平均線変化値を得ることである.

この変化値をブリン帯の上線と下線の差値と比較する.マルク均線の変化がブリン帯の差値より大きい場合は,トレンドが爆が発生したと考える.この爆破が正であるとき,すなわちマルク均線の変化が正であるとき,多信号と緑の柱状線が生じる.爆破が負であるとき,すなわちマルク均線の変化が負であるとき,平仓信号と赤柱状線が生じる.

さらに,この戦略はRSIフィルターを設定し,RSIが値より高い場合にのみ多信号を発信し,トレンドの逆転のリスクを回避します.

戦略的優位性

  • 動的マーク均線を使ってトレンドを判断し,トレンドの変化を効果的に追跡できます.
  • ブリン帯は,トレンドの勃発を識別するために,マーク平均線と組み合わせた動的指標です.
  • RSIフィルターは,低位反転による偽信号を回避します.
  • 牛の市場が上昇し続けるために,多めに働けばいい.
  • 調整可能なパラメータが柔軟で,異なる品種と周期に最適化できます

戦略リスク

  • 市場が低迷する際には,空白をなくして,多額の投資をすることしかできない.
  • パラメータ最適化に過度に依存し,異なる品種と周期で再テストが必要
  • 市場が変化し,市場が変化し,市場が変化し,
  • RSI フィルタを正しく設定しない場合,取引機会が逃れることがあります.
  • 高パラメータ感度で騒音取引が容易である

リスク緩和策には,パラメータを適切に調整してより安定させ,他の指標と組み合わせてトレンドの逆転を判断し,長線明確なトレンドのみで使用するなどが含まれます.

戦略最適化の方向性

この戦略には,いくつかの改善の余地があります.

  • 価格の源泉を試す (閉盤価格,平均線など) よりよい平滑効果を得る

  • マーク均線とブリン帯の周期パラメータを調整し,異なる品種に最適化

  • 感度係数の代わりに比例関係を使って,より直感的な結果が得られます.

  • トレンド平均線,取引量などの他のフィルターを追加し,信号の質を向上させる

  • 空頭戦略を開発し,指標形状に基づいて逆操作する.

  • リスク管理の強化に伴う 損失抑制システムへの参加

要約する

この戦略は,全体的に比較して安定したトレンド追跡戦略である.動的均等線を活用してトレンドの方向を判断し,ブリン帯の爆破点を識別し,RSIフィルター偽信号を用い,多作のトレンドシステムを実現している.しかし,異なる品種と周期に対してパラメータの最適化が必要であり,下落の状況から利益を得られないという一定のリスクもある.この戦略には,信号品質をさらに向上させ,空中戦略を開発し,損益停止などの最適化スペースを追加して,よりよいパフォーマンスを得ることができる.

ストラテジーソースコード
/*backtest
start: 2022-11-08 00:00:00
end: 2023-11-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5

///////////Original Script Courtesy of Lazy_Bear.... Absolute Legend\\\\\\\\\\\\\\\

strategy('SmoothedWaddah', overlay=false, initial_capital=1)
sensitivity = input(150, title='Sensitivity')
fastLength = input(20, title='MacD FastEMA Length')
slowLength = input(40, title='MacD SlowEMA Length')
channelLength = input(20, title='BB Channel Length')
mult = input(1.5, title='BB Stdev Multiplier')
RSI14filter = input(40, title='RSI Value trade filter')

////////////MacD Calculation of price//////////////////////////////
calc_macd(source, fastLength, slowLength) =>
    fastMA = ta.ema(source, fastLength)
    slowMA = ta.ema(source, slowLength)
    fastMA - slowMA

/////////BolingerBand Calculation of Price///////////////////////
calc_BBUpper(source, length, mult) =>
    basis = ta.sma(source, length)
    dev = mult * ta.stdev(source, length)
    basis + dev

calc_BBLower(source, length, mult) =>
    basis = ta.sma(source, length)
    dev = mult * ta.stdev(source, length)
    basis - dev

//////heinkenashi chart call for closing price "smoothing mechanism"\\\\\\\\\\\\\\\\\\\\\\\\\\\
point = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)

////////////////////T1 is change in MacD current  candle from previous candle Sensitivy amplifies calculation/////////////////////
t1 = (calc_macd(point, fastLength, slowLength) - calc_macd(point[1], fastLength, slowLength)) * sensitivity
//////////////////////T2 is  T1 from two candles prior\\\\\\\\\\\\\\\\\\\\\\\\\\\
t2 = (calc_macd(point[2], fastLength, slowLength) - calc_macd(point[3], fastLength, slowLength)) * sensitivity

////////////////E1 is difference in bolinger band upper and lower...E2 is E1 from one candle prior not needed//////////////
e1 = calc_BBUpper(ohlc4, channelLength, mult) - calc_BBLower(ohlc4, channelLength, mult)
//e2 = (calc_BBUpper(close[1], channelLength, mult) - calc_BBLower(close[1], channelLength, mult))

//////signal bar printing.. Up if MacD positive .. Down if MacD negative//////////
trendUp = t1 >= 0 ? t1 : 0
trendDown = t1 < 0 ? -1 * t1 : 0

///////plots difference in macD*Sensitivity, color change if increasing or decreasing. 
//////color is green/lime if explosion is up \ color is red/orange if explosion is down/////////
plot(trendUp, style=plot.style_columns, linewidth=1, color=trendUp < trendUp[1] ? color.new(color.lime,45) : color.new(color.green,45), title='UpTrend')
plot(trendDown, style=plot.style_columns, linewidth=1, color=trendDown < trendDown[1] ? color.new(color.orange,45) : color.new(color.red,45), title='DownTrend')
plot(e1, style=plot.style_line, linewidth=2, color=color.new(#A0522D, 0), title='ExplosionLine')


////////////Entry conditions and Concept/////////////////////
////////////Long Only System. T1 is measuring the distance between MACD EMA's. This is Multiplied
////////////by the sensitivity so that it can be compared to the difference between BollingerBand. 
/////////////{this could have been a ratio maybe i will work with that in a different script.} 
/////////////I found that 135-175 sensitivy allows for values to be compared on most charts.....
////////////If the (difference between the EMA)*(Sensitivity) is greater than (BB upper line- BB lower line)
////////////it is considered an explosion in either the downside or the upside.The indicator will print
///////////a bar higher than the trigger line either green or red (up or down respectively)//////////////////

longCondition = trendUp > e1 and ta.rsi(close, 14) > RSI14filter
if longCondition
    strategy.entry('up', strategy.long)

strategy.close('up', trendDown > e1)