Relative Volume Rankings Error

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #187370 quote
    revstrat
    Participant
    New

    Hi,

    I am struggling to figure out why this simple screener isn’t working.

    I called this indicator created by Nicolas (the Relative Volume version): https://www.prorealcode.com/topic/relative-volume-rvol/

    Then, I would like to run a screen from the ones with the top values for the day. I get an error:
    “Syntax error: line 3, character 30
    Syntax Error in Assignment”

    Please assist. Would really appreciate it, thank you.

    myRVOL = CALL "RVOL"
    
    c1 = myRVOL > 1
    c2 = volume > 10000
    
    criteria = myRVOL
    
    screen = c1 AND c2
    
    screener [screen](criteria AS "Relative VOL")
    #187655 quote
    revstrat
    Participant
    New

    Anyone?

    #187676 quote
    nonetheless
    Participant
    Master

    try the ProBuilder support forum

    #187689 quote
    robertogozzi
    Moderator
    Master

    It’s ProScreener. I’ll move it.

    Do not double post.

    I’ll check it tomorrow.

    #187806 quote
    robertogozzi
    Moderator
    Master

    Try using the attached ITF file.

    It works fine.

    Il-Mio-Sistema.itf
    #187854 quote
    revstrat
    Participant
    New

    Are you sure this is the code? Looks like its related to a trading system, not ranking stocks based on relative volume.

    Also, please make it in english if you can, thank you!

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    DEFPARAM FLATAFTER = 235900
    // Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
    noEntryBeforeTime = 065900
    timeEnterBefore = time >= noEntryBeforeTime
     
    // Verhindert das Trading an bestimmten Wochentagen
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
     
    R1 = 2*((DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4) - DLow(1)  //R1
    PP = (DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4  //PP Punkt
    S1 = 2*((DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4) - DHigh(1) //S1
     
     
    // Bedingungen zum Einstieg in Long-Positionen
     
    L1 = (close > S1)       // Range unten
    L2 = (close < R1)       // Range oben
    L3 = (close < PP)       // Bedingung Long
    S3 = (close > PP)       // Bedingung Short
    ELL = (close >= PP)      // Tradeziel Long
    ELS = (close <= PP)      // Tradeziel Short
     
    c0 = opentime=070000     // Tradestart open 0700
     
     
    IF  NOT LongOnMarket and L1 and L2 AND L3 and c0 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Long-Positionen
     
    IF LONGOnMarket AND ELL THEN
    SELL AT MARKET
    ENDIF
     
    // Bedingungen zum Einstieg in Short-Positionen
     
    IF  NOT ShortOnMarket AND L1 and L2 AND S3 and c0 THEN
    Sell 1 CONTRACT AT MARKET
    ENDIF
     
    // Bedingungen zum Ausstieg von Short-Positionen
    IF ShortOnMarket AND ELS THEN
    EXITSHORT AT MARKET
    ENDIF
     
    // Stops und Targets
    SET STOP pLOSS sl //400
    SET TARGET pPROFIT tp  //100
    
    #188223 quote
    revstrat
    Participant
    New

    Anyone have any suggestions please? I think this is an important screener for all intraday stock traders and would be appreciated by the community if resolved.

    #188230 quote
    robertogozzi
    Moderator
    Master

    Sorry, I attached a wrong file.

    This is the screener (it’s yours):

    myRVOL = CALL "RVOL"
    c1 = myRVOL > 1
    c2 = volume > 10000
    criteria = myRVOL
    screen = c1 AND c2
    screener [screen](criteria AS "Relative VOL")

    and this is the RVOL indicator:

    // https://www.prorealcode.com/topic/relative-volume-rvol/
    rvol = volume/average[5](volume)
    return rvol

    I tested both of them on a Daily chart and they work like a charm.

    #188249 quote
    revstrat
    Participant
    New
    The indicator is incorrect. That’s not relative volume. That’s just “above average volume”. The other indicator is relative volume which doesn’t work when used. Please let me know if that makes sense or not, happy to clear it up.

    I tested both of them on a Daily chart and they work like a charm.

    #188250 quote
    robertogozzi
    Moderator
    Master

    It’s Nicolas’code I found at the link you posted.

    If it’s not correct, post the code you are using.

    #188287 quote
    revstrat
    Participant
    New

    Nicolas’ code has two versions. The correct one which shows relative volume is this one:

    Period = 5 //X days averaging period
     
    intraindex = intradaybarindex
    $ivol[intraindex] = volume
     
    $gvol[barindex] = volume
    $gintraindex[barindex] = intraindex
     
    count = 0
    sum = 0
    for i = barindex downto 0 do 
    if $gintraindex[i]=intraindex then //found same intraday bar 
    sum=sum+$gvol[i]
    count=count+1
    endif
    if count=period then 
    break
    endif
    next
     
    avg = sum/period
    rvol = $ivol[intraindex] / avg
     
    return rvol style(histogram)//$ivol[intraindex], avg coloured(255,0,0)
    #188305 quote
    robertogozzi
    Moderator
    Master

    Still no error is reported.

    I am attaching the two files I used.

    Rvol.itf MyProScreener.itf
    #188355 quote
    revstrat
    Participant
    New

    This is so weird. I just ran the exact same screener code that I had already saved in my prorealtime to test it first and it now works!

    Anyway, thanks a lot Robert for being so responsive and willing to help.

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

Relative Volume Rankings Error


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
revstrat @revstrat Participant
Summary

This topic contains 12 replies,
has 3 voices, and was last updated by revstrat
4 years ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 02/02/2022
Status: Active
Attachments: 3 files
Logo Logo
Loading...