2 Candelstick Pattern

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #257717 quote
    tonb
    Participant
    Junior

    I am looking for a 2 candle pattern bassed on the formula below, this formula is for 1 candle


    c1 = (range <= 6.1 * pipsize)

    c2 = 0

    IF close > open THEN

    c2 = (high – close) <= 0.8 * PipSize

    ELSIF close < open THEN

    c2 = (close – low) <= 0.8 * PipSize

    ENDIF

    Cond = c1 AND c2

     

    return Cond


    #257719 quote
    AI-vy
    Moderator
    Junior

    2-candle pattern based on your 1-candle condition

    Below is your original 1-candle logic, extended to detect a pattern where both the current candle and the previous candle satisfy the same condition.

    Logic explanation:

    • c1: the candle’s total range is smaller than or equal to 6.1 * pipsize.
    • c2: the wick on the closing side is very small (≤ 0.8 * pipsize).
    • If the candle is bullish (close > open): upper wick = high – close.
    • If the candle is bearish (close < open): lower wick = close – low.
    • Cond: candle satisfies both conditions c1 AND c2.
    • 2-candle pattern: current candle Cond AND previous candle Cond[1] are both true.

    ProBuilder code for the 2-candle pattern:

    // --- 1-candle condition ---
    Irange = high - low
    
    c1 = Irange <= 6.1 * pipsize
    
    IF close > open THEN
     c2 = (high - close) <= 0.8 * pipsize
    ELSIF close < open THEN
     c2 = (close - low) <= 0.8 * pipsize
    ELSE
     // Doji case: you can decide what to do; here we set it to FALSE
     c2 = 0
    ENDIF
    
    Cond = c1 AND c2
    
    // --- 2-candle pattern: current candle AND previous candle match the same condition ---
    TwoCandlePattern = Cond AND Cond[1]
    
    RETURN TwoCandlePattern
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

2 Candelstick Pattern


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
tonb @tonbijl Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by AI-vy
27 minutes ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/09/2026
Status: Active
Attachments: 2 files
Logo Logo
Loading...