
이것은 LazyBear의 파동 트렌드 지표를 기반으로 한 거래 전략이다. 이 전략은 가격 변동의 파동 트렌드를 계산하여 시장의 과매매 상황을 판단하고, 롱링과 쇼팅을 한다.
이 전략은 주로 LazyBear의 파동 트렌드 지표를 기반으로 한다. 우선 가격의 평균값을 계산한다. 그리고 AP의 지수 이동 평균 (ESA) 과 절대 가격 변화의 지수 이동 평균 (D) 을 계산한다. 이를 바탕으로 파동 지수 (CI) 를 계산한다. 그리고 CI의 지수 이동 평균을 계산한다. 파동 트렌드 라인을 얻는다.
이것은 매우 간단하지만 매우 실용적인 트렌드 추적 전략입니다. 다음과 같은 장점이 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이 문제를 해결하기 위한 주요 해결책은 다음과 같습니다.
이 전략에는 더 많은 최적화 가능성이 있습니다:
이 전략은 매우 간단하고 실용적인 파동 트렌드 추적 전략이다. 가격의 변동 동향을 계산하여 시장의 과매매 상태를 식별하고, WT 선의 황금십자가와 죽음의십자를 활용하여 거래 신호를 발산한다. 전략의 동작은 간단하고 구현하기 쉽다. 그러나 트렌드 전략으로서, 주식 가격에 대한 민감도와 안정성에 대한 추가적인 최적화가 필요하며, 다른 지표와 논리와 함께 잘못된 신호를 피하는 것도 필요하다.
/*backtest
start: 2023-11-18 00:00:00
end: 2023-12-18 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//
// @author LazyBear
//
// If you use this code in its original/modified form, do drop me a note.
//
//@version=4
// === INPUT BACKTEST RANGE ===
fromMonth = input(defval = 1, title = "From Month", type = input.integer, minval = 1, maxval = 12)
fromDay = input(defval = 1, title = "From Day", type = input.integer, minval = 1, maxval = 31)
fromYear = input(defval = 2021, title = "From Year", type = input.integer, minval = 1970)
thruMonth = input(defval = 1, title = "Thru Month", type = input.integer, minval = 1, maxval = 12)
thruDay = input(defval = 1, title = "Thru Day", type = input.integer, minval = 1, maxval = 31)
thruYear = input(defval = 2112, title = "Thru Year", type = input.integer, minval = 1970)
// === INPUT SHOW PLOT ===
showDate = input(defval = true, title = "Show Date Range", type = input.bool)
// === FUNCTION EXAMPLE ===
start = timestamp(fromYear, fromMonth, fromDay, 00, 00) // backtest start window
finish = timestamp(thruYear, thruMonth, thruDay, 23, 59) // backtest finish window
window() => true // create function "within window of time"
n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(53, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")
ap = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
wt1 = tci
wt2 = sma(wt1,4)
plot(0, color=color.gray)
plot(obLevel1, color=color.red)
plot(osLevel1, color=color.green)
plot(obLevel2, color=color.red, style=3)
plot(osLevel2, color=color.green, style=3)
plot(wt1, color=color.white)
plot(wt2, color=color.fuchsia)
plot(wt1-wt2, color=color.new(color.blue, 80), style=plot.style_area)
//Strategy
strategy(title="T!M - Wave Trend Strategy", overlay = false, precision = 8, max_bars_back = 200, pyramiding = 0, initial_capital = 1000, currency = currency.NONE, default_qty_type = strategy.cash, default_qty_value = 1000, commission_type = "percent", commission_value = 0.1, calc_on_every_tick=false, process_orders_on_close=true)
longCondition = crossover(wt1, wt2)
shortCondition = crossunder(wt1, wt2)
strategy.entry(id="Long Entry", comment="buy", long=true, when=longCondition and window())
strategy.close("Long Entry", comment="sell", when=shortCondition and window())
//strategy.entry(id="Short Entry", long=false, when=shortCondition)