황소 추적기


생성 날짜: 2024-01-31 11:01:45 마지막으로 수정됨: 2024-01-31 11:01:45
복사: 1 클릭수: 602
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

황소 추적기

개요

불시장 추적 시스템은 트렌드 추적을 기반으로 한 기계 거래 시스템이다. 그것은 4 시간 그래프의 트렌드 지표를 사용하여 거래 신호를 필터링하고, 입장은 15 분 그래프의 지표에 따라 판단한다. 주요 지표에는 RSI, 무작위 지표 및 MACD가 포함된다. 이 시스템의 장점은 여러 시간 프레임의 조합이 가짜 신호를 효과적으로 필터링 할 수 있으며, 더 낮은 시간 프레임의 지표를 사용하여 더 정확한 입장을 얻을 수 있다는 것이다.

원칙

이 시스템의 핵심 논리는 트렌드 방향과 진입 시점을 식별하기 위해 다양한 시간 프레임의 지표를 결합하는 것입니다. 구체적으로, 4 시간 그래프의 RSI, 무작위 지표 및 EMA가 전체 트렌드 방향을 판단하기 위해 적합해야합니다. 이것은 대부분의 잡음을 효과적으로 필터링 할 수 있습니다.

장점

  1. 여러 시간 프레임의 조합으로 가짜 신호를 효과적으로 필터링하여 주요 트렌드를 식별할 수 있습니다.
  2. 15분 디테일 지표로 정확한 출입 시간을 얻을 수 있습니다.
  3. 지표 포트폴리지는 RSI, 무작위 지표, MACD와 같은 주류 기술 지표를 사용하여 이해하기 쉽고 또한 최적화하기 쉽습니다.
  4. mStop , 정지, 정지 추적과 같은 엄격한 위험 관리 방법을 사용하여 단일 거래의 위험을 효과적으로 제어할 수 있습니다.

위험

  1. 과도한 거래 위험. 이 시스템은 짧은 시간 프레임에 민감하며, 과도한 거래로 이어지는 거래 신호를 많이 생성 할 수 있습니다.
  2. 허위 돌파 위험. 단기적 지표 판단은 잘못된 판단으로 인해 허위 돌파 신호가 발생할 수 있다.
  3. 지표 실패의 위험. 기술 지표 자체에는 제한이 있으며 극단적인 상황에서 실패 할 수 있습니다.

이에 따라, 이 시스템은 다음과 같은 측면에서 최적화될 수 있습니다.

  1. 다른 시장 환경에 더 적합하도록 지표 매개 변수를 조정합니다.
  2. 거래 빈도를 줄이고 과도한 거래를 방지하기 위해 필터링 조건을 추가합니다.
  3. 시장 변동에 더 잘 대응할 수 있도록 스톱 스톱 전략을 최적화
  4. 다양한 지표 조합을 테스트하여 최적의 해결책을 찾습니다.

요약하다

불시장 추적 시스템은 전체적으로 매우 실용적인 트렌드를 추적하는 기계 거래 시스템이다. 그것은 여러 시간 프레임의 조합 지표를 사용하여 시장 추세와 중요한 출입 시점을 식별한다. 합리적인 매개 변수 설정과 지속적인 최적화 테스트를 통해 시스템은 대부분의 시장 환경에 적응하여 안정적인 수익 효과를 얻을 수 있다. 그러나 우리는 또한 그 중 일부 잠재적인 위험을 인식하고 이러한 위험을 예방하고 해소하기 위해 적극적인 조치를 취해야합니다.

전략 소스 코드
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Cowabunga System from babypips.com", overlay=true)
// 4 Hour Stochastics
length4 = input(162, minval=1, title="4h StochLength"), smoothK4 = input(48, minval=1, title="4h StochK"), smoothD4 = input(48, minval=1, title="4h StochD")
k4 = sma(stoch(close, high, low, length4), smoothK4)
d4 = sma(k4, smoothD4)

//15 min Stoch
length = input(10, minval=1, title="15min StochLength"), smoothK = input(3, minval=1, title="15min StochK"), smoothD = input(3, minval=1, title="15min StochD")
k = sma(stoch(close, high, low, length), smoothK)
d= sma(k, smoothD)

//4 hour RSI
src1 = close, len1 = input(240, minval=1, title="4H RSI Length")
up1 = rma(max(change(src1), 0), len1)
down1 = rma(-min(change(src1), 0), len1)
rsi4 = down1 == 0 ? 100 : up1 == 0 ? 0 : 100 - (100 / (1 + up1 / down1))

//15 min RSI
src = close, len = input(9, minval=1, title="15M RSI Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi15 = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))

//MACD Settings
source = close
fastLength = input(12, minval=1, title="MACD Fast"), slowLength=input(26,minval=1, title="MACD Slow")
signalLength=input(9,minval=1, title="MACD Signal")
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
signal = ema(macd, signalLength)

// Stops and Profit inputs
inpTakeProfit   = input(defval = 1000, title = "Take Profit", minval = 0)
inpStopLoss     = input(defval = 0, title = "Stop Loss", minval = 0)
inpTrailStop    = input(defval = 400, title = "Trailing Stop", minval = 0)
inpTrailOffset  = input(defval = 0, title = "Trailing Stop Offset", minval = 0)

// Stops and Profit Targets
useTakeProfit   = inpTakeProfit  >= 1 ? inpTakeProfit  : na
useStopLoss     = inpStopLoss    >= 1 ? inpStopLoss    : na
useTrailStop    = inpTrailStop   >= 1 ? inpTrailStop   : na
useTrailOffset  = inpTrailOffset >= 1 ? inpTrailOffset : na

//Specific Time to Trade
myspecifictradingtimes = input('0500-1600', title="My Defined Hours")

longCondition1 = time(timeframe.period, myspecifictradingtimes) != 0
longCondition2 = rsi4 <= 80
longCondition3 = k4 >= d4 and k4 <= 80
longCondition4 = ema(close, 80) >= ema(close, 162)
allLongerLongs = longCondition1 and longCondition2 and longCondition3 and longCondition4

longCondition5 = rsi15 <= 80
longCondition6 = k >= d and k <= 80 and fastMA >= slowMA
longCondition7 = ema(close, 5) >= ema(close, 10)
allLongLongs = longCondition5 and longCondition6 and longCondition7

if crossover(close, ema(close, 5)) and allLongerLongs and allLongLongs
    strategy.entry("Long", strategy.long, comment="LongEntry")

shortCondition1 = time(timeframe.period, myspecifictradingtimes) != 0
shortCondition2 = rsi4 >= 20
shortCondition3 = k4 <= d4 and k4 >= 20
shortCondition4 = ema(close, 80) <= ema(close, 162)
allShorterShorts = shortCondition1 and shortCondition2 and shortCondition3 and shortCondition4

shortCondition5 = rsi15 >= 20
shortCondition6 = k <= d and k >= 20 and fastMA <= slowMA
shortCondition7 = ema(close, 5) <= ema(close, 10)
allShortShorts = shortCondition5 and shortCondition6 and shortCondition7

if crossunder(close, ema(close,5)) and allShorterShorts and allShortShorts
    strategy.entry("Short", strategy.short, comment="ShortEntry")

strategy.exit("Exit Long", from_entry = "Long", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)
strategy.exit("Exit Short", from_entry = "Short", profit = useTakeProfit, loss = useStopLoss, trail_points = useTrailStop, trail_offset = useTrailOffset)