
Chiến lược này sử dụng các chỉ số tương đối mạnh (RSI) để đánh giá tình trạng quá mua và quá bán, kết hợp với sự phá vỡ của điểm thấp cao 9:15 để xác định cơ hội vào thị trường.
Chiến lược này dựa trên điểm cao thấp 9:15, sử dụng chỉ số RSI để đánh giá xu hướng, tự động tính giá mục tiêu và giá dừng lỗ và tự động mở vị trí đầu nhiều hoặc đầu trống tùy theo điều kiện mở vị trí. Logic của chiến lược đơn giản, mức độ tự động hóa cao, có thể nhanh chóng nắm bắt xu hướng. Tuy nhiên, chiến lược cũng có rủi ro về tối ưu hóa tham số, bảng chỉ số đơn, dao động trung bình và quản lý vị trí.
/*backtest
start: 2024-02-01 00:00:00
end: 2024-02-29 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("9:15 AM High/Low with Automatic Forecasting", overlay=true)
// Parameters
showSignals = input(true, title="Show Signals")
// Define session time
sessionStartHour = input(9, title="Session Start Hour")
sessionStartMinute = input(0, title="Session Start Minute")
sessionEndHour = input(9, title="Session End Hour")
sessionEndMinute = input(15, title="Session End Minute")
// Calculate session high and low
var float sessionHigh = na
var float sessionLow = na
if (hour == sessionStartHour and minute == sessionStartMinute)
sessionHigh := high
sessionLow := low
// Update session high and low if within session time
if (hour == sessionStartHour and minute >= sessionStartMinute and minute < sessionEndMinute)
sessionHigh := high > sessionHigh or na(sessionHigh) ? high : sessionHigh
sessionLow := low < sessionLow or na(sessionLow) ? low : sessionLow
// Plot horizontal lines for session high and low
plot(sessionHigh, color=color.green, title="9:00 AM High", style=plot.style_stepline, linewidth=1)
plot(sessionLow, color=color.red, title="9:00 AM Low", style=plot.style_stepline, linewidth=1)
// Calculate targets and stop loss
longTarget = sessionHigh + 200
longStopLoss = sessionLow
shortTarget = sessionLow - 200
shortStopLoss = sessionHigh
// Plot targets and stop loss
plot(longTarget, color=color.blue, title="Long Target", style=plot.style_cross, linewidth=1)
plot(longStopLoss, color=color.red, title="Long Stop Loss", style=plot.style_cross, linewidth=1)
plot(shortTarget, color=color.blue, title="Short Target", style=plot.style_cross, linewidth=1)
plot(shortStopLoss, color=color.red, title="Short Stop Loss", style=plot.style_cross, linewidth=1)
// RSI
rsiLength = input(14, title="RSI Length")
overboughtLevel = input(60, title="Overbought Level")
oversoldLevel = input(40, title="Oversold Level")
rsi = ta.rsi(close, rsiLength)
// Entry conditions
longCondition = close > sessionHigh and rsi > overboughtLevel
shortCondition = close < sessionLow and rsi < oversoldLevel
// Long entry
if (showSignals and longCondition)
strategy.entry("Long", strategy.long)
// Short entry
if (showSignals and shortCondition)
strategy.entry("Short", strategy.short)