Screener for pinbar type candles within a trend

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

    Hello,

    Can someone kindly help this this code for a screener?

    the criteria…Please see screenshot example..

    For buys..

    A bar/ candle that opens and closes fully in the top +50% (or greater )and 8 ema line is above a 20 ema

    and candle must have touched either of the 8 or 20 EMA lines

    For sells..

    A bar/ candle that opens and closes in the  -50% or less and 8 ema is below a 20 ema and has touched either of the moving averages.

    Thanks very much

    pinbars-with-8-and-21-moving-average-trend.jpg pinbars-with-8-and-21-moving-average-trend.jpg
    #173171 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    Ema8  = average[8,1](close)
    Ema20 = average[20,1](close)
    //
    L1    = Ema8 > Ema20
    S1    = Ema8 < Ema20
    //
    L2a   = min(open,close) >= (low + (range / 2))
    L2b   = max(open,close) >= (low + (range / 2))
    L2    = L2a AND L2b
    //
    S2a   = min(open,close) <= (high - (range / 2))
    S2b   = max(open,close) <= (high - (range / 2))
    S2    = S2a AND S2b
    //
    L3    = (low  <= max(Ema8,Ema20)) AND (min(close,open) >= max(Ema8,Ema20))
    S3    = (high >= min(Ema8,Ema20)) AND (max(close,open) <= min(Ema8,Ema20))
    //
    CondL = L1 AND L2 AND L3
    CondS = S1 AND S2 AND S3
    Cond  = 0
    IF CondL THEN
       Cond = 1
    ELSIF CondS THEN
       Cond = 2
    ENDIF
    SCREENER[Cond](Cond AS "1=↑, 2=↓")
    #173173 quote
    nealhartnealhart
    Participant
    Junior

    Wonderful. Thanks very much for your help 🙂

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Screener for pinbar type candles within a trend


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
nealhart @nealhart Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 07/05/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...