[trans]
段階的に敷かれた均線兼和策は,RENKOグラフに基づく取引策である.この策は均線 indicaotrを使用して価格を平滑に処理し,異なる時間周期の均線の交差を買付信号として利用する.この策は,ATR指標に基づいてストップ・ロスを決定し,ストップ・ロスをより合理的にする.
この戦略は主に以下の部分によって実行されます.
RENKOタイムサイクルとATRサイクルを入力して選択する
RENKO価格とカラーを計算し,価格が前のRENKO価格と現在のATRを突破するとに変換され,価格が前のRENKO価格と現在のATRを引くとゼロに変換されます
BUYとSELLの2つの整数を使用して,現在の多発と空発の数を記録します.
が突破すると,空のカードがない場合は開け,空のカードは平らになります. 破盤の時には,余分なカードがない場合は空き,余分なカードは平らになります.
RENKOの図をplotで描く
このような論理により,戦略は価格が突破する前のレベルでポジションを開き,多空し,価格が逆転するときに現在のポジションを平らげる.同時に,ATRを使用して突破幅を決定し,現在の変動率に基づいて合理的なストップロスを決定することができる.
この戦略には以下の利点があります.
RENKOのノイズ消しツールでトレンドを把握する RENKO図は,価格変動のノイズを効果的に消し,より明らかなトレンドの方向を識別します. これは,トレンドを発見し,トレンドをフォローする素晴らしい組み合わせです.
均線交差は取引信号を発信する 異なる時間周期の均線交差は,より信頼性の高い取引信号指標として,騒音に騙されないようにすることができます.
ATRの動態停止 ATRを使用すると,現在の変動率に応じて合理的にストップを設定し,ストップが過大または過小になるのを防ぐことができます.
傾向と平均線を考慮する トレンドと平均線指標を組み合わせると,両者の優位性を同時に利用でき,トレンドを捉えながらも取引シグナルをより信頼できるようにします.
この戦略にはいくつかのリスクがあります.
トレンド判断の誤り RENKOが価格動向を決定する方法には間違いがあるため,不必要な買取・売買の開札に繋がる可能性がある.誤判を減らすためにパラメータを最適化する必要がある.
均線交差偽信号 均線交差シグナルには偽信号が存在する可能性があるため,不必要な買取りの動きを引き起こす.均線周期パラメータを適切に最適化することができる.
ATRパラメータが正しくない ATRサイクル設定が不適切であることも,ストップロスが大きすぎたり小さすぎたりする.異なる市場をテストして,優越したパラメータを決定する必要がある.
大規模な地震 横盤や大波動の状況下では,RENKO図に多くの不必要な取引が発生し,資金占拠を引き起こします.これは,他の指標によってフィルタリングされ,このような状況での取引を避ける必要があります.
この戦略は以下の方向から最適化できます.
RENKOとATRのパラメータを最適化する この2つのパラメータを調整することで,RENKOの誤判を最小限に抑え,RENKOがより正確にトレンドを把握できます.
均線交差フィルターを追加する 平均線をさらに加え,平均線の大半を同向交差で信号を発生させるように要求することで,偽信号をフィルターすることができる.
他の指標をフィルターする 例えば,増量能指標は,量能同向確認時にのみ取引シグナルを生成し,被套を回避することができる.
ストップ・ロスの最適化 ATRを単に追跡するのではなく,トレンドが逆転する時にのみストップする方法を研究し,ストップを合理的にすることができます.
資金管理の最適化 この戦略の下での資金管理を最適化して,利益率を高めながらもリスクをコントロールする方法について研究する.
この戦略は全体的に最適化および実況検証の価値のある戦略であり,その核心となる考え方は,RENKOがトレンドを識別し,均線交差をフィルターされた取引信号として使用することです.ATRの動的ストップと組み合わせると,優位なトレンド追跡戦略になることができます.次のステップは,既知のリスクに対する最適化テストを継続し,戦略パラメータをより完ぺきにすることで,実況パフォーマンスを得ることができます.
||
The Level by Level Build Up Moving Average Strategy is a trading strategy based on RENKO charts. It uses moving average indicators to smooth price and crossovers between moving averages of different timeframes as trading signals. Meanwhile, it also uses the ATR indicator to determine stop loss levels for more reasonable stops.
The core logic of this strategy includes:
Use input to select RENKO timeframe and ATR period
Calculate RENKO price and color. Turn to up when price breaks above previous RENKO price plus current ATR. Turn to down when price falls below previous RENKO price minus current ATR.
Use two integers BUY and SELL to record current long and short positions.
When up breakout, if no short position then go long. If already short then close short position. When down breakout, if no long position then go short. If already long then close long position.
Plot RENKO chart using plot.
With this logic, the strategy can open long or short when price breaks previous level, and close positions when price reverse. Using ATR to determine breakout range makes stop loss more reasonable based on current volatility.
This strategy has the following advantages:
RENKO filters noise and identifies trends RENKO can effectively filter price noise and identify significant trends. This combination is great for trend detection and following.
Moving average crossovers generate trading signals Crossovers between moving averages of different timeframes can provide reliable trading signals and avoid false signals from noise.
Dynamic stops with ATR Using ATR to dynamically set stop loss can make stops more reasonable based on current volatility, avoiding stops too wide or too tight.
Combination of trend and moving average Combining trend and moving average indicators utilizes the strengths of both - catching trends with RENKO while ensuring reliable signals with moving averages.
The strategy also has some risks:
Incorrect trend identification The way RENKO determines trends may result in unnecessary longs or shorts. Parameters need to be optimized to reduce false signals.
False signals from moving average crossovers
There can be false signals from moving average crossovers, causing unnecessary trades. Moving average periods could be optimized.
Improper ATR parameters Improper ATR period setting can also lead to stops too wide or too tight. Different markets should be tested for optimal parameters.
Whipsaw markets In sideways or strong whipsaw markets, RENKO may generate many unnecessary trades, occupying capital. Other filters are needed to avoid trading such markets.
The strategy can be optimized in the following aspects:
Optimize RENKO and ATR parameters
Adjust these parameters to minimize RENKO false signals and better catch trends.
Add moving average crossover filters Add more moving averages and require most of them to align before generating signals, to filter false signals.
Add other indicator filters For example, add volume to only take trades when volume confirms price, avoiding traps.
Improve stop loss strategy Research how to use trend-based stops instead of simply tracking ATR, for more logical stops.
Optimize money management Research optimal capital allocation under this strategy to maximize returns while controlling risks.
Overall this is a strategy worth optimizing and testing in live markets. The core idea of using RENKO for trend and moving average crossovers as filtered signals is sound. With dynamic ATR stops it can become a solid trend following system. The next step is to continue optimizing it based on the known risks to improve parameters and performance.
/*backtest
start: 2022-09-19 00:00:00
end: 2023-09-25 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Renko Level Strategy 2", shorttitle="RLS2", overlay=true, pyramiding=2, currency=currency.USD, default_qty_value=50, initial_capital=2000, default_qty_type=strategy.percent_of_equity)
TF = input(title='TimeFrame', type=input.resolution, defval="D")
ATRlength = input(title="ATR length", type=input.integer, defval=14, minval=2, maxval=100)
HIGH = security(syminfo.tickerid, TF, high)
LOW = security(syminfo.tickerid, TF, low)
CLOSE = security(syminfo.tickerid, TF, close)
ATR = security(syminfo.tickerid, TF, atr(ATRlength))
float RENKO = na
color COLOR = na
int BUY = na
int SELL = na
bool UP = na
bool DN = na
RENKO := na(RENKO[1]) ? close : RENKO[1]
COLOR := na(COLOR[1]) ? color.white : COLOR[1]
BUY := na(BUY[1]) ? 0 : BUY[1]
SELL := na(SELL[1]) ? 0 : SELL[1]
UP := false
DN := false
if(close > RENKO[1]+ATR[1])
UP := true
RENKO := close
COLOR := color.lime
SELL := 0
BUY := BUY+1
if(close < RENKO[1]-ATR[1])
DN := true
RENKO := close
COLOR := color.red
BUY := 0
SELL := SELL+1
if(BUY[1]==1 and BUY==2)
strategy.entry("long", strategy.long)//, limit = RENKODN)
if(DN)
strategy.cancel_all()
strategy.close_all(comment = "close")
plot(RENKO, style=plot.style_line, linewidth=2, color=COLOR)