Simple Hammer Code. Help Needed ! - page 2

 
Michael Green: BullishHammer=((Open[i]+Close[i])>(High[i]+Low[i]/3.0)); Can some one point me to where I am going wrong on this?

Open+Close is not the size of the body. High+ (Low/3) is not the size of the size of tail.

double body_size = Close[i] - Open[i];
Body size is Close - Open only for bullish candles.
 
honest_knave #:


Please try to use SRC button when posting code; it makes it a lot easier to read (I've modified your post above).

Firstly, you are using doubles (numbers) to store something that should really be boolean (true/false), no?

Take a look here for a good guide about doing lookbacks correctly.

The easier approach (in my opinion) is to have distinct function calls for your patterns.

An example using the new format:

Finally, I'll just point out that you are reinventing the wheel. There are plenty of these pattern-finding indicators already available.

If you're doing it as an exercise to learn, that is great! But I just thought I'd point it out in case you didn't know.

Good luck!

can you share with alert and also mt5 indicator
Reason: