
이 전략은 이동 평균, 거래량 지표 및 가격 운동 지표를 조합하여 주식이 축적 단계에 들어가는 시점을 식별하기 위해 정량화 규칙을 설계합니다. 이 단계에서 주식은 일반적으로 가격의 평형 및 축적 상태에 있으며, 낮은 가격 입장이 좋은 기회를 제공합니다.
전략은 50일, 90일, 200일 간단한 이동 평균을 사용하여 가격 추세를 판단한다. 가격이 200일선보다 높을 때만 구매 신호가 발생한다. 이것은 큰 추세 하락의 불확실성을 필터링 할 수 있다.
큰 트렌드를 판단하는 것 외에도 전략은 단기 평균선 순서를 판단하여 트렌드를 확인한다. 구체적으로, 50 일선이 90 일선보다 높다고 판단한다.
이동 평균이 큰 트렌드를 확인하고 단기 트렌드가 적합하다는 것을 기반으로, 전략은 거래량 지표 PVT와 MACD 지표를 결합하여 누적 특성을 판단합니다. PVT가 상향으로 돌파되고 MACD 라인이 신호 라인보다 높고 거래량이 확대되면 구매 신호가 발생합니다.
이동 평균을 단독으로 사용하는 것보다, 이 전략은 트렌드를 확인하면서 거래량 특성을 검사한다. 이것은 주식이 축적 단계에 들어가는 시기를 더 정확하게 판단하여 입시 가격 우위를 보장 할 수 있다.
다중 시간 프레임 분석을 통해 이 전략은 중장기 경향 판단과 단기 특징 판단을 결합하여 시간 프레임 매칭을 통해 단일 시간 프레임 판단 오류로 인한 불확실성을 줄일 수 있다.
이 전략은 주로 평평선 판단에 의존하며, 가격이 급격하게 변동할 때 평평선 판단은 무효가 된다. 이때는 포지션 규모를 줄여야 한다.
또한, 축적 단계 판단이 잘못될 수도 있고, 따라서 반전 기회를 놓칠 수도 있다. 이것은 더 많은 특징 지표를 관찰하여 판단을 확인해야 한다.
이 전략은 기계 학습 알고리즘을 도입하여 특징 추출과 모델 훈련을 통해 축적 단계에 대한 자동 판단을 구현할 수 있습니다. 이것은 인위적으로 설정된 스값으로 인한 한계를 줄일 수 있습니다.
또한 이 전략은 다른 시장 환경에서 다른 파라미터를 자동으로 전환하는 브레이크포인트 기능을 시도할 수 있습니다.
이 전략은 전반적으로 가격과 거래량 일치하는 사고 방식을 사용하여 주식 축적 특성을 판단한다. 큰 방향을 확인하면서도 단기 축적 기회를 탐색한다. 매개 변수 최적화 및 기계 학습과 같은 수단을 도입하여 전략 효과를 더 향상시킬 여지가있다.
/*backtest
start: 2023-02-13 00:00:00
end: 2024-02-19 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © stocktechbot
//@version=5
strategy("Accumulate", overlay = true)
lookback = input(defval = 21, title = 'Lookback')
offset = input.int(title="Offset", defval=0, minval=-500, maxval=500)
//SMA Tredline
out = ta.sma(close, 200)
outf = ta.sma(close, 50)
outn = ta.sma(close, 90)
outt = ta.sma(close, 21)
//sma plot
plot(out, color=color.blue, title="MA200", offset=offset)
plot(outf, color=color.maroon, title="MA50", offset=offset)
plot(outn, color=color.orange, title="MA90", offset=offset)
plot(outt, color=color.olive, title="MA21", offset=offset)
//MarketCap Calculation
//MarketCap = 0.0
//TSO = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ", ignore_invalid_symbol = true)
//if str.tostring(TSO) != 'na'
// if ta.barssince(TSO != TSO[1] and TSO > TSO[1])==0
// MarketCap := TSO * close
//
// if barstate.islast and MarketCap == 0
// runtime.error("No MarketCap is provided by the data vendor.")
//
//momlen = 100
//msrc = MarketCap
//mom = msrc - msrc[momlen]
//plotmom = if (mom > mom[1])
// true
//else
// false
//OBV with sma on macd
obv = ta.cum(math.sign(ta.change(close)) * volume)
smoothingLength = 5
smoothingLine = ta.sma(obv,5)
[macdLine, signalLine, histLine] = ta.macd(ta.pvt, 12, 26, 9)
sellvolhigh = macdLine < signalLine
buyvolhigh = macdLine > signalLine
//Buy Signal
mafentry =ta.sma(close, 50) > ta.sma(close, 90)
//matentry = ta.sma(close, 21) > ta.sma(close, 50)
matwohun = close > ta.sma(close, 200)
higheshigh = ta.rising(high, 2)
higheslow = ta.rising(low, 2 )
twohunraise = ta.rising(out, 2)
//highvol = ta.crossover(volume, ta.sma(volume, lookback))
highvol = ta.rising(volume,2)
fourlow = ta.lowest(close, lookback)
fourhig = ta.highest(close, lookback)
change = (((fourhig - fourlow) / fourlow) * 100) <= 30
green = close > open
allup = false
lineabove = ta.cross(close, ta.sma(close, input(defval = 21, title = 'Entry Line')))
if matwohun and mafentry and higheshigh and twohunraise and buyvolhigh
//if higheshigh and higheslow and highvol
allup := true
plotshape(allup, style=shape.arrowup,location=location.belowbar, color=color.green, title = "Buy Signal")
barsSinceLastEntry() =>
strategy.opentrades > 0 ? bar_index - strategy.opentrades.entry_bar_index(strategy.opentrades - 1) : na
//Sell Signal
mafexit =ta.sma(close, 50) < ta.sma(close, 90)
matexit = ta.sma(close, 21) < ta.sma(close, 50)
matwohund = close < ta.sma(close, 200)
linebreak = ta.sma(close, input(defval = 21, title = 'Exit Line')) > close
lowesthigh = ta.falling(high, 3)
lowestlow = ta.falling(low, 2 )
twohunfall = ta.falling(out, 3)
twentyfall = ta.falling(outt, 2)
highvole = ta.crossover(volume, ta.sma(volume, 5))
//fourlow = ta.lowest(close, lookback)
//fourhig = ta.highest(close, lookback)
changed = (((fourhig - close) / close) * 100) >= 10
red = close < open
atr = ta.atr(14)
//atrsmalen = int(bar_index - strategy.opentrades.entry_bar_index(strategy.opentrades - 1) )
atrsmalen = barsSinceLastEntry()
atrsma = false
atrlen = 5
if str.tostring(atrsmalen) != 'NaN' and atrsmalen > 0
atrlen := atrsmalen
atrsma := atr > ta.sma(atr,50)
alldwn = false
if sellvolhigh and lowestlow and (close < close[1] and close < open)
//if higheshigh and higheslow and highvol
alldwn := true
plotshape(alldwn, style=shape.arrowdown,location=location.abovebar, color=color.red, title = "Sell Signal")
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (allup)
strategy.entry("My Long Entry Id", strategy.long)
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (alldwn)
strategy.entry("My Short Entry Id", strategy.short)