Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

3x doji in a row / tradingview screener

Jun 10, 2021 - 10:29 PM

Viewed 1367 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/24592 COPY
  • Is there anyway I can set up the screener to find 3x doij's in a row on a 4 hour timeframe?

    There is a option called 'pattern' and 'doij' but it just finds a single one, which is thousands of charts.

    Can the pinescript create custom search value's within 'screener'? Or maybe there's already something build in? Can anyone help me with this? Much appreciated!

    doij.png

    0
  • Hi

    It will need to be a custom Pinescript
    You already find the script to detect a Doji and I'm giving you now the script to build a screener around this triple Dojis: https://www.tradingview.com/script/om1WoPb0-Ultimate-Screener-Template/

    You can create the alerts on a 4h chart then

    Doji code

    C_Len = 14 // ema depth for bodyAvg
    C_ShadowPercent = 5.0 // size of shadows
    C_ShadowEqualsPercent = 100.0
    C_DojiBodyPercent = 5.0
    C_Factor = 2.0 // shows the number of times the shadow dominates the candlestick body
    
    C_BodyHi = max(close, open)
    C_BodyLo = min(close, open)
    C_Body = C_BodyHi - C_BodyLo
    C_BodyAvg = ema(C_Body, C_Len)
    C_SmallBody = C_Body < C_BodyAvg
    C_LongBody = C_Body > C_BodyAvg
    C_UpShadow = high - C_BodyHi
    C_DnShadow = C_BodyLo - low
    C_HasUpShadow = C_UpShadow > C_ShadowPercent / 100 * C_Body
    C_HasDnShadow = C_DnShadow > C_ShadowPercent / 100 * C_Body
    C_WhiteBody = open < close
    C_BlackBody = open > close
    C_Range = high-low
    C_IsInsideBar = C_BodyHi[1] > C_BodyHi and C_BodyLo[1] < C_BodyLo
    C_BodyMiddle = C_Body / 2 + C_BodyLo
    C_ShadowEquals = C_UpShadow == C_DnShadow or (abs(C_UpShadow - C_DnShadow) / C_DnShadow * 100) < C_ShadowEqualsPercent and (abs(C_DnShadow - C_UpShadow) / C_UpShadow * 100) < C_ShadowEqualsPercent
    C_IsDojiBody = C_Range > 0 and C_Body <= C_Range * C_DojiBodyPercent / 100
    C_Doji = C_IsDojiBody and C_ShadowEquals
    
    patternLabelPosLow = low - (atr(30) * 0.6)
    patternLabelPosHigh = high + (atr(30) * 0.6)
    
    label_color_neutral = input(color.gray, "Label Color Neutral")
    C_DojiNumberOfCandles = 1
    C_DragonflyDoji = C_IsDojiBody and C_UpShadow <= C_Body
    C_GravestoneDojiOne = C_IsDojiBody and C_DnShadow <= C_Body
    
    is_doji = C_Doji and not C_DragonflyDoji and not C_GravestoneDojiOne
    
    signal = is_doji and is_doji[1] and is_doji[2]
    

    Then use this in the screener above

    0
  • Hi Dave, forgot about this topic, appreciate it that you are willing to help. I would not have been able to figure this out myself.

    I'm really bad at coding, I'm still stuck. Can you walk me through?

    • Added your ultimate screener template(added through with indicators). It's now in pinescript but read-only.
    • Screener -> set 4H and set doij pattern
    • Where do I put the doij code? Again in pine or where?

    Thanks for your help!

    0
  • Hi

    I didn't test but I did this quickly for 3 securities in the screener
    https://pastebin.com/p9dLi3ft

    You'll have to adapt it and add the 37 other securities (I didn't do it because it's long to do and that's a free job :p)

    0
  • TY Dave, added it. Gonna run it awhile and see if it works :)

    1
CONTENTS