
불시장 추적 시스템은 트렌드 추적을 기반으로 한 기계 거래 시스템이다. 그것은 4 시간 그래프의 트렌드 지표를 사용하여 거래 신호를 필터링하고, 입장은 15 분 그래프의 지표에 따라 판단한다. 주요 지표에는 RSI, 무작위 지표 및 MACD가 포함된다. 이 시스템의 장점은 여러 시간 프레임의 조합이 가짜 신호를 효과적으로 필터링 할 수 있으며, 더 낮은 시간 프레임의 지표를 사용하여 더 정확한 입장을 얻을 수 있다는 것이다.
이 시스템의 핵심 논리는 트렌드 방향과 진입 시점을 식별하기 위해 다양한 시간 프레임의 지표를 결합하는 것입니다. 구체적으로, 4 시간 그래프의 RSI, 무작위 지표 및 EMA가 전체 트렌드 방향을 판단하기 위해 적합해야합니다. 이것은 대부분의 잡음을 효과적으로 필터링 할 수 있습니다.
이에 따라, 이 시스템은 다음과 같은 측면에서 최적화될 수 있습니다.
불시장 추적 시스템은 전체적으로 매우 실용적인 트렌드를 추적하는 기계 거래 시스템이다. 그것은 여러 시간 프레임의 조합 지표를 사용하여 시장 추세와 중요한 출입 시점을 식별한다. 합리적인 매개 변수 설정과 지속적인 최적화 테스트를 통해 시스템은 대부분의 시장 환경에 적응하여 안정적인 수익 효과를 얻을 수 있다. 그러나 우리는 또한 그 중 일부 잠재적인 위험을 인식하고 이러한 위험을 예방하고 해소하기 위해 적극적인 조치를 취해야합니다.
/*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)