Check if a high was broken and if it was broken before

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #82576 quote
    marie123
    Participant
    Junior

    Hello!

    I made a simple screener showing me stocks which broke yesterday’s high. Let’s say I use this screener at 18:00 and I see some stocks. Some of them already broke yesterday’s high minutes or hours before. But I only want to see stocks which broke yesterday’s high the first time today. Is it possible to check if all previous candles today were below yesterday’s high?

    I thought about doing a loop and check if all highs were below yesterday’s high but maybe there is a more efficient way to do?

    This is my simple code so far:

    timeframe(15 minutes)
    highbreak=high[1]>dhigh(1)
    SCREENER [highbreak]

    Any help is appreciated!

    #82581 quote
    marie123
    Participant
    Junior

    Just read something.. would this be correct? I can’t test it right now. Therefore I ask.

    timeframe(15 minutes)
    highbreak=high[1]>dhigh(1) and highest[intradaybarindex-2](high)<dhigh(1)
    SCREENER [highbreak]
    #82624 quote
    Nicolas
    Keymaster
    Master

    Seems ok to me. But you should add a test to verify the highest period is superior to 0, otherwise the screener will be stuck:

    timeframe(15 minutes)
    highbreak=high[1]>dhigh(1) and highest[max(1,intradaybarindex-2)](high)<dhigh(1)
    SCREENER [highbreak]
    marie123 thanked this post
    #82626 quote
    marie123
    Participant
    Junior

    Thanks a lot!

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

Check if a high was broken and if it was broken before


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
marie123 @marie123 Participant
Summary

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

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