Range Filter Buy and Sell 5min convert from tradingview
Forums › ProRealTime English forum › ProBuilder support › Range Filter Buy and Sell 5min convert from tradingview
- This topic has 7 replies, 1 voice, and was last updated 3 years ago by Barrubba.
-
-
04/15/2020 at 4:28 PM #126298
hello everyone, I kindly asked a little good soul if it was possible to convert this indicator
here is the code123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687study(title="Range Filter Buy and Sell 5min", overlay=true)// Sourcesrc = input(defval=close, title="Source")// Sampling Period// Settings for 5min chart, BTCUSDC. For Other coin, change the paremetersper = input(defval=100, minval=1, title="Sampling Period")// Range Multipliermult = input(defval=3.0, minval=0.1, title="Range Multiplier")// Smooth Average Rangesmoothrng(x, t, m)=>wper = (t*2) - 1avrng = ema(abs(x - x[1]), t)smoothrng = ema(avrng, wper)*msmoothrngsmrng = smoothrng(src, per, mult)// Range Filterrngfilt(x, r)=>rngfilt = xrngfilt := x > nz(rngfilt[1]) ? ((x - r) < nz(rngfilt[1]) ? nz(rngfilt[1]) : (x - r)) : ((x + r) > nz(rngfilt[1]) ? nz(rngfilt[1]) : (x + r))rngfiltfilt = rngfilt(src, smrng)// Filter Directionupward = 0.0upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])downward = 0.0downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])// Target Bandshband = filt + smrnglband = filt - smrng// Colorsfiltcolor = upward > 0 ? lime : downward > 0 ? red : orangebarcolor = (src > filt) and (src > src[1]) and (upward > 0) ? lime : (src > filt) and (src < src[1]) and (upward > 0) ? green :(src < filt) and (src < src[1]) and (downward > 0) ? red : (src < filt) and (src > src[1]) and (downward > 0) ? maroon : orangefiltplot = plot(filt, color=filtcolor, linewidth=3, title="Range Filter")// Targethbandplot = plot(hband, color=aqua, transp=100, title="High Target")lbandplot = plot(lband, color=fuchsia, transp=100, title="Low Target")// Fillsfill(hbandplot, filtplot, color=aqua, title="High Target Range")fill(lbandplot, filtplot, color=fuchsia, title="Low Target Range")// Bar Colorbarcolor(barcolor)// Break OutslongCond = nashortCond = nalongCond := ((src > filt) and (src > src[1]) and (upward > 0)) or ((src > filt) and (src < src[1]) and (upward > 0))shortCond := ((src < filt) and (src < src[1]) and (downward > 0)) or ((src < filt) and (src > src[1]) and (downward > 0))CondIni = 0CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]longCondition = longCond and CondIni[1] == -1shortCondition = shortCond and CondIni[1] == 1//Alertsplotshape(longCondition, title = "Buy Signal", text ="BUY", textcolor = white, style=shape.labelup, size = size.normal, location=location.belowbar, color = green, transp = 0)plotshape(shortCondition, title = "Sell Signal", text ="SELL", textcolor = white, style=shape.labeldown, size = size.normal, location=location.abovebar, color = red, transp = 0)alertcondition(longCondition, title="Buy Alert", message = "BUY")alertcondition(longCondition, title="Buy Alert", message = "BUY")alertcondition(longCondition, title="Buy Alert", message = "BUY")alertcondition(shortCondition, title="Sell Alert", message = "SELL")04/15/2020 at 4:40 PM #126305There are some simple rules that everyone using the forums is expected to follow. Your post has broken one or more of these rules.
The forum rules are as follows. I have highlighted in bold the rule/rules that you have not followed:
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.Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Be careful when quoting others in your posts. Only use the quote option when you need to highlight a particular bit of text that you are referring to or to highlight that you are replying to a particular member if there are several involved in a conversation. Do not include large amounts of code in your quotes. Just highlight the text you want to quote and then click on ‘Quote’.
Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.
Do not include personal information such as email addresses or telephone numbers in your posts. If you would like to contact another forum member directly outside of the forums then contact the forums administrator via ‘Contact Us’ and they will pass your details on to the member that you wish to contact.
Always be polite and courteous to others.
Have fun.I have edited your post where required. Please ensure that your future posts meet these few simple forum rules. 🙂
04/15/2020 at 4:42 PM #12630704/15/2020 at 4:56 PM #126309Vonasi forgot to post this link https://www.prorealcode.com/trading-programming-services/
1 user thanked author for this post.
04/16/2020 at 9:59 PM #12645604/16/2020 at 10:19 PM #126457So you double posted as well. That is another forum rule broken!
I have deleted your post in the Italian forum.
At the moment an awful lot of people are staying at home and deciding that they now have the time to check out spread betting/CFD trading and automatic strategy trading so the forums are very busy with new forum members – most of whom do not seem to be reading the simple rules before posting in the forums. This can lead to some delay in replies to your topics so you should try to be a little patient.
04/17/2020 at 1:21 PM #12653505/10/2021 at 9:24 PM #169341 -
AuthorPosts
Find exclusive trading pro-tools on