Download MetaTrader 5
To add comments, please log in or register
Share your knowledge. Become a well-known developer!
monty1
31
monty1 2015.02.01 14:03 
Hi experienced members,
i'm looking for bull bull pattern.. in this previous candle and current candle both are bullish, but current candle engulf previous candle.
I've tried to make it work 
if ((C1>O1)&&(C>O)&&(C>=C1)&&(O>=O1)&& ((C-O)>=(C1-O1))) {
if (Display_BULL_BULL == true) {
ObjectCreate(PatternText[shift], OBJ_TEXT, 0, Time[shift1], Low[shift1] - Range*1.5);
ObjectSetText(PatternText[shift], "BULL BULL", 9, "Times New Roman", Yellow);
upArrow[shift1] = Low[shift1] - Range*0.5;
}
if (shift == 0 && Show_Alert == true) {
pattern="BULL BULL pattern";
setalert = 1;
}

but it's not showing me what i want ? 
I've tried to modify this file
Files:
whroeder1
13610
whroeder1 2015.02.01 18:11  
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. When shift == Bars - 1, count = Bars + 8. High[Bars+anything] does not exist. Array exceeded, indicator dies.
    Why are you looking at all bars every tick when nothing is changing?
      for (shift = 0; shift < Bars; shift++) {
          :
          for (counter=shift ;counter<=shift+9;counter++) {
             AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      
    
    Do your look backs correctly. Only do new bars.
    int counted = IndicatorCounted();
    int lookback=9;
      for (shift = Bars - 1 - MathMax(counted,lookback); shift >= 1; --shift){
          :
          for (counter=shift ;counter<=shift+lookback;counter++) {
             AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      
    >=1 don't look at bar zero. You must count down when closing/deleting in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum

  3.        PatternText[j] = "pattern-" + j;
       :
                ObjectCreate(PatternText[shift], OBJ_TEXT, 0, Time[shift1], High[shift1] + Range*1.5);
    
    After the initial run, you may have an object labeled "pattern1", Then when a new bar starts, you may try to again create "pattern1" which fails. Don't use shift numbers in objects (unless you delete all those objects first.) Use Time[j] instead
  4. Check your return codes (ObjectCreate, etc.) What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
monty1
31
monty1 2015.02.02 06:49  

Hi,

 it's working for bullsh engulfing, only difference between mine and bullish engulfing is previous candle in bullish engulfing is bear and in my case it's bull candle. 

 // Check for Bullish Engulfing pattern
      
      if ((O1>C1)&&(C>O)&&(C>=O1)&&(C1>=O)&&((C-O)>(O1-C1))) {
         if (Display_Bullish_Engulfing) {   
            ObjectCreate(PatternText[shift], OBJ_TEXT, 0, Time[shift1], Low[shift1] - Range*1.5);
            ObjectSetText(PatternText[shift], "Bullish Engulfing", 9, "Times New Roman", Red);
            upArrow[shift1] = Low[shift1] - Range*0.5;
         }
         if (shift == 0 && Show_Alert == true) {
            pattern="Bullish Engulfing Pattern";
            setalert = 1;
         }
      }
      
it's showing me no error(patterrecognition.mq4), working fine when i lookback to charts,but when i use bull candles instead bear candle, it's even not showing me anything. why is it working fine for bullish engulfing(Is lookbacks wrong for bullish engulfing ?)?
I've checked many times, not showing me a single error in bullish engulfing. What should i use additional, so it will work for bull bull.
Files:
James Hodges
2780
James Hodges 2015.02.16 06:32  
What is wrong with this picture? What are you trading here? Stocks? Why is the second candle not opening where the first candle is closing? Is this weekly charts?
hji
26
hji 2015.02.16 07:58  
This one doesn't look like a bull bull pattern at all. Or maybe I have a different understanding of bull bull pattern.
monty1
31
monty1 2015.03.13 13:52  
Jimdandy:
What is wrong with this picture? What are you trading here? Stocks? Why is the second candle not opening where the first candle is closing? Is this weekly charts?

Hi sir,

sorry for late reply, i thought no one will reply here. 

 I'm trading forex in that pic. it's 4 hour chart.  second candle not opening from the first candle, I guess it's same like the way Dark Cloud or Piercing line open respectively down and up side.  

 thanks

monty1
31
monty1 2015.03.13 13:55  
hji:
This one doesn't look like a bull bull pattern at all. Or maybe I have a different understanding of bull bull pattern.

Hi,

 It's same bull bull pattern, where same bullish candle engulf previous candle body, like we see significant engulfing candle, but there candle engulf last two candles. Just wondering, which candle would you call bull bull ?

thanks 

/
To add comments, please log in or register