Pivot Reversal Strategy Alerts screener

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #100124 quote
    andyj
    Participant
    Junior

    HI

    Can this be converted into a screener?

    /PRC_Pivot Reversal Strategy | indicator
    //14.02.2019
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    // — settings
    leftp = 4
    rightp = 2
    // — end of settings
    period=max(leftp,rightp)
    hh = highest[period](high)
    ll = lowest[period](low)
    if hh<>hh[1] then
    hhbar=barindex
    hhprice=high
    endif
    if ll<>ll[1] then
    llbar=barindex
    llprice=low
    endif
    if barindex-hhbar=rightp then
    drawtext(“•”,hhbar,hhprice) coloured(168,168,168)
    top=hhprice
    endif
    if barindex-llbar=rightp then
    drawtext(“•”,llbar,llprice) coloured(168,168,168)
    bottom=llprice
    endif
    atr=averagetruerange[14]
    if high crosses over top and lastsig<=0 then
    drawarrowup(barindex,low-atr/2) coloured(30,144,255)
    lastsig=1
    endif
    if low crosses under bottom and lastsig>=0 then
    drawarrowdown(barindex,high+atr/2) coloured(255,48,48)
    lastsig=-1
    endif
    RETURN

     

    #100132 quote
    robertogozzi
    Moderator
    Master

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    Insert-PRT-Code.png Insert-PRT-Code.png
    #100134 quote
    robertogozzi
    Moderator
    Master

    Not tested:

    /PRC_Pivot Reversal Strategy | indicator
    //14.02.2019
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    // — settings
    leftp = 4
    rightp = 2
    // — end of settings
    period=max(leftp,rightp)
    hh = highest[period](high)
    ll = lowest[period](low)
    if hh<>hh[1] then
       hhbar=barindex
       hhprice=high
    endif
    if ll<>ll[1] then
       llbar=barindex
       llprice=low
    endif
    if barindex-hhbar=rightp then
       drawtext(“•”,hhbar,hhprice) coloured(168,168,168)
       top=hhprice
    endif
    if barindex-llbar=rightp then
       drawtext(“•”,llbar,llprice) coloured(168,168,168)
       bottom=llprice
    endif
    atr=averagetruerange[14]
    x = 0
    if high crosses over top and lastsig<=0 then
       //drawarrowup(barindex,low-atr/2) coloured(30,144,255)
       lastsig=1
       x = 1
    endif
    if low crosses under bottom and lastsig>=0 then
       //drawarrowdown(barindex,high+atr/2) coloured(255,48,48)
       lastsig=-1
       x = 2
    endif
    SCREENER[x](x AS "1=↑, 2=↓")
    #100135 quote
    andyj
    Participant
    Junior

    Thank you, very near… but error “drawtext” is only used for indicator programming

     

    Kind Rgds

    Andy

    #100138 quote
    robertogozzi
    Moderator
    Master

    Just comment those two lines out.

    #100151 quote
    andyj
    Participant
    Junior

    Many thanks, I had to remove the text ATR as well and it worked, thank you so much

    #100942 quote
    justme
    Participant
    New

    can we have the final working code for this screener, many thanks for your work and support.

    #100958 quote
    Nicolas
    Keymaster
    Master

    I think that it should be something like:

    /PRC_Pivot Reversal Strategy | indicator
    //14.02.2019
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    // — settings
    leftp = 4
    rightp = 2
    // — end of settings
    period=max(leftp,rightp)
    hh = highest[period](high)
    ll = lowest[period](low)
    if hh<>hh[1] then
       hhbar=barindex
       hhprice=high
    endif
    if ll<>ll[1] then
       llbar=barindex
       llprice=low
    endif
    if barindex-hhbar=rightp then
       //drawtext(“•”,hhbar,hhprice) coloured(168,168,168)
       top=hhprice
    endif
    if barindex-llbar=rightp then
       //drawtext(“•”,llbar,llprice) coloured(168,168,168)
       bottom=llprice
    endif
    //atr=averagetruerange[14]
    x = 0
    if high crosses over top and lastsig<=0 then
       //drawarrowup(barindex,low-atr/2) coloured(30,144,255)
       lastsig=1
       x = 1
    endif
    if low crosses under bottom and lastsig>=0 then
       //drawarrowdown(barindex,high+atr/2) coloured(255,48,48)
       lastsig=-1
       x = 2
    endif
    SCREENER[x](x AS "1=↑, 2=↓")
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Pivot Reversal Strategy Alerts screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
andyj @andyj Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by Nicolas
6 years, 8 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/07/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...