
Chiến lược này là một hệ thống giao dịch tổng hợp kết hợp Fibonacci Reversal, theo dõi xu hướng và quản lý rủi ro. Nó chủ yếu dựa trên mức Fibonacci Reversal 0,65 làm điểm tham chiếu giá quan trọng và kết hợp với đường trung bình di chuyển để xác nhận xu hướng thị trường, đồng thời tích hợp cơ chế dừng lỗ động dựa trên ATR. Chiến lược này hoạt động trên chu kỳ 15 phút nhằm nắm bắt các cơ hội giao dịch có khả năng cao phù hợp với xu hướng thị trường hiện tại.
Logic cốt lõi của chiến lược này dựa trên các thành phần chính sau:
Đây là một chiến lược theo dõi xu hướng trung hạn được thiết kế hợp lý, xây dựng một hệ thống giao dịch hoàn chỉnh bằng cách kết hợp lý thuyết Fibonacci, theo dõi xu hướng và quản lý rủi ro. Đặc điểm chính của chiến lược là tạo ra tín hiệu giao dịch dựa trên nhận diện xu hướng thị trường, sử dụng mức giá vượt qua mức quan trọng và quản lý rủi ro thông qua cơ chế dừng lỗ động. Mặc dù có một số nơi cần tối ưu hóa, nhưng nói chung đây là một khung chiến lược có giá trị thực tế.
/*backtest
start: 2024-11-26 00:00:00
end: 2024-12-25 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Refined Fibonacci Strategy - Enhanced Risk Management", overlay=true)
// Input parameters
fibonacci_lookback = input.int(38, minval=2, title="Fibonacci Lookback Period")
atr_multiplier = input.float(1.8, title="ATR Multiplier for Stop Loss and Take Profit")
sma_length = input.int(181, title="SMA Length")
// Calculating Fibonacci levels
var float high_level = na
var float low_level = na
if (ta.change(ta.highest(high, fibonacci_lookback)))
high_level := ta.highest(high, fibonacci_lookback)
if (ta.change(ta.lowest(low, fibonacci_lookback)))
low_level := ta.lowest(low, fibonacci_lookback)
fib_level_0_65 = high_level - ((high_level - low_level) * 0.65)
// Trend Filter using SMA
sma = ta.sma(close, sma_length)
in_uptrend = close > sma
in_downtrend = close < sma
// ATR for Risk Management
atr = ta.atr(12)
long_stop_loss = close - (atr * atr_multiplier)
long_take_profit = close + (atr * atr_multiplier)
short_stop_loss = close + (atr * atr_multiplier)
short_take_profit = close - (atr * atr_multiplier)
// Entry Conditions
buy_signal = close > fib_level_0_65 and close[1] <= fib_level_0_65 and in_uptrend
sell_signal = close < fib_level_0_65 and close[1] >= fib_level_0_65 and in_downtrend
// Execute Trades
if (buy_signal)
strategy.entry("Buy", strategy.long)
if (sell_signal)
strategy.entry("Sell", strategy.short)
// Exit Conditions
if (strategy.position_size > 0)
strategy.exit("Exit Long", "Buy", stop=long_stop_loss, limit=long_take_profit)
if (strategy.position_size < 0)
strategy.exit("Exit Short", "Sell", stop=short_stop_loss, limit=short_take_profit)
// Plotting
plot(fib_level_0_65, color=color.blue, title="Fibonacci 0.65 Level")
plot(sma, color=color.orange, title="SMA")