How to detect Strong Candle by code

To add comments, please log in or register
Thushara Dissanayake
28061
Thushara Dissanayake  

hi,

I am trying code identify Strong White/Black candle. You can see my code identifying basic Dark Cloud Cover Pattern and indicating it on the chart. I want to filter it by strong white candle. But i can not able to identify Stronger candle. 

Is any way to identify it by candle body?

Thushara Dissanayake
28061
Thushara Dissanayake  

William Roeder
20233
William Roeder  
Thushara Dissanayake: I am trying code identify Strong White/Black candle. You can see my code identifying basic Dark Cloud Cover Pattern
  1. Strong is a subjective term. Until you come up with a concrete definition, you can't code it.

  2. We can't see your code.

  3. Dark Cloud Cover - investopedia
Petr Nosek
3051
Petr Nosek  
Thushara Dissanayake:

hi,

I am trying code identify Strong White/Black candle. You can see my code identifying basic Dark Cloud Cover Pattern and indicating it on the chart. I want to filter it by strong white candle. But i can not able to identify Stronger candle. 

Is any way to identify it by candle body?

Stronger than what? If you mean that the body is sufficient large then you can compare size of the body with multiple of ATR. Maybe you should take in account size of wicks too. Ratio upperWick/body (for a long candle) should be less than X...

BTW your second example isn't the Dark Cloud Cover Pattern.

Thushara Dissanayake
28061
Thushara Dissanayake  
Petr Nosek:

Stronger than what? If you mean that the body is sufficient large then you can compare size of the body with multiple of ATR. Maybe you should take in account size of wicks too. Ratio upperWick/body (for a long candle) should be less than X...

BTW your second example isn't the Dark Cloud Cover Pattern.

Yes that is the point. stronger than what?  I can use ATR. But i have no idea how to multiple it. Can you help me more?
William Roeder
20233
William Roeder  
Thushara Dissanayake:   I can use ATR. But i have no idea how to multiple it. Can you help me more?
double  atr           = iATR(...);
double  atrMultiplied = atr * multiplier;
Help you with what? You haven't stated a problem. Show us your attempt (using CODE button) and state the nature of your problem.
          No free help
          urgent help.
Petr Nosek
3051
Petr Nosek  
Thushara Dissanayake:
Yes that is the point. stronger than what?  I can use ATR. But i have no idea how to multiple it. Can you help me more?

It is up to you what stronger means. Below is an example how it could look like.

   int shift=0;
   int atrPeriod=20;
   double atrMultiplier=1.618;
   double atr=iATR(_Symbol,_Period,atrPeriod,shift);
   bool bullish=Close[shift]>Open[shift];
   double body=bullish?(Close[shift]-Open[shift]):(Open[shift]-Close[shift]);
   double wick=bullish?(High[shift]-Close[shift]):(Close[shift]-Low[shift]);
   double ratioWickBody=0.2;
   bool isStrongEnough=body>atr*atrMultiplier && (body>0.0?(wick/body<ratioWickBody):false);
To add comments, please log in or register