Screening with Price level Profile

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #83571 quote
    odin
    Participant
    Veteran

    hello guys,

    this nice code is from nicolas. its a great indicator. but i cannot build it up for the pro screener so please help.

     

    i wann search the highest indicator values of the last 12 nbr bars, to get the screenings result.

     

    
    //PRC_Bull&Bear Volume on Price | indicator
    //05.07.2018
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
     
    defparam drawonlastbaronly=true
    defparam calculateonlastbars=1000
     
    // --- settings 
    ScaleFactor = 5
    NbrBars=12
    lookback=200
    // --- end of settings 
     
    hh=highest[lookback](high)
    ll=lowest[lookback](low)
    div = (hh-ll)/NbrBars
    i=0
    volsum=summation[lookback](volume)
    startbar = barindex[lookback]
    while i<NbrBars do
     lrange=ll+div*i
     hrange=lrange+div
     volbull=0
     volbear=0
     for j = 1 to lookback do
      if close[j]>=lrange and close[j]<=hrange then
       if close[j]>open[j] then
        volbull=volbull+volume[j]
       else
        volbear=volbear+volume[j]
       endif
      endif
     next
     bullbar = round((volbull*lookback)/volsum)*scalefactor
     bearbar = round((volbear*lookback)/volsum)*scalefactor
     
     drawrectangle(startbar,lrange,startbar+bullbar,hrange) coloured(46,139,87)
     drawrectangle(startbar,lrange,startbar+bearbar,hrange) coloured(255,0,0)
     
     if bullbar>bearbar then 
      drawtext("■",startbar+bullbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(46,139,87)
     else
      drawtext("■",startbar+bearbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(255,0,0)
     endif
     i=i+1
    wend
    drawvline(barindex[lookback])
     
    return 
    

    here is my try but it doesnet work:

     

    //PRC_Bull&Bear Volume on Price | indicator
    //05.07.2018
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
     
    defparam drawonlastbaronly=true
    defparam calculateonlastbars=1000
     
    // --- settings
    ScaleFactor = 5
    NbrBars=12
    lookback=200
    // --- end of settings
     
    hh=highest[lookback](high)
    ll=lowest[lookback](low)
    div = (hh-ll)/NbrBars
    i=0
    volsum=summation[lookback](volume)
    startbar = barindex[lookback]
    while i<NbrBars do
    lrange=ll+div*i
    hrange=lrange+div
    volbull=0
    volbear=0
    for j = 1 to lookback do
    if close[j]>=lrange and close[j]<=hrange then
    if close[j]>open[j] then
    volbull=volbull+volume[j]
    else
    volbear=volbear+volume[j]
    endif
    endif
    next
    bullbar = round((volbull*lookback)/volsum)*scalefactor
    bearbar = round((volbear*lookback)/volsum)*scalefactor
    endif
     
    c1 = highest[12](bullbar)[1] < bullbar
    c2 highest[12](bearbar)[1] < beabar
    c3 = c1 or c2
    SCREENER[c3 ] sort by volume*close

    thanks for help!

    fehler.jpg fehler.jpg
    #83573 quote
    odin
    Participant
    Veteran

    for this values i wanna screen:

    #83664 quote
    odin
    Participant
    Veteran

    here is the chart i wanna search for:

    can some help, for examplage nicolas?

    MU-Wöchentlich-1.png MU-Wöchentlich-1.png
    #83671 quote
    Nicolas
    Keymaster
    Master

    I’ll have a look this week. Please don’t double post, I saw the same request in the german forum too..

    #83693 quote
    odin
    Participant
    Veteran

    hello nicolas, great. thank you thank you.

    and sorry for my double post. i thougt no one would help me.

    next topic i wanna post just one time.

    good start to the week.

    odin

    #83787 quote
    Nicolas
    Keymaster
    Master

    I made some tests and the problem is that ProScreener is quickly falling into the infinite loop issue.. Reducing the bars and lookback could probably make it possible, but it should also make the screener useless!

    #83788 quote
    Nicolas
    Keymaster
    Master

    Here is the code in its actual state, not accurate, still don’t understand why. I put it here for future reference if needed..

    // --- settings
    ScaleFactor = 5
    NbrBars=10
    lookback=50
    // --- end of settings
    
    //if date=today then
    hh=highest[lookback](high)
    ll=lowest[lookback](low)
    div = (hh-ll)/NbrBars
    i=0
    volsum=summation[lookback](volume)
    //startbar = barindex[lookback]
    
    
    maxi=0
    while i<NbrBars do
    lrange=ll+div*i
    hrange=lrange+div
    volbull=0
    volbear=0
    
    for j = 1 to lookback do
    if close[j]>=lrange and close[j]<=hrange then
    if close[j]>open[j] then
    volbull=volbull+volume[j]
    else
    volbear=volbear+volume[j]
    endif
    endif
    next
    
    
    bullbar = round((volbull*lookback)/volsum)*scalefactor
    bearbar = round((volbear*lookback)/volsum)*scalefactor
    
    maxi=max(maxi,max(bearbar,bullbar))
    if maxi>lastmaxi then
    lastmaxi=maxi
    result=(lrange+hrange)/2
    endif
    
     
    //drawrectangle(startbar,lrange,startbar+bullbar,hrange) coloured(46,139,87)
    //drawrectangle(startbar,lrange,startbar+bearbar,hrange) coloured(255,0,0)
    
    i=i+1
    wend
    //endif
    
    screener[result](result)
    #83853 quote
    odin
    Participant
    Veteran

    Hi Nicolas, some result are very good bottom Buys,

    but after 10 results the screener goes to exit… because a loop is detected…

    you are a monster at coding. wow 🙂

    its not perfect but help me well.

    thank you

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

Screening with Price level Profile


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
odin @odin Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by odin
7 years, 4 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 10/26/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...