Print HH HL LL LH in PRTv11
Forums › ProRealTime English forum › ProBuilder support › Print HH HL LL LH in PRTv11
- This topic has 6 replies, 3 voices, and was last updated 4 years ago by Monobrow.
-
-
12/22/2020 at 3:19 PM #154895
Hi,
I use below code to print HH HL LL and LH in tradingview. I am looking for same in PRT. I have seen some topics here but mostly allow me to print e.g. the value but is it possible to determine HH HL LL and LH in PRT e.g. using Arrays?
Andrea, Ale, anyone? Appreciate your helping hands. Thanks.
TradingView code to print HH HL LL LH123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869//Only prints HH HL LL LH//@version=3study("HH HL LH LL", overlay =true)lb = input(3, title="Left Bars", minval = 1)rb = input(6, title="Right Bars", minval = 1)mb = lb + rb + 1ph = iff(not na(high[mb]), iff(highestbars(high, mb) == -lb, high[lb], na), na) // Pivot Highpl = iff(not na(low[mb]), iff(lowestbars(low, mb) == -lb, low[lb], na), na) // Pivot Lowhl = nahl := iff(ph, 1, iff(pl, -1, na)) // Trend directionzz = nazz := iff(ph, ph, iff(pl, pl, na)) // similar to zigzag but may have multiple highs/lowszz :=iff(pl and hl == -1 and valuewhen(hl, hl, 1) == -1 and pl > valuewhen(zz, zz, 1), na, zz)zz :=iff(ph and hl == 1 and valuewhen(hl, hl, 1) == 1 and ph < valuewhen(zz, zz, 1), na, zz)hl := iff(hl==-1 and valuewhen(hl, hl, 1)==1 and zz > valuewhen(zz, zz, 1), na, hl)hl := iff(hl==1 and valuewhen(hl, hl, 1)==-1 and zz < valuewhen(zz, zz, 1), na, hl)zz := iff(na(hl), na, zz)findprevious()=> // finds previous three points (b, c, d, e)ehl = iff(hl==1, -1, 1)loc1 = 0.0, loc2 = 0.0, loc3 = 0.0, loc4 = 0.0xx = 0for x=1 to 1000if hl[x]==ehl and not na(zz[x])loc1 := zz[x]xx := x + 1breakehl := hlfor x=xx to 1000if hl[x]==ehl and not na(zz[x])loc2 := zz[x]xx := x + 1breakehl := iff(hl==1, -1, 1)for x=xx to 1000if hl[x]==ehl and not na(zz[x])loc3 := zz[x]xx := x + 1breakehl := hlfor x=xx to 1000if hl[x]==ehl and not na(zz[x])loc4 := zz[x]break[loc1, loc2, loc3, loc4]a = na, b = na, c = na, d = na, e = naif not na(hl)[loc1, loc2, loc3, loc4] = findprevious()a := zzb := loc1c := loc2d := loc3e := loc4_hh = zz and (a > b and a > c and c > b and c > d)_ll = zz and (a < b and a < c and c < b and c < d)_hl = zz and ((a >= c and (b > c and b > d and d > c and d > e)) or (a < b and a > c and b < d))_lh = zz and ((a <= c and (b < c and b < d and d < c and d < e)) or (a > b and a < c and b > d))plotshape(_hl, text="HL", title="Higher Low", style=shape.labelup, color=lime, textcolor=black, location=location.belowbar, transp=0, offset = -lb)plotshape(_hh, text="HH", title="Higher High", style=shape.labeldown, color=lime, textcolor=black, location=location.abovebar, transp=0, offset = -lb)plotshape(_ll, text="LL", title="Lower Low", style=shape.labelup, color=red, textcolor=white, location=location.belowbar, transp=0, offset = -lb)plotshape(_lh, text="LH", title="Lower High", style=shape.labeldown, color=red, textcolor=white, location=location.abovebar, transp=0, offset = -lb)Regards,
Ash
12/22/2020 at 4:09 PM #154898ashehzi – Your topic has been moved to the ProBuilder forum as it is an indicator topic and not a general discussion topic.
When posting any further topics please follow the forum rules that you will find just above the submit button:
- Post your topic in the correct forum:
_ ProRealTime Platform Support: only platform related issues.
_ ProOrder: only strategy topics.
_ ProBuilder: only indicator topics.
_ ProScreener: only screener topics
_ General Discussion: any other topics.
_ Welcome New Members: for new forum members to introduce themselves.
Also there is a standard format for coding requests – see here:
https://www.prorealcode.com/free-code-conversion/
Images of how the indicator looks are useful so that the person converting your code know how the indicator is supposed to look without having to do further research.
12/22/2020 at 7:30 PM #15491012/23/2020 at 10:37 AM #154957I’ve created new post in code conversion section. The URL is:
https://www.prorealcode.com/topic/printing-hh-hl-ll-lh-in-prtv11/
Admins, please remove this post if possible.
Thanks a lot.
12/23/2020 at 11:48 AM #154966That now just creates a double post which leads to confusion and wasted time. You have provided the required info in this topic so the other unnecessary one has been deleted.
Nicolas will add your request to his long list of conversion requests and try to fit it in between mouthfuls of turkey! 🙂
01/12/2021 at 11:48 AM #15750401/12/2021 at 12:09 PM #157513Also check out the snippet library.
https://www.prorealcode.com/topic/your-very-own-code-snippet-library/
loads of good stuff in here, likely what you need or will give you the info to code it.
- Post your topic in the correct forum:
-
AuthorPosts
Find exclusive trading pro-tools on