Screener to find ranging and volatile stocks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #72400 quote
    Voldemort
    Participant
    New

    I’m attempting to write a screener that finds stocks which are moving within a price range and is fairly volatile. Here’s an example of what I’m looking for: https://www.tradingview.com/x/dknyWipv/

    I know of multiple indicators that measure the volatility. I guess the trick will be to somehow find an indicator/code something that identifies the ranging/trendless behaviour. Does anyone have any ideas as how to approach this?

    #72411 quote
    Nicolas
    Keymaster
    Master

    Try to count how many times moving average cross over occurred and compare their prices with the median of the last highest high and lowest low, within a percentage margin. Rough idea from your picture, need to be coded and tested!

    #72465 quote
    Voldemort
    Participant
    New

    I will give that a shot and see how it works out. 🙂

    Before your answer I was working on a screener that tried to measure how far away the 100 EMA and the 200 EMA was from each other on average. The idea was that if the distance was less than 2.5% for maybe 70 bars, that could have been one critiera.

    ema200 = ExponentialAverage[200]
    ema100 = ExponentialAverage[100]
    
    periodsMatching = 0
    FOR i = 0 to 200 DO
    distance = ema100[i] / ema200[i]
    IF distance < 1.025 and distance > 0.975 THEN
    periodsMatching = periodsMatching + 1
    ENDIF
    NEXT
    
    SCREENER[periodsMatching > 50](periodsMatching as "bars within range")

    To my suprise, this screener returned a lot of stocks where the amount of bars that exactly fit the criteria was 56. So I think there’s some kind of bug in my screener code here?

    See attached picture.

    Screenshot_20180606_131415.png Screenshot_20180606_131415.png
    #72486 quote
    Nicolas
    Keymaster
    Master

    Because 200 + 56 = 256 which is the limitation of data available in ProScreener.

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

Screener to find ranging and volatile stocks


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Voldemort @voldemort Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Nicolas
7 years, 9 months ago.

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