
Hệ thống theo dõi thị trường bò là một hệ thống giao dịch cơ học dựa trên theo dõi xu hướng. Nó sử dụng các chỉ số xu hướng trên đồ thị 4 giờ để lọc các tín hiệu giao dịch, trong khi vào thị trường được đánh giá dựa trên các chỉ số trên đồ thị 15 phút. Các chỉ số chính bao gồm RSI, chỉ số ngẫu nhiên và MACD. Ưu điểm của hệ thống này là sự kết hợp của nhiều khung thời gian có thể lọc hiệu quả các tín hiệu giả, đồng thời sử dụng các chỉ số khung thời gian thấp hơn để có được thời gian nhập cảnh chính xác hơn.
Lý thuyết cốt lõi của hệ thống này là kết hợp các chỉ số từ các khung thời gian khác nhau để xác định hướng xu hướng và thời gian vào. Cụ thể, RSI, chỉ số ngẫu nhiên và EMA trên biểu đồ 4 giờ đều phù hợp để đánh giá hướng xu hướng tổng thể. Điều này có thể lọc phần lớn tiếng ồn hiệu quả.
Theo đó, hệ thống này có thể được tối ưu hóa theo các khía cạnh sau:
Hệ thống theo dõi thị trường bò là một hệ thống giao dịch cơ giới theo dõi xu hướng rất thực tế. Nó sử dụng các chỉ số kết hợp của nhiều khung thời gian để xác định xu hướng thị trường và thời điểm tham gia quan trọng. Với các thiết lập tham số hợp lý và kiểm tra tối ưu hóa liên tục, hệ thống có thể thích ứng với hầu hết các môi trường thị trường và đạt được hiệu quả lợi nhuận ổn định.
/*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)