Rob Hoffman Inventory Retracement Bars
Forums › ProRealTime English forum › ProBuilder support › Rob Hoffman Inventory Retracement Bars
- This topic has 11 replies, 6 voices, and was last updated 1 year ago by robertogozzi.
Tagged: Bars, Hoffman, Inventory, Inventory Retracement Bars, Overlay, retracement, Rob, Rob Hoffman - Overlay Set
-
-
02/19/2022 at 5:15 AM #188512
Could someone please translate Tradingview’s Rob Hoffman Inventory Retracement Bar Indicator to Prorealtime. Code in Tradingview is as follows:
study(“Rob Hoffman – Overlay Set”, shorttitle = “RH – MAs”, overlay = true)
a = sma(close,3)
b = sma(close,5)c = ema(close,18)
d = ema(close,20)e = sma(close,50)
f = sma(close,89)
g = ema(close,144)
h = sma(close,200)k = ema(close,35)
r = rma(tr,35)
ku = k + r*0.5
kl = k – r*0.5plot(a, title = “Fast Speed Line”, linewidth = 2, color = #0000FF)
plot(b, title = “Slow Speed Line”, linewidth = 2, color = fuchsia)
plot(c, title = “Fast Primary Trend Line”, linewidth = 3, color = #00FF00)
plot(d, title = “Slow Primary Trend Line”, linewidth = 3, color = #000000)
plot(e, title = “Trend Line – 1”, linewidth = 3, color = #0000FF, style = circles)
plot(f, title = “Trend Line – 2”, linewidth = 3, color = #20B2AA)
plot(g, title = “Trend Line – 3”, linewidth = 3, color = #FF4500)
plot(h, title = “Trend Line – 4”, linewidth = 3, color = fuchsia)plot(k, title = “No Trend Zone – Midline”, linewidth = 2, color = #3CB371)
plot(ku, title = “No Trend Zone – Upperline”, linewidth = 2, color = #3CB371)
plot(kl, title = “No Trend Zone – Lowerline”, linewidth = 2, color = #3CB371)02/19/2022 at 3:54 PM #188526The code you posted is the Rob Hoffman – Overlay Set (https://it.tradingview.com/script/al4ABhwU-Rob-Hoffman-Overlay-Set/):
Rob Hoffman - Overlay Set12345678910111213141516171819202122// Rob Hoffman - Overlay Set//// https://it.tradingview.com/script/al4ABhwU-Rob-Hoffman-Overlay-Set/// https://www.prorealcode.com/topic/rob-hoffman-inventory-retracement-bars///Asma = average[3,0](close)Bsma = average[5,0](close)Csma = average[18,0](close)Dsma = average[20,0](close)Esma = average[50,0](close)Fsma = average[89,0](close)Gsma = average[144,0](close)Hsma = average[200,0](close)Kema = average[35,1](close)Rrma, ignored = CALL "Rma"[10,1] //https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/Ku = Kema + (Rrma * 0.5)Kl = Kema - (Rrma * 0.5)RETURN Asma AS "Fast Speed Line",Bsma AS "Slow Speed Line",Csma AS "Fast Primary Trend Line",Dsma AS "Slow Primary Trend Line",Esma AS "Trend Line - 1",Fsma AS "Trend Line - 2",Gsma AS "Trend Line - 3",Hsma AS "Trend Line - 4",Kema AS "NO Trend Zone - MidLine",Ku AS "NO Trend Zone - UpperLine",Kl AS "NO Trend Zone - LowerLine"02/19/2022 at 10:05 PM #188546Hello, Sorry I posted the wrong code for Rob Hoffman Inventory Retracement Bar Indicators
Here is the correct code from Tradingview, if possible to translate to Prorealtime:
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”)
02/21/2022 at 1:07 PM #188604Here is the translation of this last code about Rob Hoffman inventory retracement bars:
12345678910111213141516171819202122232425262728293031z = 45//Inventory Retracement Percentage %// Candle Rangea = abs(high - low)// Candle Bodyb = abs(close - open)// Percent to Decimalc = z/100// Range Verificationrv = b < c*a// Price Level for Retracementx = low + (c * a)y = high - (c * a)sl = rv = 1 and high > y and close < y and open < yss = rv = 1 and low < x and close > x and open > x// Line Definitionif sl thenli=ydrawarrowdown(barindex,high) coloured("red")elsif ss thenli=xdrawarrowup(barindex,low) coloured("green")elseli=(x+y)/2endifreturn li02/21/2022 at 10:43 PM #18863003/27/2022 at 3:14 PM #19058503/27/2022 at 3:24 PM #19058606/01/2023 at 8:11 AM #215527hello I used the overlay set of ROB hoffman posted by roberto tot works except this part of code concerning the "no trend zone" the upper band is calculated because if the puts it in histogram they appear but on the whole screen on the other hand nothing n appears for the lower band I imported the code and the rma [10.1] is present
Kema = average [ 35,1 ] (close )Rrma, ignored = CALL "Rma " [ 10,1 ] //https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/Ku = Kema + (Rrma * 0.5 )KL = Kema- (Rrma * 0.5 )can someone help me
THANKS06/04/2023 at 12:02 PM #215627my fault, you are absolutely right. I misread the original code and used CLOSE, instead of TR, for the calculation of RMA.
This is the new RMA code (I named the file for indicator RmaTR):
RmaTR1234567891011121314151617// RMA - Recursive Moving Average (calcolated on TR, instead of CLOSE)//// https://www.prorealcode.com/topic/media-mobile-ricorsiva/#post-155638////N = 10 //RMA Periods//P = 6 //Smoothing PeriodsN = max(1,min(999,N))P = max(1,min(999,P))myTR = max(Range,max(abs(high - close[1]),abs(low - close[1])))Rma = 0FOR i = N-1 DOWNTO 0j = N - iRma = Rma + (summation[j](myTR[i]) / j)NEXTRma = Rma / NAvg = average[P,0](Rma)RETURN Rma as "RmaTR", Avg as "Average RMA"and this is the modified Rob Hoffman – Overlay Set indicator, that I named Rob Hoffman – Overlay Set TR:
Rob Hoffman - Overlay Set TR1234567891011121314151617181920212223// Rob Hoffman - Overlay Set (calculated on TR, instead of CLOSE)//// https://it.tradingview.com/script/al4ABhwU-Rob-Hoffman-Overlay-Set/// https://www.prorealcode.com/topic/rob-hoffman-inventory-retracement-bars///Asma = average[3,0](close)Bsma = average[5,0](close)Csma = average[18,0](close)Dsma = average[20,0](close)Esma = average[50,0](close)Fsma = average[89,0](close)Gsma = average[144,0](close)Hsma = average[200,0](close)Kema = average[35,1](close)myTR = max(Range,max(abs(high - close[1]),abs(low - close[1])))Rrma, ignored = CALL "RmaTR"[10,1](myTR) //https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/Ku = Kema + (Rrma * 0.5)Kl = Kema - (Rrma * 0.5)RETURN Asma AS "Fast Speed Line",Bsma AS "Slow Speed Line",Csma AS "Fast Primary Trend Line",Dsma AS "Slow Primary Trend Line",Esma AS "Trend Line - 1",Fsma AS "Trend Line - 2",Gsma AS "Trend Line - 3",Hsma AS "Trend Line - 4",Kema AS "NO Trend Zone - MidLine",Ku AS "NO Trend Zone - UpperLine",Kl AS "NO Trend Zone - LowerLine"sorry for the inconvenience.
06/15/2023 at 9:39 AM #21626409/27/2023 at 12:35 PM #22167409/27/2023 at 4:34 PM #221693Thank you for pointing that out, I just realized there are 3 EMAs (C, D and G). This is the updated code:
Rob Hoffman – Overlay Set12345678910111213141516171819202122// Rob Hoffman - Overlay Set//// https://it.tradingview.com/script/al4ABhwU-Rob-Hoffman-Overlay-Set/// https://www.prorealcode.com/topic/rob-hoffman-inventory-retracement-bars///Asma = average[3,0](close)Bsma = average[5,0](close)Cema = average[18,1](close)Demx = average[20,1](close)Esma = average[50,0](close)Fsma = average[89,0](close)Gema = average[144,1](close)Hsma = average[200,0](close)Kema = average[35,1](close)Rrma, ignored = CALL "Rma"[10,1] //https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/Ku = Kema + (Rrma * 0.5)Kl = Kema - (Rrma * 0.5)RETURN Asma AS "Fast Speed Line",Bsma AS "Slow Speed Line",Cema AS "Fast Primary Trend Line",Demx AS "Slow Primary Trend Line",Esma AS "Trend Line - 1",Fsma AS "Trend Line - 2",Gema AS "Trend Line - 3",Hsma AS "Trend Line - 4",Kema AS "NO Trend Zone - MidLine",Ku AS "NO Trend Zone - UpperLine",Kl AS "NO Trend Zone - LowerLine"Rob Hoffman – Overlay Set TR1234567891011121314151617181920212223// Rob Hoffman - Overlay Set (calculated on TR, instead of CLOSE)//// https://it.tradingview.com/script/al4ABhwU-Rob-Hoffman-Overlay-Set/// https://www.prorealcode.com/topic/rob-hoffman-inventory-retracement-bars///Asma = average[3,0](close)Bsma = average[5,0](close)Cema = average[18,1](close)Demx = average[20,1](close)Esma = average[50,0](close)Fsma = average[89,0](close)Gema = average[144,1](close)Hsma = average[200,0](close)Kema = average[35,1](close)myTR = max(Range,max(abs(high - close[1]),abs(low - close[1])))Rrma, ignored = CALL "RmaTR"[10,1](myTR) //https://www.prorealcode.com/prorealtime-indicators/rma-recursive-moving-average/Ku = Kema + (Rrma * 0.5)Kl = Kema - (Rrma * 0.5)RETURN Asma AS "Fast Speed Line",Bsma AS "Slow Speed Line",Cema AS "Fast Primary Trend Line",Demx AS "Slow Primary Trend Line",Esma AS "Trend Line - 1",Fsma AS "Trend Line - 2",Gema AS "Trend Line - 3",Hsma AS "Trend Line - 4",Kema AS "NO Trend Zone - MidLine",Ku AS "NO Trend Zone - UpperLine",Kl AS "NO Trend Zone - LowerLine" -
AuthorPosts
Find exclusive trading pro-tools on