예스스탁
예스스탁 답변
2023-02-14 13:10:19
안녕하세요
예스스탁입니다.
input : z(45);
var : aa(0),bb(0),cc(0);
var : rv(False),x(0),y(0);
var : sl(False),ss(False);
var : li(0),tx(0);
aa = abs(high - low);
bb = abs(close - open);
cc = z/100;
rv = bb < cc*aa;
x = low + (cc * aa);
y = high - (cc * aa);
sl = rv == true and high > y and close < y and open < y;
ss = rv == true and low < x and close > x and open > x ;
// Line Definition
li = iff(sl , y , iff(ss , x , (x+y)/2));
// Plot Statement
if sl == true Then
{
tx = Text_New_Self(sDate,sTime,li,"▼");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
}
if ss == true Then
{
tx = Text_New_Self(sDate,sTime,li,"▲");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Green);
}
plot1(li,"Inventory Bar Retracement Price Line",Blue);
즐거운 하루되세요
> 도여니 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다.호프만 inventory bar
> study(title="UCS_Rob Hoffman_Inventory Retracement Bar", shorttitle="UCS_RH_IRB", precision=2, overlay=true)
z = input(45, title="Inventory Retracement Percentage %", maxval=100)
// Candle Range
a = abs(high - low)
// Candle Body
b = abs(close - open)
// Percent to Decimal
c = z/100
// Range Verification
rv = b < c*a
// Price Level for Retracement
x = low + (c * a)
y = high - (c * a)
sl = rv == 1 and high > y and close < y and open < y
ss = rv == 1 and low < x and close > x and open > x
// Line Definition
li = sl ? y : ss ? x : (x+y)/2
// Plot Statement
plotshape(sl, style=shape.triangledown, location=location.abovebar, color=red, title = "Long Bar", transp = 0)
plotshape(ss, style=shape.triangleup, location=location.belowbar, color=green, title = "Short Bar", transp = 0)
plot(li, style = line, color = blue, title = "Inventory Bar Retracement Price Line")