
この戦略は,変化したエネルギー潮指標 ((OBV) とMACDによる取引信号判断を行う量価総合戦略の1つである.これは,株式価格指数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を単独で使用するよりも,より信頼性の高い買入や販売の機会を提供することができる.しかし,この戦略には,誤った信号のリスクがあり,指標の組み合わせとパラメータの設定をさらに最適化する必要があり,資金管理の手段に付随して,実存で安定した収益を得ることができる.全体的に,この戦略は,アイデアが明確であり,その潜在性を掘り出すためにさらなるテストと最適化が必要です.
/*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)