この戦略は,K線が連続して上り下りして突破した上で取引する.この戦略は,近年のK線が継続的に上り下りしているかどうかを判断し,短期的なトレンドの機会を捉える.
戦略の原則:
現在のK線と,固定周期前のK線を比較する,例えば5周期前の判断.
連続した複数のK線の閉盤価格が開盤価格より上がったとき,多入場を行う.
連続した複数のK線の閉盘価格が開盘価格より下落したとき,空調入場を行う.
ストップ・ローンを設定し,損失を拡大しないようにしてください.
カスタマイズ可能な履歴回帰周期,最適化パラメータ。
この戦略の利点は
短期的なトレンドは,連続した上昇と下落によって判断できます.
リアルタイムでメッセージのリマインダーが付加され,監視が容易になります.
測量パラメータの最適化はシンプルで,実体にも簡単である.
この戦略のリスクは
平均線が整体で動いていると判断できないので, リスクがある.
停滞点に近づいているため,頻繁に停滞する可能性があります.
リスクの逆転を警戒し,適時に積極的に止めてください.
要するに,この戦略は,K線のトレンド性突破を判断して短線操縦を行うことで,パラメータ最適化後に良好な反測効果を得ることができるが,実盤時には逆転リスクに警戒し,適時停止損益を行う必要がある.
/*backtest
start: 2023-08-13 00:00:00
end: 2023-09-12 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
// strategy("BarUpDn Strategy", overlay=true, initial_capital = 10000, default_qty_value = 10000, default_qty_type = strategy.cash)
BarsUp = input(1)
BarsDown = input(1)
// Strategy Backesting
startDate = input(timestamp("2021-01-01T00:00:00"), type = input.time)
finishDate = input(timestamp("2021-12-31T00:00:00"), type = input.time)
time_cond = true
// Messages for buy and sell
message_buy = input("{{strategy.order.alert_message}}", title="Buy message")
message_sell = input("{{strategy.order.alert_message}}", title="Sell message")
if (close > open and open > close[BarsUp]) and time_cond
strategy.entry("BarUp", strategy.long, stop = high + syminfo.mintick, alert_message = message_buy)
if (close < open and open < close[BarsDown]) and time_cond
strategy.entry("BarDn", strategy.short, stop = low + syminfo.mintick, alert_message = message_sell)
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)