Screening for Gaps

Optuma Forums Optuma Scripting Screening for Gaps

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #53049
    AvatarMandeep
    • Topics: 32
    • Replies: 16
    • Posts: 48

    Hi,

    Trying to create a script which removes or identifies stocks which have gapped up or down more than 15% in the last 90 days.   PS this is a screen to avoid volatile stocks which can also crash supported by Andreas Clenow’s work.

    So far the closest I have gotten is using Clark’s volatilty script: highesthigh(cv(), BARS=90) < 5 (but this misses the mark)

    cheers

    Mandeep

    #53051
    DarrenDarren
    • Topics: 43
    • Replies: 304
    • Posts: 347

    Hi Mandeep,

    To define a gap down try something like this to calculate the % difference from the previous bar’s low and the current bar’s high:

    so for a 15% gap the complete formula would be

    For a gap up:

    #53059
    AvatarMandeep
    • Topics: 32
    • Replies: 16
    • Posts: 48

    thanks Darren – would it be correct to use:

    timesincesignal((LOW()[1] – HIGH())/LOW()[1] > 0.15) < 90

    To add the time component of having this gap anytime within the last 90 days

    #53061
    DarrenDarren
    • Topics: 43
    • Replies: 304
    • Posts: 347

    Correct. Remember to use the formula in a Show Bar tool to verify that it is doing what you expect it to be doing.

    In this example your formula is true when the gap occurred within the last 90 bars (trading days), and turns false on the 90th bar:

    Capture

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

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close