
가격 통로 로봇 화이트 박스 전략은 가격 통로 지표에 기반한 간단한 기계화 거래 전략이다. 가격 통로의 상하한을 사용하여 입구와 출구 시간을 판단한다. 이 전략은 longtime가 다중,shortime가 공백이다.
가격 통로 로봇의 백박스 전략의 핵심 논리는 다음과 같습니다.
이 전략에는 몇 가지 구성 가능한 변수들이 있습니다.
이러한 매개 변수를 조정함으로써, 전략은 다양한 품종과 시장 환경에 더 잘 적응할 수 있습니다.
가격 통로 로봇 백박스 전략은 다음과 같은 장점이 있습니다.
전체적으로 보면 이 전략은 간단하고 실용적인 트렌드 추적 전략으로, 파라미터를 조정하면 좋은 효과를 얻을 수 있다.
가격 통로로봇의 백박스 전략에는 몇 가지 위험도 있습니다.
이러한 위험을 줄이기 위해서는 다음과 같은 부분에서 최적화가 필요합니다.
가격 통로 로봇 백박스 전략에는 더 많은 최적화가 가능합니다.
이러한 최적화 수단으로 전략의 안정성과 수익성을 더욱 높일 수 있을 것입니다.
가격 통로 로봇 화이트 박스 전략은 간단하지만 실용적인 트렌드 추적 전략이다. 가격 통로 지표를 통해 트렌드 방향과 역점을 판단하여 거래 결정을 내린다. 이 전략은 이해하기 쉽고 구현할 수 있으며, 매개 변수를 조정하면 좋은 수익을 얻을 수 있다. 또한 위험도 있지만, 위험을 낮추기 위해 매개 변수 및 스톱 손실을 최적화해야 한다.
/*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")