골든 크로스 이동 평균 진입 전략


생성 날짜: 2023-11-01 16:42:41 마지막으로 수정됨: 2023-11-01 16:42:41
복사: 0 클릭수: 813
1
집중하다
1141
수행원

골든 크로스 이동 평균 진입 전략

개요

골든 크로스 메이저 라인 입력 전략은 이동 평균의 교차 신호 또는 하향 신호를 기반으로 거래 신호를 생성하는 전략이다. 단기 이동 평균 위에 장기 이동 평균을 횡단할 때, 다중 골든 크로스 신호를 생성한다. 단기 이동 평균 아래로 장기 이동 평균을 횡단할 때, 공허한 데이트 크로스 신호를 생성한다. 일반적인 시장 합의가 사용하는 평균 선 변수는 50 일선과 200 일선이다.

골든 크로스 메이저 라인 입력 전략은 크로스 메이저 라인의 파라미터를 자유롭게 선택할 수 있습니다. 시각적으로 표시하기 위해 1에서 987까지의 여러 피보나치 이동 평균을 그려냈습니다. 그러나 실제 사용에서는 몇 개의 메이저 라인을 선택하여 명백한 크로스 신호가 있는지 확인하고 이러한 파라미터를 장점 또는 단점 설정에 입력 할 수 있습니다.

예를 들어, 전략의 장거리 또는 단거리 설정은 다음과 같습니다:

다중 신호: 34일 EMA 교차 144일 EMA

공허 신호:
55일 SMA 아래 144일 EMA

이 전략은 4개의 다른 평균선의 변수를 자유롭게 매칭할 수 있으며, EMA와 SMA를 모두 선택할 수 있다.

기본 색상: 상향 평균선은 초록색입니다. 평균 하향이 빨간색입니다.

기본 비주얼 피보나치 평선 설정: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181 일 평균선

기본 시각 평행 설정: 50, 100, 150, 200일 평균선

기본 장거리 또는 단거리 설정: 다중 신호: 34일 EMA 교차 144일 EMA

공허 신호: 55일 SMA 아래 144일 EMA

원칙

이 전략의 핵심 논리는 두 개의 이동 평균의 교차 신호를 기반으로 거래 신호를 생성하는 것이다.

이동 평균은 시장의 추세를 분석하는 기술 지표이다. 그것은 특정 기간 동안의 종결 가격의 평균을 계산하여 시장의 변동을 효과적으로 필터링 할 수 있다. 이동 평균은 단순 이동 평균 SMA와 지수 이동 평균 EMA로 나다.

SMA는 특정 주기의 종결 가격에 대한 간단한 계산 평균이다. EMA는 종결 가격에 대한 지수 평행 이동 평균을 사용하여 최근 가격에 더 높은 무게를 부여한다. EMA는 가격 변화에 더 빨리 반응한다.

단기평균선 위에 장기평균선을 횡단할 때, 시장의 흐름이 낙선으로 전환되어 구매 신호를 생성하는 것으로 간주된다. 이것은 ?? 골드 크로스 ?? 이라고 불린다. 반대로, 단기평균선 아래에 장기평균선을 횡단할 때, 시장의 흐름이 하향으로 전환되어 판매 신호를 생성하는 것으로 간주된다. 이것은 ?? 죽음의 크로스 ?? 이라고 불린다.

이 전략의 유연성은, 4개의 평균선을 위한 변수를 자율적으로 설정할 수 있다는 것이다. 기본 변수는 34일 EMA에 144일 EMA를 다머리 신호로, 55일 SMA 아래 144일 EMA를 공수 신호로 한다. 이 변수들은 입력 상자에서 자유롭게 설정할 수 있다.

또한, 이 전략은 여러 피보나치 수열의 이동 평균을 도출하여, 더 많은 시간 차원에서 트렌드 변화를 관찰할 수 있습니다. 또한, 일반적인 50일, 100일, 150일, 200일 평균선을 도출합니다. 이 평균선은 참고용으로 사용되며, 중요한 것은 긴 포지션이나 짧은 포지션 설정 상자에 입력된 교차 평균 변수입니다.

장점

이 전략의 장점은 다음과 같습니다.

  1. 이동 평균을 사용하여 시장 소음을 효과적으로 필터링하여 트렌드 방향을 식별합니다.

  2. 트레이딩 신호는 평행선 교차로부터 온 것으로 어느 정도 신뢰성이 있다.

  3. 길고 짧은 평균선 조합을 자유롭게 선택할 수 있고, 최적화 파라미터를 선택할 수 있습니다.

  4. 여러 개의 다른 주기의 평균선을 결합하여 더 큰 시간 차원에서 트렌드를 식별할 수 있습니다.

  5. 동시에 EMA와 SMA를 적용할 수 있으며, 품종 특성에 따라 최적의 매개 변수를 선택할 수 있다.

  6. 시각적으로 직관적인 이미지, 다채색 평행선 교차로로 명확하게 볼 수 있다

  7. 간단하고, 이해하기 쉽고, 초보자도 사용할 수 있습니다.

  8. 다양한 품종에 유연하게 적용할 수 있으며, 어느 정도 보편성을 가지고 있다

위험

이 전략에는 몇 가지 위험도 있습니다.

  1. 불안정한 시장에서, 평행선은 많은 불확실성 신호를 생성할 수 있으며, 이는 초단계 거래, 거래 빈도 증가 및 수수료 부담을 초래한다.

  2. 선택된 파라미터가 적절하지 않으면 잘못된 신호가 발생할 수 있으며, 적절한 길고 짧은 평균선 조합을 선택하여 효과를 검증해야 한다.

  3. 동향이 급격히 역전될 때, 평행선 교차 신호는 지연되어 가격 변화에 적절하게 반응할 수 없다.

  4. 평행선 교차는 손실을 완전히 피할 수 없으며, 합리적인 중지점을 설정할 필요가 있다.

  5. 과도한 최적화로 인한 곡선 적합성을 방지해야 한다. 다른 시장 주기에서 매개 변수 안정성을 테스트해야 한다.

최적화 방향

이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.

  1. 다양한 길이의 평균선 조합을 테스트하여, 최적의 파라미터를 찾으며, 역사 데이터를 기반으로 반복적으로 재검토할 수 있다.

  2. 평균선 유형을 조정하여 SMA와 EMA의 효과 차이를 비교하십시오. 품종 추세는 SMA를 선택 할 수 있으며, 품종 변동은 EMA를 선택 할 수 있습니다.

  3. KDJ, MACD 등과 같은 다른 지표와 결합하여 가짜 신호를 필터링하여 신호 품질을 향상시킵니다.

  4. 단일 손실 위험을 제어하기 위해 손해 중지 전략을 추가하십시오. 이동 중지 또는 추적 중지 설정할 수 있습니다.

  5. 재원 관리 전략을 최적화하여 전체적인 리스크 을 통제하기 위해 포지션을 조정합니다.

  6. 다양한 품종과 다양한 주기에서 안정성을 테스트하고, 매개 변수의 강도를 평가한다. 필요하면 품종에 맞는 매개 변수를 미세 조정할 수 있다.

요약하다

골든 크로스 평평선 입력 전략은 전체적으로 신뢰성이 높은 트렌드 추적 전략이다. 그것은 간단한 직관적인 평평선 크로스를 거래 신호로 사용하며, 파라미터를 최적화함으로써 다양한 품종에 적응할 수 있다. 스톱로스와 재원 관리를 결합하면 위험을 제어할 수 있다. 그러나 과도한 최적화와 트렌드 반전의 지연 문제를 방지하는 데 주의를 기울여야 한다. 파라미터를 적절하게 선택하고 거래자가 매우 엄격하다면, 이것은 매우 효율적인 안정적인 수익 전략이 될 수 있다.

전략 소스 코드
/*backtest
start: 2022-10-25 00:00:00
end: 2023-10-31 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Options360 : Fibonacci MAI (Moving Averages Input) beta 10/15/22
// © Options360 original public release = 2/25/23
// * This script uses altered pieces of code from my @Options360 "Fibonacci MA7" indicator*
// 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811
////
strategy(title="Fibonacci Moving Averages Input", shorttitle = "FibMAI", overlay=true)

src = input(ohlc4, 'source')
//
string  GRP = "Long or Short Settings"
exponential1 = input(true, title="long EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP)
long = input.int(34, minval=1, title="long", tooltip="Signal Moving average long input")
long1 = exponential1 ? ta.ema(src, long) : ta.sma(src, long)

exponential2 = input(true, title="crossover EMA or SMA", tooltip="EMA checked or SMA unchecked")
longer = input.int(144, minval=1, title="crossover", tooltip="Crossed over Moving average long input")
long2 = exponential2 ? ta.ema(src, longer) : ta.sma(src, longer)

exponential3 = input(true, title="short EMA or SMA", tooltip="EMA checked or SMA unchecked")
short = input.int(55, minval=1, title="short", tooltip="Signal Moving average short input")
short1 = exponential3 ? ta.ema(src, short) : ta.sma(src, short)

exponential4 = input(false, title="crossunder EMA or SMA", tooltip="EMA checked or SMA unchecked")
shorter = input.int(144, minval=1, title="crossunder", tooltip="Crossed under Moving average short input")
short2 = exponential4 ? ta.ema(src, shorter) : ta.sma(src, shorter)
//
string  GRP2 = "Visual FibMA Settings"
exponential = input(true, title="Fib EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP2)
//
smaplot11 = input (true, title="MA1")
len11 = input.int(1, minval=1, title="ma Length")
out11 = exponential ? ta.ema(src, len11) : ta.sma(src, len11)
up11 = out11 > out11[1]
down11 = out11 < out11[1]
mycolor11 = up11 ? #3cfe12 : down11 ? #ff0202 : #008eff
plot(out11 and smaplot11 ? out11 :na, title="1", color=mycolor11, linewidth=1)

smaplot18 = input (true, title="MA2")
len18 = input.int(2, minval=1, title="ma Length")
out18 = exponential ? ta.ema(src, len18) : ta.sma(src, len18)
up18 = out18 > out18[1]
down18 = out18 < out18[1]
mycolor18 = up18 ? #3cfe12 : down18 ? #ff0202 : #008eff
plot(out18 and smaplot18 ? out18 :na , title="2", color=mycolor18, linewidth=1)

smaplot13 = input (true, title="MA3")
len13 = input.int(3, minval=1, title="ma Length")
out13 = exponential ? ta.ema(src, len13) : ta.sma(src, len13)
up13 = out13 > out13[1]
down13 = out13 < out13[1]
mycolor13 = up13 ? #3cfe12 : down13 ? #ff0202 : #008eff
plot(out13 and smaplot13 ? out13 :na , title="3", color=mycolor11, linewidth=1)

smaplot9 = input (true, title="MA5")
len9 = input.int(5, minval=1, title="ma Length")
out9 = exponential ? ta.ema(src, len9) : ta.sma(src, len9)
up9 = out9 > out9[1]
down9 = out9 < out9[1]
mycolor9 = up9 ? #3cfe12 : down9 ? #ff0202 : #008eff
plot(out9 and smaplot9 ? out9 :na , title="5", color=mycolor9, linewidth=1)

smaplot8 = input (true, title="MA8")
len8 = input.int(8, minval=1, title="ma Length")
out8 = exponential ? ta.ema(src, len8) : ta.sma(src, len8)
up8 = out8 > out8[1]
down8 = out8 < out8[1]
mycolor8 = up8 ? #3cfe12 : down8 ? #ff0202 : #008eff
plot(out8 and smaplot8 ? out8 :na , title="8", color=mycolor8, linewidth=1)

smaplot7 = input (true, title="MA13")
len7 = input.int(13, minval=1, title="ma Length")
out7 = exponential ? ta.ema(src, len7) : ta.sma(src, len7)
up7 = out7 > out7[1]
down7 = out7 < out7[1]
mycolor7 = up7 ? #3cfe12 : down7 ? #ff0202 : #008eff
plot(out7 and smaplot7 ? out7 :na , title="13", color=mycolor7, linewidth=1)

smaplot = input (true, title="MA21")
len = input.int(21, minval=1, title="ma Length")
out = exponential ? ta.ema(src, len) : ta.sma(src, len)
up = out > out[1]
down = out < out[1]
mycolor = up ? #3cfe12 : down ? #ff0202 : #008eff
plot(out and smaplot ? out :na, title="21", color=mycolor, linewidth=1)

smaplot2 = input (true, title="MA34")
len2 = input.int(34, minval=1, title="ma Length")
out2 = exponential ? ta.ema(src, len2) : ta.sma(src, len2)
up2 = out2 > out2[1]
down2 = out2 < out2[1]
mycolor2 = up2 ? #3cfe12 : down2 ? #ff0202 : #008eff
plot(out2 and smaplot2 ? out2 :na , title="34", color=mycolor2, linewidth=1)

smaplot3 = input (true, title="MA55")
len3 = input.int(55, minval=1, title="ma Length")
out3 = exponential ? ta.ema(src, len3) : ta.sma(src, len3)
up3 = out3 > out3[1]
down3 = out3 < out3[1]
mycolor3 = up3 ? #3cfe12 : down3 ? #ff0202 : #008eff
plot(out3 and smaplot3 ? out3 :na, title="55", color=mycolor3, linewidth=1)

smaplot4 = input (true, title="MA89")
len4 = input.int(89, minval=1, title="ma Length")
out4 = exponential ? ta.ema(src, len4) : ta.sma(src, len4)
up4 = out4 > out4[1]
down4 = out4 < out4[1]
mycolor4 = up4 ? #3cfe12 : down4 ? #ff0202 : #008eff
plot(out4 and smaplot4 ? out4 :na , title="89", color=mycolor4, linewidth=1)

smaplot5 = input (true, title="MA144")
len5 = input.int(144, minval=1, title="ma Length")
out5 = exponential ? ta.ema(src, len5) : ta.sma(src, len5)
up5 = out5 > out5[1]
down5 = out5 < out5[1]
mycolor5 = up5 ? #3cfe12 : down5 ? #ff0202 : #008eff
plot(out5 and smaplot5 ? out5 :na, title="144", color=mycolor5, linewidth=1)

smaplot6 = input (true, title="MA233")
len6 = input.int(233, minval=1, title="ma Length")
out6 = exponential ? ta.ema(src, len6) : ta.sma(src, len6)
up6 = out6 > out6[1]
down6 = out6 < out6[1]
mycolor6 = up6 ? #3cfe12 : down6 ? #ff0202 : #008eff
plot(out6 and smaplot6 ? out6 :na , title="233", color=mycolor6, linewidth=1)

smaplot10 = input (true, title="MA377")
len10 = input.int(377, minval=1, title="ma Length")
out10 = exponential ? ta.ema(src, len10) : ta.sma(src, len10)
up10 = out10 > out10[1]
down10 = out10 < out10[1]
mycolor10 = up10 ? #3cfe12 : down10 ? #ff0202 : #008eff
plot(out10 and smaplot10 ? out10 :na , title="377", color=mycolor10, linewidth=1)

smaplot14 = input (true, title="MA610")
len14 = input.int(610, minval=1, title="ma Length")
out14 = exponential ? ta.ema(src, len14) : ta.sma(src, len14)
up14 = out14 > out14[1]
down14 = out14 < out14[1]
mycolor14 = up14 ? #3cfe12 : down14 ? #ff0202 : #008eff
plot(out14 and smaplot14 ? out14 :na , title="610", color=mycolor14, linewidth=1)

smaplot15 = input (true, title="MA987")
len15 = input.int(987, minval=1, title="ma Length")
out15 = exponential ? ta.ema(src, len15) : ta.sma(src, len15)
up15 = out15 > out15[1]
down15 = out15 < out15[1]
mycolor15 = up15 ? #3cfe12 : down15 ? #ff0202 : #008eff
plot(out15 and smaplot15 ? out15 :na , title="987", color=mycolor15, linewidth=1)

smaplot16 = input (true, title="MA1597")
len16 = input.int(1597, minval=1, title="ma Length")
out16 = exponential ? ta.ema(src, len16) : ta.sma(src, len16)
up16 = out16 > out16[1]
down16 = out16 < out16[1]
mycolor16 = up16 ? #3cfe12 : down16 ? #ff0202 : #008eff
plot(out16 and smaplot16 ? out16 :na , title="1597", color=mycolor16, linewidth=1)

smaplot17 = input (true, title="MA2584")
len17 = input.int(2584, minval=1, title="ma Length")
out17 = exponential ? ta.ema(src, len17) : ta.sma(src, len17)
up17 = out17 > out17[1]
down17 = out17 < out17[1]
mycolor17 = up17 ? #3cfe12 : down17 ? #ff0202 : #008eff
plot(out17 and smaplot17 ? out17 :na , title="2584", color=mycolor17, linewidth=1)

smaplot19 = input (true, title="MA4181")
len19 = input.int(4181, minval=1, title="ma Length")
out19 = exponential ? ta.ema(src, len19) : ta.sma(src, len19)
up19 = out19 > out19[1]
down19 = out19 < out19[1]
mycolor19 = up19 ? #3cfe12 : down19 ? #ff0202 : #008eff
plot(out19 and smaplot19 ? out19 :na , title="4181", color=mycolor19, linewidth=1)
//
string  GRP3 = "Visual MA Settings"
exponential5 = input(false, title="EMA or SMA", tooltip="EMA checked or SMA unchecked", group = GRP3)

smaplot50 = input (true, title="MA50")
len50 = input.int(50, minval=1, title="ma Length")
ma50 = exponential5 ? ta.ema(src, len50) : ta.sma(src, len50)
up50 = ma50 > ma50[1]
down50 = ma50 < ma50[1]
mycolor50 = up50 ? #3cfe12 : down50 ? #ff0202 : #008eff
plot(ma50 and smaplot50 ? ma50 :na , title="50", color=mycolor50, linewidth=1)

smaplot100 = input (true, title="MA100")
len100 = input.int(100, minval=1, title="ma Length")
ma100 = exponential5 ? ta.ema(src, len100) : ta.sma(src, len100)
up100 = ma100 > ma100[1]
down100 = ma100 < ma100[1]
mycolor100 = up100 ? #3cfe12 : down100 ? #ff0202 : #008eff
plot(ma100 and smaplot100 ? ma100 :na , title="100", color=mycolor100, linewidth=1)

smaplot150 = input (true, title="MA150")
len150 = input.int(150, minval=1, title="ma Length")
ma150 = exponential5 ? ta.ema(src, len150) : ta.sma(src, len150)
up150 = ma150 > ma150[1]
down150 = ma150 < ma150[1]
mycolor150 = up150 ? #3cfe12 : down150 ? #ff0202 : #008eff
plot(ma150 and smaplot150 ? ma150 :na , title="150", color=mycolor150, linewidth=1)

smaplot200 = input (true, title="MA200")
len200 = input.int(200, minval=1, title="ma Length")
ma200 = exponential5 ? ta.ema(src, len200) : ta.sma(src, len200)
up200 = ma200 > ma200[1]
down200 = ma200 < ma200[1]
mycolor200 = up200 ? #3cfe12 : down200 ? #ff0202 : #008eff
plot(ma200 and smaplot200 ? ma200 :na , title="200", color=mycolor200, linewidth=1)
//
if (ta.crossover(long1, long2))
	strategy.entry("maL", strategy.long, comment="maLong")
if (ta.crossunder(short1, short2))
	strategy.entry("maS", strategy.short, comment="maShort")
////