
価格チャネルロボットホワイトボックス戦略は,価格チャネル指標に基づく単純な機械化された取引戦略である.これは,価格チャネルの上下限を使用して,入場と出場のタイミングを判断する.この戦略は,ロングタイムが多頭,ホースタイムが空頭である.
価格チャネルロボットのホワイトボックス戦略の核心的な論理は:
この戦略にはいくつかの設定可能なパラメータがあります.
これらのパラメータを調整することで,異なる品種と市場環境に戦略をより良く適応させることができます.
価格チャネルロボットのホワイトボックス戦略は以下の利点があります.
全体として,この戦略はシンプルで実用的なトレンド追跡戦略であり,パラメータを調整すると,良い効果が得られます.
価格チャネルロボットのホワイトボックス戦略にはいくつかのリスクがあります.
これらのリスクを低減するには,以下の点で最適化が必要である.
価格チャネルロボットのホワイトボックス戦略は,さらに最適化できる余地があります.
戦略の安定性や収益性をさらに高めることを期待しています.
価格チャネルロボットのホワイトボックス戦略は,シンプルだが実用的なトレンド追跡戦略である.価格チャネル指標によってトレンドの方向と反転点を判断し,その上で取引決定を行う.この戦略は,理解しやすく,実行でき,パラメータを最適化すると良いリターンを得ることができる.同時に,一定のリスクがあり,パラメータとストップ・ローズを最適化してリスクを低減する必要がある.全体的に,この戦略は,広範囲のアプリケーションの見通しと最適化の可能性があり,探索と実践に値する.
/*backtest
start: 2023-02-21 00:00:00
end: 2024-02-27 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//@version=4
strategy(title = "Robot WhiteBox Channel", shorttitle = "Robot WhiteBox Channel", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0, commission_value = 0.1)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
needstop = input(true, defval = true, title = "Stop-loss")
lotsize = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot, %")
len = input(50, minval = 1, title = "Price Channel Length")
showll = input(true, defval = true, title = "Show lines")
showbg = input(false, defval = false, title = "Show Background")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//Price Channel
h = highest(high, len)
l = lowest(low, len)
center = (h + l) / 2
//Lines
pccol = showll ? color.black : na
slcol = showll ? color.red : na
plot(h, offset = 1, color = pccol)
plot(center, offset = 1, color = slcol)
plot(l, offset = 1, color = pccol)
//Background
size = strategy.position_size
bgcol = showbg == false ? na : size > 0 ? color.lime : size < 0 ? color.red : na
bgcolor(bgcol, transp = 70)
//Trading
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
lot = 0.0
lot := size != size[1] ? strategy.equity / close * lotsize / 100 : lot[1]
if h > 0
strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, stop = h, when = strategy.position_size <= 0 and truetime)
strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, stop = l, when = strategy.position_size >= 0 and truetime)
strategy.entry("S Stop", strategy.long, 0, stop = center, when = strategy.position_size[1] <= 0 and needstop)
strategy.entry("L Stop", strategy.short, 0, stop = center, when = strategy.position_size[1] >= 0 and needstop)
if time > timestamp(toyear, tomonth, today, 23, 59)
strategy.close_all()
strategy.cancel("Long")
strategy.cancel("Short")