Double Pin Bar Bullish/Bearish

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #66241 quote
    HeisenburgHeisenburg
    Participant
    New

    Hi, Would anyone be able to help with the coding on how to screen for 2 consecutive pinbars?  I have had a look on the forum and can only see coding for one pinbar and struggling to know how to code for 2 pinbars.

    Thanks

    #66384 quote
    HeisenburgHeisenburg
    Participant
    New

    If anyone can provide any wisdom to this you would make my day!  🙂  I’ve scanned all 20 pages in this forum as well as reading the 29 page manual on coding with the hope of finding a few snippets of code to help in my quest and I’m still none the wiser.

    #66396 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    How do you want a Pin Bar to be defined?

    1. number of pips of upper shadow (or percentage on whole range), i.e. say 20 pips or 50%-70% of its range
    2. number of pips of lower shadow (or percentage on whole range), i.e. say 5 pips or 5%-30% of its range
    3. number of pips of body size (or percentage on whole range), i.e. say 10 pips or 5%-20% of its range.

    Once it’s defined it will be easy to detect as many as you want.

    #66416 quote
    NicolasNicolas
    Keymaster
    Legend

    I found an old topic with a Pinbar code, made a consecutive 2 bullish or bearish pinbars detection screener:

    body = ABS(open-close)
    bearishwick = ABS(high-close)
    bearishnose = ABS(close-low)
    bullishwick = ABS(close-low)
    bullishnose = ABS(high-close)
    
    //bearish pinbar
    bearishpinbar = (body/bearishwick)<20/100 AND (body/bearishnose)>100/100 
    
    //bullish pinbar
    bullishpinbar = (body/bullishwick)<20/100 and (body/bullishnose)>100/100 
    
    test = summation[2](bearishpinbar or bullishpinbar)=2
    
    screener [test]

    In each case, the body of candlestick must be inferior to 20% of the wick, and larger than nose.

    robertogozzi thanked this post
    #66490 quote
    HeisenburgHeisenburg
    Participant
    New

    Thanks Nicolas, much appreciated, is there a way of getting the two previous bars before the current one?  Just that if I run this for Daily Pinbars, it would include a forming Pinbar which might not end up being a pinbar once the candle closes.

    Cheers

    #66505 quote
    NicolasNicolas
    Keymaster
    Legend

    You can try by modifying the line 13:

    test = summation[3](bearishpinbar or bullishpinbar)>=2
Viewing 6 posts - 1 through 6 (of 6 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

Double Pin Bar Bullish/Bearish


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Heisenburg @heisenburg Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by NicolasNicolas
8 years, 5 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/24/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...