candle pattern bullish engulfing candle

 
Hi

I was experimenting with candle patterns

Although this is not a true bullish engulfing candle it is what I defined it as.

if(Close [2] < Open [2] && Open[1]<=Close[2] && Close[1]>Open[2])
       Print (Close[1], " Bullish Engulfing Candle "); 

But after I put this in an EA and run the tester, I noticed that when I review the chart and compare the times of the Print statement so that I may see these bullish engulfing candles, there is NO engulfing candle at this location

I think the code is what I want so I'm not sure why I don't see them on the chart where it should coordinate with the time of the print statement

In other words the print statement prints telling me the condition did occur, however on the chart there is no evidence that it occurred at that time.

Please advise
Thanks
 
Most of the definitions I have seen are a higher high and a lower low . . . not opens and closes . .
 
RaptorUK:
Most of the definitions I have seen are a higher high and a lower low . . . not opens and closes . .

well for engulfing candles the highs and lows are not as relevant because the part of the candle that engulfs the previous candle is the candle body not the wicks.

However, I guess some use the candle body that engulfs the entire previous candle so then the highs and lows of that candle would be relevant.


But with my code I'm using it for a candle body that engulfs the previous body of the previous bearish candle
The bear is identified by the

Close [2] < Open [2]



But either way is ok, but my biggest problem is that I'm not getting this condition at all and so I don't know why I'm getting a print statement at these locations because this condition does not exist there.

I'll recheck the code some more and see whats going on, but seems strange


 
I added one line but should not change anything it's more of a duplicate and easier to read

if(Close [2] < Open [2]
   && Close[1] > Open[1] 
   && Open[1]<=Close[2] 
   && Close[1]>Open[2])
   Print (Close[1], " Bullish Engulfing Candle "); 
2011.10.16 19:48:38 2011.01.03 02:03 Agent86_5min EURUSD,M5: 1.3309 Bullish Engulfing Candle


Notice the time 02:03 ? this I don't get on 5 min chart and Close[1]

Wouldn't this have to be on the close of the candle ? there is no close on 03 on 5min charts
 

Close[0] = MarketInfo(Symbol(), MODE_BID) (Current Candle)

Close[1] = previous Candle

Close[2] = 1 before previous Candle & so on

 

Agent86:

Notice the time 02:03 ? this I don't get on 5 min chart and Close[1]


Wouldn't this have to be on the close of the candle ? there is no close on 03 on 5min charts
Why would it have to happen at the close of the candle ? If the current candle is almost done then candle 1 closed almost 5 mins ago . . . what are you doing in your code to make the code above happen just after the candle closes ?
 
Agent86:
I added one line but should not change anything it's more of a duplicate and easier to read
Nope, that is incorrect . . . . what exactly are you looking for ? a bull engulfing a bear ? a bull engulfing a bull ? a bull engulfing a bear or bull ?
 
RaptorUK:
Nope, that is incorrect . . . . what exactly are you looking for ? a bull engulfing a bear ? a bull engulfing a bull ? a bull engulfing a bear or bull ?

bull engulfing a bear
 
qjol:

Close[0] = MarketInfo(Symbol(), MODE_BID) (Current Candle)

Close[1] = previous Candle

Close[2] = 1 before previous Candle & so on


exactly, so I want to identify Bar[1] which is a closed candle that has a body that is engulfing the previous Bar[2] bearish candle

And print(statement) should occur once this condition is met and thus I thought that the print statement should occur at the Close[1] which I suspected should be close of 5min increments on 5min charts not 2:03 or some strange time

When does Close[1] occur on 5min charts ? at the close of a 5min candle right ?

I'm confused

 
RaptorUK:
Why would it have to happen at the close of the candle ? If the current candle is almost done then candle 1 closed almost 5 mins ago . . . what are you doing in your code to make the code above happen just after the candle closes ?

Because the event happens when the conditions are met and it will be among other things based on Close[1] greater then or less then other conditions and/or previous candle conditions and thus it will only be true on a Close[1] if those other conditions also occur

So this is why I'm confused about the condition occurring at 2:03 or some other time that is not very close or right on the close of the candle

2:03 tells me that the if(statement) did not see the condition either until Bar[0] and about 3min after Close[1]

At least that's what is seems like to me

And to top things off there is no engulfing candle which engulfs the previous bearish candle anywhere near this time frame or location at all.

Please advise
Thanks
 
Agent86:

When does Close[1] occur on 5min charts ? at the close of a 5min candle right ?

No, it occurs at the first tick of Bar 0, if there are no ticks during the first 3 mins of Bar 0 then Close[1] won't happen until at least 3 min into Bar 0 . . . was that the case ?
Reason: