Possible indicator and screener for the library

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #106043 quote
    JohnScher
    Participant
    Veteran

    Hello, Nikolas.

    Can you check correct programming and if necessary put it in the library so not done? See below…

     

    Part1 .. PG Indicator

    // PopGun Indicator
    // coded by JohnScher
     
    //for the graphics
    PIP = 10*pipsize
    LIN = 3
     
    //percentrenage = Support or Resistance in Percent og the Range High-Low = 25% default
    Support = (High-Low)*percentrange/100
    Resistance = (High-Low)*percentrange/100
     
     
    //indicator PopGun
    PG = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]
     
    // the second outside candle
    PGLong = PG and Close>open // greencandle = long , as rerversal short
    PGShort = PG and Close<Open //redcandle = short, as reversal long
     
     
     
    IF PGLong Then
    rL=0
    gL=0
    bL=250
    DRAWARROWUP(barindex,LOW-PIP)coloured(rL,gL,bL)
    DRAWSEGMENT(barindex,LOW-SUPPORT,barindex+LIN, LOW-SUPPORT )coloured(rL,gL,bL)
    // to trade as reversal red candle = Long
    rL=250
    gL=0
    bL=250
    DRAWARROWDOWN(barindex,HIGH+PIP)coloured(rs,gs,bs)
    DRAWSEGMENT(barindex,High+Resistance,barindex+LIN, High+Resistance )coloured(rs,gs,bs)
    Endif
     
    IF PGShort then
    rS=250
    gS=0
    bS=00
    DRAWARROWDOWN(barindex,HIGH+PIP)coloured(rs,gs,bs)
    DRAWSEGMENT(barindex,High+Resistance,barindex+LIN, High+Resistance )coloured(rs,gs,bs)
    // to trade as reversal red candle = Long
    rL=0
    gL=0
    bL=250
    DRAWARROWUP(barindex,LOW-PIP)coloured(rL,gL,bL)
    DRAWSEGMENT(barindex,LOW-SUPPORT,barindex+LIN, LOW-SUPPORT )coloured(rL,gL,bL)
     
    ENDIF
     
     
    return

     

    Part2… PG Screener

     

    // PopGun screener
    // coded by JohnScher and robertogozzi
    
    PG      = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]
    PGLong  = PG and Close>open
    PGShort = PG and Close<Open
    x = 0
    IF PGLong Then
       x = 1
    Endif
    IF PGShort then
       x = -1
    ENDIF
    SCREENER[x](x as "PG")

     

    Part3 .. Backtest whether the PG is effective

     

     

    // PopGun Backtest
    // coded by JohnScher 
    
    
    p = 5 // could be outside
    
    PG = High[p+2]>High[p+1] and Low[p+2]<Low[p+1] and High [p]>High[p+1] and Low [p]<Low[p+1]
    
    PGLong = PG and Close>open
    PGShort = PG and Close<Open
    
    
    
    d = 0.5 // distance 0.1 0.25 0.5 0.75 ... could be outside too
    distance = (High [p] - Low [p])*d
    
    q = p-1
    c1 = Highest [q] (high) < (High [p] + distance)
    c2 = Lowest [q ] (low) > (Low [p] - distance)
    
    x = 0
    IF PGLong and c1 and c2 Then
    x = 1
    Endif
    IF PGShort and c1 and c2 then
    x = -1
    ENDIF
    
    SCREENER[x](x as "PG")
    

     

    Geht?

    #106044 quote
    Vonasi
    Moderator
    Master

    JohnScher – if you want to contact Nicolas then use the form under the ‘Contact Us’ tab or send him an email at the address shown there – do not start a topic with just his name as the title!

    If you want to submit something to the library then use the correct process by clicking on the ‘+’ sign top right of the screen.

    Also please post in the correct forum. It is a screener you are posting and you posted in the ProOrder forum which is for strategies. I have moved the topic and given it a more meaningful title.

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

Possible indicator and screener for the library


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
JohnScher @johnscher Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Vonasi
6 years, 6 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 08/31/2019
Status: Active
Attachments: No files
Logo Logo
Loading...