-
Play videoPlease edit your post.
For large amounts of code, attach it.
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 forumPatternText[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- 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
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:
patternrecognition_1.mq4
14 kb
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?
This one doesn't look like a bull bull pattern at all. Or maybe I have a different understanding of bull bull pattern.
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?
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
hji:
This one doesn't look like a bull bull pattern at all. Or maybe I have a different understanding of bull bull pattern.
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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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