ウォディ・ピボット・ポイント バックテスト戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-20 17:08:11
タグ:

概要

この戦略は,バックテストのためのピボットとトレードブレイクアウトを計算するためにウディモデルを使用します.これは典型的なピボットブレイクアウト戦略です.

戦略の論理

  1. 前の期間の高値,低値,閉値を使用して,現在の期間のピボットとバンドを計算します.

  2. 価格がピボットの上を突破するとロングになります

  3. 上からピボットを下回る場合はショートします.

  4. 逆信号の取引オプション

  5. 色のコードは異なる貿易信号です

利点

  1. ウォディモデル計算は シンプルで直感的です

  2. ピボットブレイクで取引することは一般的な技術です

  3. 視覚化されたピボットと信号マーク

  4. シンプルで実用的な デフォルトパラメータ

  5. コードは理解し 修正するのが簡単です

リスク

  1. 冒頭からの偽脱出の危険性

  2. 停止と出口を設定する効果的な方法はありません.

  3. 誤ったモデルとパラメータは 性能に悪影響を及ぼします

  4. 傾向や範囲を区別できない

  5. シグナルが間に合わないかもしれません

強化

  1. 最適値のために異なる周期パラメータをテストする.

  2. 追加の検証のために傾向フィルターを追加します.

  3. ストップ・ロスを取り込み リスク管理のために利益を取ります

  4. 突破後 引き下がりを評価し 信号を継続する

  5. 脱出の強さを測る方法を研究する

  6. 確認のために他の要因と組み合わせることを検討します

結論

この戦略は,ウディのピボットのブレイクアウトを取引します.パラメータを最適化し,ストップと出口を追加することで,信頼性の高い短期的なシステムの安定性を向上させることができます.


/*backtest
start: 2022-09-13 00:00:00
end: 2023-02-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 22/08/2018
// Simply input the vales of the high, low and closing price of the previous 
// period to calculate the Woodie pivot point and the associated resistance 
// and support levels for the present period.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Woodie Pivot Points Backtest", overlay = true)
width = input(2, minval=1)
xHigh  = security(syminfo.tickerid,"D", high[1])
xLow   = security(syminfo.tickerid,"D", low[1])
xClose = security(syminfo.tickerid,"D", close[1])
reverse = input(false, title="Trade reverse")
xPP = (xHigh+xLow+(xClose*2)) / 4
pos = iff(close[1] < xPP[1] and close > xPP, 1,
       iff(close < xPP, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))       
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue ) 
plot(xPP, color=blue, title="WPP", style = circles, linewidth = width)

もっと