フラクタル・カオス・オシレーター取引戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-18 15:10:09
タグ:

概要

この戦略は,フラクタル・カオス・オシレーター (FCO) インジケーターを使用して,トレンドをフォローするための市場トレンド方向性を決定する.FCOは,値 -1 から 1 までの値で,価格動きを判断するために,地元の高値と低値の変化を比較する.より高い値はより強い傾向を示す.FCOが高値に達するとロング,低値に達するとショート.

戦略の論理

特定のキャンドルスタイクパターンを探すことで地元の高値と低値を特定する. FCO指標を計算するために隣接する高値/低値群の変化を比較する.例えば,最新の高値/低値群が前のグループと異なる場合,FCOは1で,上昇傾向強さが増加することを示します. FCO値に基づいてトレンド方向を決定します.より高い値で長値,より低い値で短値.

利点

  • FCOは,単純に,トレンドの方向性を効果的に判断します.
  • 複雑なパラメータは必要ありません.使いやすい.
  • 短期間の日中取引で利益になる
  • 需要に応じて長引くか短引くか

リスク

  • パターン識別が完全には正確ではない 曲がりを見逃す可能性があります
  • 傾向の逆転を正確に判断できないため,損失のリスクがある
  • 日中取引の頻度は取引コストを増加させる

リスクはパラメータの最適化や逆転指標の追加によって軽減できます

増進 の 機会

  • パターン識別のための異なる期間をテストする
  • FCO の長/短値の限界値を最適化する
  • トレンド逆転を決定するために移動平均等を足す.
  • 異なる製品における耐久性試験

結論

FCO戦略は,短期取引のトレンド方向判断を簡素化する. パラメータチューニングによってパフォーマンスを改善することができる. 簡単に実装できるトレンドフォローコンセプト.


/*backtest
start: 2023-09-10 00:00:00
end: 2023-09-17 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 22/02/2018
//   The value of Fractal Chaos Oscillator is calculated as the difference between 
// the most subtle movements of the market. In general, its value moves between 
// -1.000 and 1.000. The higher the value of the Fractal Chaos Oscillator, the 
// more one can say that it follows a certain trend – an increase in prices trend, 
// or a decrease in prices trend.
//
//   Being an indicator expressed in a numeric value, traders say that this is an 
// indicator that puts a value on the trendiness of the markets. When the FCO reaches 
// a high value, they initiate the “buy” operation, contrarily when the FCO reaches a 
// low value, they signal the “sell” action. This is an excellent indicator to use in 
// intra-day trading.
//
// You can change long to short in the Input Settings
// WARNING:
//  - For purpose educate only
//  - This script to change bars colors.
////////////////////////////////////////////////////////////
fractalUp(pattern) =>
    p = high[pattern+1]
    okl = 1
    okr = 1
	for i = pattern to 1
		okl := iff(high[i] < high[i+1] and okl == 1 , 1, 0)
	for i = pattern+2 to pattern*2+1
		okr := iff(high[i] < high[i-1] and okr == 1, 1, 0)
	res = iff(okl == 1 and okr == 1, p, res[1])
    res

fractalDn(pattern) =>
    p = low[pattern+1]
    okl = 1
    okr = 1
	for i = pattern to 1
		okl := iff(low[i] > low[i+1] and okl == 1 , 1, 0)
	for i = pattern+2 to pattern*2+1
		okr := iff(low[i] > low[i-1] and okr == 1, 1, 0)
	res = iff(okl == 1 and okr == 1, p, res[1])
    res

strategy(title="Fractal Chaos Oscillator", overlay = false)
Pattern = input(1, minval=1)
reverse = input(false, title="Trade reverse")
xUpper = fractalUp(Pattern)
xLower = fractalDn(Pattern)
xRes = iff(xUpper != xUpper[1], 1, 
         iff(xLower != xLower[1], -1, 0))
pos = iff(xRes == 1, 1,
       iff(xRes == -1, -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(xRes, color=blue, title="FCO")

もっと