
Chiến lược này kết hợp sử dụng chỉ số Aroon và chỉ số cường độ tuyệt đối ((ASH) nhằm xác định xu hướng thị trường và cơ hội giao dịch tiềm năng. Aroon giúp xác định cường độ và hướng của xu hướng, trong khi đó, ASH cung cấp thông tin chi tiết về sức mạnh động lực. Bằng cách kết hợp các chỉ số này, chiến lược cố gắng nắm bắt cơ hội giao dịch có lợi nhuận trong thị trường Ethereum.
Chiến lược này sử dụng hai nhóm tham số chỉ số Aroon:
ASH có chiều dài 9 đường K, sử dụng giá đóng cửa như nguồn dữ liệu.
Chiến lược này bao gồm các điều kiện nhập và thoát giao dịch cụ thể:
Lợi thế lớn nhất của chiến lược này là kết hợp hai chỉ số. Chỉ số Aroon có thể xác định hiệu quả hướng và cường độ của xu hướng, và chỉ số ASH cung cấp thêm thông tin về động lực để giúp xác định thời gian nhập và thoát.
Ngoài ra, sử dụng chỉ số Aroon với hai tập hợp các tham số khác nhau để đánh giá nhiều khoảng trống, có thể linh hoạt thích ứng với sự thay đổi của tình hình thị trường.
Rủi ro chính của chiến lược này nằm ở những hạn chế của chỉ số. Chỉ số Aroon yếu đối với thị trường trục trặc và dễ gây ra tín hiệu sai. Chỉ số ASH cũng nhạy cảm với sự đảo ngược quá mức trong ngắn hạn.
Ngoài ra, thiết lập tham số nếu không phù hợp cũng có thể ảnh hưởng đến hiệu suất của chiến lược. Cần tối ưu hóa và thử nghiệm khoảng thời gian dài hoặc ngắn của chỉ số Aroon và chiều dài của chỉ số ASH để tìm ra sự kết hợp tham số tối ưu.
Có thể xem xét thêm các bộ lọc, chẳng hạn như phá vỡ giá, tăng khối lượng giao dịch, v.v., để tránh tín hiệu sai trong tình huống biến động.
Bạn có thể thử nghiệm các cặp tham số và trọng số khác nhau để tìm các tham số tối ưu. Bạn cũng có thể thử kết hợp các chỉ số khác, chẳng hạn như RSI, KD, để tạo ra một cặp tham số mạnh hơn và cải thiện hiệu suất chiến lược.
Chiến lược này tích hợp lợi thế của việc sử dụng cả hai chỉ số Aroon và ASH, xác nhận hiệu quả tốt hơn trong việc đánh giá xu hướng và nắm bắt các bước ngoặt thông qua hai chỉ số. Tuy nhiên, các thiết lập tham số và các chỉ số tự giới hạn vẫn cần được tối ưu hóa. Nhìn chung, ý tưởng mới, đáng để cải thiện và xác minh hơn nữa.
/*backtest
start: 2023-03-05 00:00:00
end: 2024-03-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// © IkkeOmar
//@version=5
strategy("Aroon and ASH strategy - ETHERIUM [IkkeOmar]", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, pyramiding=1, commission_value=0, slippage=2)
// AROON SETTINGS ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Inputs for longs
length_upper_long = input.int(56, minval=15)
length_lower_long = input.int(20, minval=5)
// Inputs for shorts
//Aroon Short Side Inputs
length_upper_short = input.int(17, minval=10)
length_lower_short = input.int(55)
// ABSOLUTE STRENGTH HISTOGRAM SETTINGS ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
length = input(title='Length', defval=9)
src = input(title='Source', defval=close)
// CALCULATIONS: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Aroon
upper_long = 100 * (ta.highestbars(high, length_upper_long + 1) + length_upper_long) / length_upper_long
lower_long = 100 * (ta.lowestbars(low, length_lower_long + 1) + length_lower_long) / length_lower_long
upper_short = 100 * (ta.highestbars(high, length_upper_short + 1) + length_upper_short) / length_upper_short
lower_short = 100 * (ta.lowestbars(low, length_lower_short + 1) + length_lower_short) / length_lower_short
// Ahrens Moving Average
ahma = 0.0
ahma := nz(ahma[1]) + (src - (nz(ahma[1]) + nz(ahma[length])) / 2) / length
// CONDITIONS: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Options that configure the backtest start date
startDate = input(title='Start Date', defval=timestamp('01 Jan 2018 00:00'))
// Option to select trade directions
tradeDirection = input.string(title='Trade Direction', options=['Long', 'Short', 'Both'], defval='Long')
// Translate input into trading conditions
longOK = tradeDirection == 'Long' or tradeDirection == 'Both'
shortOK = tradeDirection == 'Short' or tradeDirection == 'Both'
// Check if the close time of the current bar falls inside the date range
inDateRange = true
longCondition = ta.crossover(upper_long, lower_long) and inDateRange and lower_long >= 5 and longOK
longCloseCondition = ta.crossunder(upper_long, lower_long) and inDateRange
shortCondition = ta.crossunder(upper_short, lower_short) and inDateRange and shortOK
shortCloseCondition = ta.crossover(upper_short, lower_short) and inDateRange
// Start off with the initial states for the longs and shorts
var in_short_trade = false
var in_long_trade = false
var long_signal = false
var short_signal = false
if longCondition
long_signal := true
if longCloseCondition
long_signal := false
if shortCondition
short_signal := true
if shortCloseCondition
short_signal := false
// While no trades active and short condition is met, OPEN short
if true and in_short_trade == false and in_long_trade == false and shortCondition
strategy.entry("short", strategy.short, when = shortCondition)
in_short_trade := true
in_long_trade := false
// While no trades and long condition is met, OPEN LONG
if true and in_short_trade == false and in_long_trade == false and longCondition
strategy.entry("long", strategy.long, when = longCondition)
in_long_trade := true
in_short_trade := false
// WHILE short trade and long condition is met, CLOSE SHORT and OPEN LONG
if true and in_short_trade == true and in_long_trade == false and longCondition
// strategy.close("short", when = longCondition)
strategy.entry("long", strategy.long, when = longCondition)
in_short_trade := false
in_long_trade := true
// WHILE long trade and short condition is met, CLOSE LONG and OPEN SHORT
if true and in_short_trade == false and in_long_trade == true and shortCondition
// strategy.close("long", when = shortCondition)
strategy.entry("short", strategy.short, when = shortCondition)
in_short_trade := true
in_long_trade := false
// WHILE long trade and exit long condition is met, CLOSE LONG
// if short signal is active, OPEN SHORT
if true and in_short_trade == false and in_long_trade == true and longCloseCondition
if short_signal
strategy.entry("short", strategy.short, when = short_signal)
in_long_trade := false
in_short_trade := true
else
strategy.close("long", when = longCloseCondition)
in_long_trade := false
in_short_trade := false
// if in short trade only and exit short condition is met, close the short
// if long signal still active, OPEN LONG
if true and in_short_trade == true and in_long_trade == false and shortCloseCondition
if long_signal
strategy.entry("long", strategy.long, when = long_signal)
in_short_trade := false
in_long_trade := true
else
strategy.close("short", when = shortCloseCondition)
in_short_trade := false
in_long_trade := false