How do I code to detect a breakout candle?

 

What is best way to detect any candlestick which breakouts any level for example as shown on screenshot.

Please post the logic

 
Arpit T: What is best way to detect any candlestick which breakouts any level for example as shown on screenshot.
  1. Until you can state your requirements in concrete terms, it can not be coded.
  2. How do you define your dashed line?
  3. How do you define a breakout candle?
  4. What is the difference between your checked down candle, vs. the next ones after your cross?
 
William Roeder #:
  1. Until you can state your requirements in concrete terms, it can not be coded.
  2. How do you define your dashed line?
  3. How do you define a breakout candle?
  4. What is the difference between your checked down candle, vs. the next ones after your cross?

1. Ok

2. I can add any HLine manually

3. A breakout candle is a candle which breaks the line with body minimum 60% beyond the line and having lower wick less than 1/2 of body range (open - close)

4. as point 3

 
Arpit T #:

1. Ok

2. I can add any HLine manually

3. A breakout candle is a candle which breaks the line with body minimum 60% beyond the line and having lower wick less than 1/2 of body range (open - close)

4. as point 3

Then is very easy… define that 60% into a price, and if the price is beyond that line, you enter… but the most interesting part would be to define that line in code  ..😊
 
Arpit T #:

1. Ok

2. I can add any HLine manually

3. A breakout candle is a candle which breaks the line with body minimum 60% beyond the line and having lower wick less than 1/2 of body range (open - close)

4. as point 3

BEARISH CANDLE 

body of a candle = open - close 

wick length above = High - open

wick length below = close - low


based on your definition

A breakout candle is a candle which breaks the line with body minimum 60% beyond the line and having lower wick less than 1/2 of body range (open - close)

60 % of previous candle = 60 x (High-Low)/100

so,

if (current candle low/close < previous candle low/close) and  (previous candle low -  current candle low > or = 60% of previous candle) and (close-open of current candle is less than 50% of current candle body).

Breaker candle is formed

 

 
Chioma Obunadike #:

BEARISH CANDLE 

body of a candle = open - close 

wick length above = High - open

wick length below = close - low


based on your definition

A breakout candle is a candle which breaks the line with body minimum 60% beyond the line and having lower wick less than 1/2 of body range (open - close)

60 % of previous candle = 60 x (High-Low)/100

so,

if (current candle low/close < previous candle low/close) and  (previous candle low -  current candle low > or = 60% of previous candle) and (close-open of current candle is less than 50% of current candle body).

Breaker candle is formed

 

You forgot about that 60% should by beyond the line 😊
Reason: