
이 전략은 회수 이동 동선 및 123 형태 역전 두 가지 전략을 조합하여 전략의 안정성과 수익성을 높이기 위해 통합 신호를 형성합니다.
이 부분은 울프 센의 ?? 나는 어떻게 선물 시장에서 3배의 수익을 얻는가 ?? 의 내용을 참고한다. 그의 구매 신호는: 최근 2일 종결 가격 상승과 9일 주기 STO SLOWK 값이 50보다 낮을 때 더 많이; 판매 신호는: 최근 2일 종결 가격 하락과 9일 주기 STO FASTK 값이 50보다 높을 때 더 많이 다.
이 부분은 리커버런트 다중 모음 모음이라고 불리는 기술을 사용합니다. 이 아이디어는 지난 며칠 동안의 가격과 그날의 가격을 사용하여 다음 날의 가격을 예측하는 것입니다. 예측된 가격이 어제의 실제 가격보다 높을 때 하향을 보거나 반대로 더 많이 보십시오.
이러한 조합 전략은 두 가지 전략의 장점을 발휘하여 단일 전략의 한계를 피할 수 있습니다. 123 형태 반전이 가격 반전이 있을 때 더 큰 상황을 잡을 수 있습니다. 그리고 회귀 이동 동위선은 가격의 이동 방향을 더 정확하게 판단 할 수 있습니다. 두 가지의 조합은 강력한 통합 신호를 형성 할 수 있습니다.
이 전략은 두 가지 다른 유형의 전략을 통합하여 통합 신호를 생성하여 안정성을 향상시킵니다. 동시에 두 가지의 장점을 결합하여 가격 반전 지점에서 캡처 할 수 있으며 가격의 미래 움직임을 판단 할 수 있습니다. 계속 최적화하면 더 나은 성과를 낼 수 있습니다.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 01/06/2021
// This is combo strategies for get a cumulative signal.
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
// The strategy sells at market, if close price is lower than the previous close price
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// Taken from an article "The Yen Recused" in the December 1998 issue of TASC,
// written by Dennis Meyers. He describes the Recursive MA in mathematical terms
// as "recursive polynomial fit, a technique that uses a small number of past values
// of the estimated price and today's price to predict tomorrows price."
// Red bars color - short position. Green is long.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
vFast = sma(stoch(close, high, low, Length), KSmoothing)
vSlow = sma(vFast, DLength)
pos = 0.0
pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0)))
pos
RMTA(Length) =>
pos = 0.0
Bot = 0.0
nRes = 0.0
Alpha = 2 / (Length+1)
Bot := (1-Alpha) * nz(Bot[1],close) + close
nRes := (1-Alpha) * nz(nRes[1],close) + (Alpha*(close + Bot - nz(Bot[1], 0)))
pos:= iff(nRes > close[1], -1,
iff(nRes < close[1], 1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Recursive Moving Trend Average", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- Recursive Moving Trend Average ----")
LengthRMTA = input(21, minval=3)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posRMTA = RMTA(LengthRMTA)
pos = iff(posReversal123 == 1 and posRMTA == 1 , 1,
iff(posReversal123 == -1 and posRMTA == -1, -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)
if (possig == 0)
strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )