
이 전략은 변화된 에너지 유조 지표 (OBV) 와 MACD를 기반으로 거래 신호 판단을 하고, 양 가격 종합 전략에 속한다. 이 전략은 주식 가격 지수 MACD와 변화된 OBV를 양 가격 종합 신호로 결합하여 주식의 양 가격에 강한 약점의 거래 기회를 발견한다.
간단한 이동 평균 (SMA) 을 계산하여 대시장 동향을 판단한다.
계산 변경 OBV. 그것은 종결 가격과 전날 종결 가격의 관계에 따라 OBV의 계산 방법을 변경하여 OBV를 더 민감하게 만든다.
변경된 OBV에 MACD를 계산한다. MACD는 빠른 선, 느린 선, MACD 기둥으로 구성되어 있으며, 양이 변화하는 경향을 발견할 수 있다.
MACD 금포가 상향을 향하면 구매 신호로 판단한다.
MACD가 사각지대에 있고 아래로 향할 때, 판매 신호로 판단한다.
이 경우, SMA의 판단과 함께, 불필요한 거래를 피하십시오.
변화된 OBV는 더 민감하고, 양적인 변화를 미리 포착할 수 있다.
MACD는 트렌드 변화와 핵심 지점을 명확하게 판단할 수 있다.
수량 가격 종합 신호, 신호 정확도를 높인다.
SMA는 대장 트렌드를 판단하여 잘못된 신호를 필터링하는 데 도움이 됩니다.
전략이 명확하고 이해하기 쉬우며, 파라미터를 최적화할 수 있는 공간이 넓다.
OBV를 변경하면 잘못된 신호가 발생할 수 있으며 다른 지표 필터링과 함께 작업해야합니다.
MACD 파라미터를 잘못 설정하면 거래 기회를 놓치거나 잘못된 신호를 생성할 수 있다.
주식 자체에 대한 정보에 주의를 기울여야 하며, 주식 문제로 인한 손실을 피해야 한다.
시장 환경에 주의해야 하며, 특별한 시나리오에는 적용되지 않는다.
데이터 재조합의 위험, 실디 디스크의 효과가 떨어질 수 있다.
다양한 SMA 주기 조합을 테스트하여 대가 트렌드 판단을 최적화한다.
테스트 MACD 변수 설정, 최적화량 변화 판단.
KDJ, RSI 등과 같은 다른 지표 필터 오류 신호를 추가하십시오.
단편적 손실을 통제하기 위한 스톱로스 전략을 추가합니다.
자금 관리 전략을 최적화하고 전체적인 수익효과를 높여라.
다른 주식 전략의 변수 차이를 테스트한다.
이 전략은 OBV와 MACD 지표를 융합하여 OBV와 MACD 지표를 변화시켜 양 가격 결합을 구현하여 주식의 양 에너지 태도의 변화를 사전에 포착하여 거래 신호를 생성한다. OBV 또는 MACD를 단독으로 사용하는 것과 비교하여 이 전략은 더 신뢰할 수 있는 매매 시기를 제공할 수 있다. 그러나 이 전략에는 약간의 잘못된 신호 위험이 있으며, 지표 포트폴리오와 파라미터 설정을 추가적으로 최적화하고, 자본 관리 수단에 보조하여 실물에서 안정적인 수익을 얻기 위해 필요합니다.
/*backtest
start: 2022-11-14 00:00:00
end: 2023-11-14 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("Altered OBV On MACD", overlay=true, margin_long=100, margin_short=100)
// 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
//SMA Tredline
out = ta.sma(close, 200)
outf = ta.sma(close, 50)
outn = ta.sma(close, 90)
outt = ta.sma(close, 21)
outthree = ta.sma(close, 9)
//sma plot
offset = input.int(title="Offset", defval=0, minval=-500, maxval=500)
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)
plot(outthree, color=color.fuchsia, title="MA9", offset=offset)
fast_length = input(title="Fast Length", defval=12)
slow_length = input(title="Slow Length", defval=26)
chng = 0
obv = ta.cum(math.sign(ta.change(close)) * volume)
if close < close[1] and (open < close)
chng := 1
else if close > close[1]
chng := 1
else
chng := -1
obvalt = ta.cum(math.sign(chng) * volume)
//src = input(title="Source", defval=close)
src = obvalt
signal_length = input.int(title="Signal Smoothing", minval = 1, maxval = 50, defval = 9)
sma_source = input.string(title="Oscillator MA Type", defval="EMA", options=["SMA", "EMA"])
sma_signal = input.string(title="Signal Line MA Type", defval="EMA", options=["SMA", "EMA"])
// Calculating
fast_ma = sma_source == "SMA" ? ta.sma(src, fast_length) : ta.ema(src, fast_length)
slow_ma = sma_source == "SMA" ? ta.sma(src, slow_length) : ta.ema(src, slow_length)
macd = fast_ma - slow_ma
signal = sma_signal == "SMA" ? ta.sma(macd, signal_length) : ta.ema(macd, signal_length)
hist = macd - signal
//hline(0, "Zero Line", color=color.new(#787B86, 50))
//plot(hist, title="Histogram", style=plot.style_columns, color=(hist>=0 ? (hist[1] < hist ? col_grow_above : col_fall_above) : (hist[1] < hist ? col_grow_below : col_fall_below)))
//plot(macd, title="MACD", color=col_macd)
//plot(signal, title="Signal", color=col_signal)
[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)
//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)
twohunraise = ta.rising(out, 2)
twentyrise = ta.rising(outt, 2)
macdrise = ta.rising(macd,2)
macdlong = ta.crossover(macd, signal)
longCondition=false
if macdlong and macdrise
longCondition := true
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
//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)
twohunfall = ta.falling(out, 3)
twentyfall = ta.falling(outt, 2)
shortmafall = ta.falling(outthree, 1)
macdfall = ta.falling(macd,1)
macdsell = macd < signal
shortCondition = false
if macdfall and macdsell and (macdLine < signalLine) and ta.falling(low,2)
shortCondition := true
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)