丸数追跡戦略

作者: リン・ハーンチャオチャン, 日時: 2023-09-21 15:24:53
タグ:

概要

この戦略は,ストップ・ロストとテイク・プロフィートのレベルが通常,サポートとレジスタンスとして機能する丸数またはキー価格レベルに置かれ,この戦略はこれらのキー価格レベルを特定し,価格が接近すると取引を行うという考えに基づいています.

戦略の論理

この戦略の主な原則は,

  1. 閉じる価格がキー価格レベルを超え 過去10バーでその値に達していない場合,ロングします.

  2. 20ポイントステップでトレーリングストップを使用して,価格がキーレベルを突破した後の動きをフォローします.

  3. 売り信号は逆です キーレベルを下回って10バーで触っていないとき ショートします

  4. 主要レベルは次のとおりです.

    • 閉じる価格を整数に変換する
    • 残りを50で割るから計算する (設定可能)
    • 残り数 > 25 の場合は,次の 50 の整数をキーレベルとして使用します.
    • キーレベルを変更しないように

この戦略は,丸い数字とキーレベルがしばしば牛と熊の戦場であり,したがって効果的な取引信号を提供するという心理に基づいています.

利点

この戦略の利点は次のとおりです.

  1. シンプルで直感的な取引信号とエントリールール
  2. 鍵値の普遍的なパターンを用いて 特定の楽器のルールではなく
  3. トレイルストップはトレンドを走る際に 利益のロックです

リスク

考慮すべきリスクは:

  1. キーレベルは常に強いサポート/レジスタンスとして機能しない可能性があります.偽のブレイクが可能です.
  2. 固定10バーのバックバックは異なる楽器に合わない可能性があります.
  3. 後ろのストップ距離は,あまりにも広いべきではない,そうでなければ,それは早めに停止する可能性があります.

可能な解決策:

  1. キーレベル,例えばボリュームの強さを判断するために,より多くのフィルターを追加します.
  2. 異なる機器の回顧期間のようなパラメータを最適化します
  3. トレーリングストップメカニズムを最適化して 適応性を高めます

増進 の 機会

戦略は以下によって改善できます.

  1. キーレベルの重要性を確認し,偽造を避けるためにより多くの条件を追加します.例えば,ボリュームと組み合わせます.

  2. 鍵レベル範囲や instrument 特性に基づく回顧期間などのパラメータを最適化します

  3. 追尾停止メカニズムを強化し,例えば固定点追尾の代わりに動的追尾を使用する.

  4. 機械学習を組み込み 重要なレベルの強さを判断する 歴史的なデータ

  5. 複数のタイムフレームシステムに拡張して TF傾向が高く TF追跡が低い

結論

この戦略は,主要な価格レベルと取引慣例に基づいてシンプルで直感的なシグナルを提供しています. 豊富な機会がありますが,偽造に対処するためにさらなる最適化が必要です. パラメータチューニングと機械学習は強度を向上させることができます. 良い日取引アイデアを提供し,マルチタイムフレームトレンド追跡システムに拡張することもできます.


/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//Strategy based on the idea that stop loss and take profit are often placed at full price levels or round numbers, whcih acts as resistance and supports levels
//Buy Rules:
//Actual price (close) is above round number.
//Round number level was not touched in previous ten bars (arbitrary value).
//Place a buy and follow the order with a trail step because price can bounce at round number (support) or can go through it.
//Sell Rules are the same of buy rules but inverted.
//
//Need improvement on conditions' logic and round numbers definitions


strategy("dP magnet", overlay=true, pyramiding=0,default_qty_type=strategy.percent_of_equity,default_qty_value=100,currency=currency.USD)

//Round Levels credit to RKchartest

roundLevel50 = input(500, 'Round Level 1, pips')
//roundLevel100 = input(1000, 'Round Level 2, pips')
deviation = input(1000, 'Max distance, pips', minval=0) 

rDelimeter = 1/syminfo.mintick

intRoundLevel = close[1] * rDelimeter

intRemainder = intRoundLevel % roundLevel50 
toRound = (intRemainder >= roundLevel50/2) ? roundLevel50 : 0
roundLevel = (intRoundLevel - intRemainder + toRound) / rDelimeter
plot(roundLevel, title='Round Level 1', color=black, style=line, transp=0, linewidth=1, trackprice=false)

//intRemainder2 = intRoundLevel % roundLevel100
//toRound2 = (intRemainder2 >= roundLevel100/2) ? roundLevel100 : 0
//roundLevel2 = (intRoundLevel - intRemainder2 + toRound2) / rDelimeter
//plot((abs(roundLevel2 - close) * rDelimeter < deviation) ? roundLevel2 : na, title='Round Level 2', color=black, style=circles, transp=0, linewidth=1, trackprice=true)

// end

//Start of strategy

distToFullNumber=(close-roundLevel) //can be positive or negative number

distPips=input(100,'Distance in pips to full level',minval=10) //user defined: this distance defines when to open an order at market price


TrailS=input(20,'Trail Step points',minval=10) //trail step that follows the order

longCondition = iff(distToFullNumber>0 and abs(distToFullNumber)<=distPips and lowest(low,10)>roundLevel,true,false)

if (longCondition)
    strategy.entry("LongMagnet", strategy.long)
    strategy.exit("ExitMagnet","LongMagnet",trail_points=TrailS)

shortCondition = iff(distToFullNumber<0 and abs(distToFullNumber)<=distPips and highest(high,10)<roundLevel,true,false)

if (shortCondition)
    strategy.entry("ShortMagnet", strategy.short)
    strategy.exit("Exit_Magnet","ShortMagnet",trail_points=TrailS)
    

もっと