ウィリアムズのワニの頭蓋骨戦略

作者: リン・ハーンチャオチャン, 日時: 2023-09-25 17:42:27
タグ:

概要

この戦略は,Bill Williams Alligator指標に基づいているが,価格入力としてハイケン・アシのキャンドルを使用している.これは1分から5分までのタイムフレームに適した短期スカルピング戦略である.

戦略の論理

戦略の主要な取引原則は以下のとおりである.

  1. 通常のキャンドルの代わりにハイケン・アシのキャンドルを使用して価格アクションをします.ハイケン・アシはノイズをフィルターしてトレンドを識別します.

  2. ビル・ウィリアムズ・アライガターの3つの移動平均線 - ,歯,唇を適用します.それらはトレンド方向を決定するために移動平均線のように動作します.

  3. 線が"Jaw (最低),Teeth (中),Lips (最高) "として積み重なると,上向きを示します. "Jaw (最高),Teeth (中),Lips (最低) "で逆転すると,下向きを示します.

  4. エントリーはハイケン・アシのキャンドル方向+アリガターラインのアライナインメントに基づいています. 高いキャンドルと牛のセットアップの長いエントリー; 低いキャンドルと熊のセットアップの短いエントリー.

  5. アリガター線が交差するときに出口する 傾向の逆転をシグナルします

  6. リスク管理に使用される固定取利益,ストップ損失ポイント. ターゲットポイント,ストップ損失ポイント,トライリングストップなどを設定できます.

ハイケン・アシとアリガトーの 二重フィルターを組み合わせると 高い確率の短期取引戦略が作れます

利点

この戦略の主な利点は以下の通りです.

  1. 二重インジケーターフィルタリングにより 偽信号は最小限に抑えられる ハイケン・アシ+アリガターが信号の質を向上させる

  2. 明確で直感的なトレンド識別 アリガターラインは明瞭な牛/熊信号を持っています

  3. 1分から5分までのチャートで価格変動を捉える.

  4. シンプルなパラメータで 複雑な最適化も必要ありません

  5. リスク管理を厳格にします

  6. アリガターの線を横断した入出規則を定義する.

  7. 簡単に実行し 複製できます 初心者向けです

リスク

考慮すべき主なリスクは:

  1. 引き下げリスク 頻繁にアリガター信号が 取引とコストを増加させる

  2. 市場リスクは範囲限定で クラスオーバーは不安定な条件で失敗する

  3. オーバーオプティマイゼーションリスク 曲線の調整が悪い

  4. インディケーターの故障リスク 極端な条件でアリガターが停止する可能性があります

  5. ストップ・ロスのリスク ギャップはストップを誘発し,不当な損失を引き起こす可能性があります

  6. 取引頻度の高いリスク.より多くの取引は取引コストも増加します.

期待分析,最適化停止,制御頻度などによって これらのリスクの多くに対処できます

増進 の 機会

戦略を改善する方法は以下の通りです.

  1. RSIのような追加フィルターを組み込むことで 勝率が上がります

  2. 取引ごとに損失を制御するために動的ATRストップを使用します.

  3. ポジションのサイズルールを追加して 賭けのサイズを最適化します

  4. グラフパターンや他の技術分析を組み合わせて 入力タイミングを決める.

  5. 楽器の種類 (株式,外為など) をベースにしたパラメータを最適化する.

  6. 適応性パラメータ最適化のための機械学習を導入します

  7. 期待分析を行い 利得とストップ損失の比率を調整します

継続的な改善により 戦略は 短期間の強力な取引システムになることができます

結論

この戦略は,ハイケン・アシとウィリアムズ・アリゲーターを組み合わせて,高確率の短期取引戦略を作成する. 双方向指標フィルタリング,シンプルなパラメータ,および明確に定義されたエントリー/エグジットメカニズムから利益を得て,効果的にトレンドと逆転を頭皮にします. しかし,市場範囲のウィプソーとストップロスのリスクは積極的な管理が必要です. 継続的な改良により,比較的安定した短期取引システムに進化することができます.


/*backtest
start: 2022-09-18 00:00:00
end: 2023-09-24 00:00:00
period: 4d
basePeriod: 1d
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
//Scalping strategy based on Bill Williams Alligator technique but applied to heikin ashi candles
//This strategy has to be applied to standard candles and low time frames (1min to 5min)
//@version=4
strategy("Bill Williams Alligator improved", shorttitle="Scalping alligator",overlay=true)
//source = input(close)
useHA = input (true,"Use heikin ashi candle?")

// ----------MA calculation - ChartArt-------------
smoothinput = input(1, minval=1, maxval=5, title='Moving Average Calculation: (1=SMA), (2=EMA), (3=WMA), (4=Linear), (5=VWMA)')

calc_ma(src,l) => 
    smoothinput == 1 ? sma(src, l):smoothinput == 2 ? ema(src, l):smoothinput == 3 ? wma(src, l):smoothinput == 4 ? linreg(src, l,0):smoothinput == 5 ? vwma(src,l):na
//----------------------------------------------

heikinashi_close = security(heikinashi(syminfo.tickerid), timeframe.period, close)
heikinashi_open = security(heikinashi(syminfo.tickerid), timeframe.period, open)
heikinashi_hl2 = security(heikinashi(syminfo.tickerid), timeframe.period, hl2)

direzione=heikinashi_close>heikinashi_open and heikinashi_close[1]>heikinashi_open[1]? 1 : heikinashi_close<heikinashi_open and heikinashi_close[1]<heikinashi_open[1]? -1 : 0

jawLength = input(13, minval=1, title="Jaw Length")
teethLength = input(8, minval=1, title="Teeth Length")
lipsLength = input(5, minval=1, title="Lips Length")
jawOffset = input(8, title="Jaw Offset")
teethOffset = input(5, title="Teeth Offset")
lipsOffset = input(3, title="Lips Offset")
jaw = calc_ma(heikinashi_hl2, jawLength)
teeth = calc_ma(heikinashi_hl2, teethLength)
lips = calc_ma(heikinashi_hl2, lipsLength)
plot(jaw, title="jaw",offset = jawOffset, color=#3BB3E4)
plot(teeth, title="teeth",offset = teethOffset, color=#FF006E)
plot(lips, title="lips",offset = lipsOffset, color=#36C711)

longCondition = direzione[0]==1 and jaw<teeth and jaw<lips and teeth<lips 
shortCondition = direzione[0]==-1 and jaw>teeth and jaw>lips and teeth>lips


//  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() => direzione[0]==1 and jaw<teeth and jaw<lips and teeth<lips // 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() => direzione[0]==-1 and jaw>teeth and jaw>lips and teeth>lips
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 = true
// === /END

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

もっと