이 전략은 이동 평균과 트렌드 라인 돌파를 적응하여 입장을 판단하고 RSI 지표를 사용하여 출전을 결정한다. 목표는 트렌드 조건을 충족할 때 시장에 진입하고 오버 바이 영역에서 정지하고 퇴출하는 동시에 한 달에 한 번만 거래하는 것을 통제하는 것이다.
길이가 99인 적응형 이동 평균을 계산하여 전체 트렌드 방향을 판단합니다.
길이가 14인 로컬 피크를 계산하고, 압력선을 표시하는 선로를 그리는 것
마감가격이 상승할 때, 그리고 그 달에는 아직 주문이 없는 경우, 더 많은 입장이 이루어집니다.
14주기 RSI를 계산하고, RSI가 70을 초과할 때 (오버 바이 지역)
매월 한 번만 거래하는 것을 보장하기 위해 마지막 입점의 달을 추적합니다.
적응형 이동 평균은 동적으로 트렌드 변화를 추적할 수 있습니다.
트렌드 라인 브레이크와 결합하여 입점 정확도를 높일 수 있습니다.
RSI 지표는 과매매 현상을 효과적으로 판단하여 실시간으로 위험을 통제할 수 있습니다.
한 달에 한 번만 거래하면 거래 빈도와 수수료를 줄일 수 있습니다.
규칙은 간단하고 명확하며 이해하기 쉽고 실행이 가능합니다.
파라미터를 잘못 설정하면 최적의 입구 지점을 놓칠 수 있습니다.
고정 출구 지표는 시장의 변화를 따라갈 수 없습니다.
일부 철수 위험이 있습니다.
장기 지분에 대한 위험을 통제할 수 없습니다.
너무 많은 필터링 조건으로 인해 출입이 불가능할 수 있습니다.
다양한 변수를 테스트하여 최적의 변수를 찾습니다.
다른 필터링 지표를 추가하여 전략의 안정성을 향상시킵니다.
동적 중지 및 추적 중지 전략을 개발
진출 논리를 최적화하여 더 강력한 돌파구를 식별합니다.
테스트에 적용되는 품종 및 주기 변수
트렌드 지표와 결합하여 가짜 브레이크 신호를 필터링
이 전략은 트렌드 분석과 오버 바이 오버 소이드 지표를 통합하여 비교적 안정적인 트렌드 추적 효과를 달성한다. 추가로 최적화된 파라미터 설정, 동적 출구 메커니즘 등을 통해 신뢰할 수 있는 정량 거래 시스템이 될 수 있다. 전반적으로 이 전략은 조작성이 강해 추가 개선 및 검증에 가치가 있다.
/*backtest
start: 2023-09-11 00:00:00
end: 2023-09-18 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('Bannos Strategy', shorttitle='Bannos', overlay=true)
//The provided script is an indicator for TradingView written in Pine Script version 5. The indicator is used to determine entry and exit points for a trading strategy. Here's a detailed breakdown of what the script does:
// Strategy Definition:
// Bannos Strategy is the full name, with a short title Bannos.
// The overlay=true option indicates that the strategy will be overlayed on the price chart.
// Tracking Entry Month:
// A variable lastEntryMonth is set up to track the month of the last entry.
// currentMonth identifies the current month.
// Trend Regularity Adaptive Moving Average (TRAMA):
// It takes an input of length 99 as default.
// It uses adaptive calculations to track trend changes.
// Trendlines with Breaks:
// Identifies local peaks over a given period (in this case, 14) and calculates a slope based on these peaks.
// Relative Strength Index (RSI):
// Uses a length of 14 (default) to calculate the RSI.
// RSI is an oscillation indicator that indicates overbought or oversold conditions.
// Strategy Logic for Long Entry:
// A long position is opened if:
// The close price is above the TRAMA.
// There's a crossover of the close price and the upper trendline.
// The position is taken only once per month.
// Strategy Logic for Long Exit:
// The long position is closed if the RSI exceeds 70, indicating an overbought condition.
// Plotting:
// The TRAMA is plotted in red on the chart.
// A horizontal line is also drawn at 70 to indicate the RSI's overbought zone.
// In summary, this strategy aims to enter a long position when certain trend and crossover conditions are met, and close the position when the market is considered overbought as per the RSI. Additionally, it ensures entries only occur once a month.
//
// Variable pour suivre le mois de la dernière entrée
var float lastEntryMonth = na
currentMonth = month(time)
// Parameters for Trend Regularity Adaptive Moving Average (TRAMA)
length_trama = input(99)
src_trama = close
ama = 0.
hh = math.max(math.sign(ta.change(ta.highest(length_trama))), 0)
ll = math.max(math.sign(ta.change(ta.lowest(length_trama)) * -1), 0)
tc = math.pow(ta.sma(hh or ll ? 1 : 0, length_trama), 2)
ama := nz(ama[1] + tc * (src_trama - ama[1]), src_trama)
// Parameters for Trendlines with Breaks
length_trend = 14
mult = 1.0
ph = ta.pivothigh(length_trend, length_trend)
upper = 0.
slope_ph = 0.
slope_ph := ph ? mult : slope_ph
upper := ph ? ph : upper - slope_ph
// Parameters for RSI
rsiLength = 14
up = ta.rma(math.max(ta.change(close), 0), rsiLength)
down = ta.rma(-math.min(ta.change(close), 0), rsiLength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// Strategy Logic for Long Entry
longCondition = close > ama and ta.crossover(close, upper) and (na(lastEntryMonth) or lastEntryMonth != currentMonth)
if (longCondition)
lastEntryMonth := currentMonth
strategy.entry('Long', strategy.long)
// Strategy Logic for Long Exit
exitCondition = rsi > 70
if (exitCondition)
strategy.close('Long')
// Plotting
plot(ama, 'TRAMA', color=color.red)
hline(70, 'Overbought', color=color.red)