Range Filter Buy and Sell 5min convert from tradingview

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #126298 quote
    ryogaxx
    Participant
    New

    hello everyone, I kindly asked a little good soul if it was possible to convert this indicator
    here is the code

    study(title="Range Filter Buy and Sell 5min", overlay=true)
    
    // Source
    
    src = input(defval=close, title="Source")
    
    // Sampling Period
    // Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters
    
    per = input(defval=100, minval=1, title="Sampling Period")
    
    // Range Multiplier
    
    mult = input(defval=3.0, minval=0.1, title="Range Multiplier")
    
    // Smooth Average Range
    
    smoothrng(x, t, m)=>
    wper = (t*2) - 1
    avrng = ema(abs(x - x[1]), t)
    smoothrng = ema(avrng, wper)*m
    smoothrng
    smrng = smoothrng(src, per, mult)
    
    // Range Filter
    
    rngfilt(x, r)=>
    rngfilt = x
    rngfilt := x > nz(rngfilt[1]) ? ((x - r) < nz(rngfilt[1]) ? nz(rngfilt[1]) : (x - r)) : ((x + r) > nz(rngfilt[1]) ? nz(rngfilt[1]) : (x + r))
    rngfilt
    filt = rngfilt(src, smrng)
    
    // Filter Direction
    
    upward = 0.0
    upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
    downward = 0.0
    downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])
    
    // Target Bands
    
    hband = filt + smrng
    lband = filt - smrng
    
    // Colors
    
    filtcolor = upward > 0 ? lime : downward > 0 ? red : orange
    barcolor = (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 : orange
    
    filtplot = plot(filt, color=filtcolor, linewidth=3, title="Range Filter")
    
    // Target
    
    hbandplot = plot(hband, color=aqua, transp=100, title="High Target")
    lbandplot = plot(lband, color=fuchsia, transp=100, title="Low Target")
    
    // Fills
    
    fill(hbandplot, filtplot, color=aqua, title="High Target Range")
    fill(lbandplot, filtplot, color=fuchsia, title="Low Target Range")
    
    // Bar Color
    
    barcolor(barcolor)
    
    // Break Outs
    
    longCond = na
    shortCond = na
    longCond := ((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 = 0
    CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
    longCondition = longCond and CondIni[1] == -1
    shortCondition = shortCond and CondIni[1] == 1
    
    //Alerts
    
    plotshape(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")
    screenshot-1.jpeg screenshot-1.jpeg
    #126305 quote
    Vonasi
    Moderator
    Master

    There 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. 🙂

    #126307 quote
    Vonasi
    Moderator
    Master

    When requesting code conversion please use the link here and provide all the requested information. You have not described what the indicator is or how the indicator works.

    #126309 quote
    robertogozzi
    Moderator
    Master

    Vonasi forgot to post this link https://www.prorealcode.com/trading-programming-services/

    Vonasi thanked this post
    #126456 quote
    ryogaxx
    Participant
    New

    sorry, I didn’t want to break any rules, I had written in the Italian forum but nobody answered me so I wrote here because you seemed more prepared.

    #126457 quote
    Vonasi
    Moderator
    Master

    So 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.

    #126535 quote
    ryogaxx
    Participant
    New

    I am the Italian classic who does not follow the rules 🙂 :)…. I thank those who will help me

    #169341 quote
    Barrubba
    Participant
    New

    Hi, I’m italian too, and I’m interested like you in 5min range b/s strat from TV. Ryogaxx, can you please update me on the status of the conversion, if you have go ahead with it? Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Range Filter Buy and Sell 5min convert from tradingview


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
ryogaxx @ryogaxx Participant
Summary

This topic contains 7 replies,
has 1 voice, and was last updated by Barrubba
4 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/15/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...