프랙탈 카오스 오시레이터 거래 전략

저자:차오장, 날짜: 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")

더 많은