Stock Gap Screener

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #182007 quote
    Amin1233
    Participant
    Junior

    Hi . Anyone can help with coding a gap screener to find any stock that opens 2% lower than the lowest of last 10 days or 2% higher than the highest of the last 10 days and the open volume (Volume at the first minute bar) is above average of the past 10 days open volumes.

    #182120 quote
    robertogozzi
    Moderator
    Master

    There you go:

    N  = 10
    LL = lowest[N](low)
    HH = highest[N](high)
    c1 = open >= (HH[1] * 1.02)
    c2 = open <= (LL[1] * 0.98)
    c3 = volume > average[N](volume)
    SCREENER[(c1 OR c2) AND c3](volume as "Volume")

    The average volume is calculated on the whole bar itself, not just the first minute, as it’s not possible because there are only 254 bars available to scan backwards which is about 4 hours only!

    #182394 quote
    robertogozzi
    Moderator
    Master

    The 254-bar limit scarcely allows to scan the first HOUR.
    This is with the first hour (you need to set the opening time of the FIRST hourly candle):

    Timeframe(Daily)
    LL = lowest[N](low)
    HH = highest[N](high)
    //
    Timeframe(1 hour)
    CheckTime = 000000     //time of the opening of the first hourly candle
    N  = 10
    t  = 0
    VL = 0
    FOR i = 0 TO 254
       IF OpenTime[i] = CheckTime THEN
          t = t + 1
          VL = VL + volume[i]
          IF t = N THEN
             Break
          ENDIF
       ENDIF
    NEXT
    FirstHOUR = VL / t
    c1 = open >= (HH[1] * 1.02)
    c2 = open <= (LL[1] * 0.98)
    c3 = volume > FirstHOUR
    SCREENER[(c1 OR c2) AND c3](volume as "Volume")

    As to the strategy I will be able to check the very first minute, as it allows to scan 200K bars!

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

Stock Gap Screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Amin1233 @amin1233 Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/21/2021
Status: Active
Attachments: No files
Logo Logo
Loading...