ボリンジャーのエクスパンション
code:BB-expansion(js)
//@version=3
strategy(title = "frog", shorttitle = "frog", overlay = true, default_qty_type = strategy.fixed, initial_capital=10000, currency="USD", default_qty_value = 1,slippage=1,commission_type=strategy.commission.percent,commission_value=0)
timescale = (time > timestamp(2018, 1, 1, 00, 00) and time < timestamp(2018, 7, 31, 00, 00))
length = input(20)
katamuki = input(1.10,step=0.01)
katamuki2=input(1.05,step=0.01)
ikioi=input(3,step=0.1)
ma = sma(close, length)
dd = dev(close,length)
gensoku=input(2.5,step=0.1)
if ma+dd*1<close and dd>dd1*katamuki and close1>close// and sma(abs(close-open),3)>sma(abs(close-open),20)*ikioi strategy.entry("buy",strategy.long,na,when=timescale)
if ma-dd*1>close and dd>dd1*katamuki and close1<close// and sma(abs(close-open),3)>sma(abs(close-open),20)*ikioi strategy.entry("short",strategy.short,na,when=timescale)
if dd<dd1*katamuki2// or sma(abs(close-open),3)<sma(abs(close-open),20)*(ikioi-gensoku) strategy.close_all()