Another idea for improvement of the indicator (as well as the 1.618 AB=CD and click on Pattern to highlight) would be to show the price next to the point D levels. For example: "D Projected Bullish Cypher 110.821" on the attached chart. Just now I have to change from cursor to cross hair on MT5 in order to see what the projected price is. I am checking patterns on all timeframes and it would be great to just see the price next to the projected point D.
as previously mentioned, there are many slight adaptations possible. What you are requesting can be done in a slight codechange. So open up the code editor and navigate to line number 1634, change the line which reads
ObjectSetString(0,pointD,OBJPROP_TEXT," D "+prefix+_patternNames[k]);
ObjectSetString(0,pointD,OBJPROP_TEXT," D "+prefix+_patternNames[k] + " " + NormalizeDouble(D, _Digits));
by adding the yellow part. Then press compile and you will have the desired result on projected 5-point patterns. Do the same on line 1523 for 4-point patterns.
Principle behind this is captured in the following color coding:
+ " " + NormalizeDouble(D, _Digits)
corresponds to "D Projected Bullish Cypher 110.821". So if you instead would have "D Projected Bullish Cypher - 110.821" (adding a separator -) then the code would look like this:
ObjectSetString(0,pointD,OBJPROP_TEXT," D "+prefix+_patternNames[k] + " - " + NormalizeDouble(D, _Digits));
It should work fine yes.
The warning is not malicious in this case and can be safely ignored. Alternatively, to have warning-free compilation the conversion can be made explicit by wrapping the number (the projected price) inside a DoubleToString() call as such:
... + " " + DoubleToString(NormalizeDouble(D, _Digits),_Digits));
or, more simply, by an explicit cast
... + " " + (string)NormalizeDouble(D, _Digits);
If you would additionally like to see the PRZ end price on the projections in the text, like "D Projected Bullish Cypher 110.821 to 110.678", it can be done in three modifications:
ObjectSetString(0,pointD,OBJPROP_TEXT," D "+prefix+_patternNames[k]+ " " + (string)NormalizeDouble(D, _Digits)+" to "+(string)NormalizeDouble(farD, _Digits));
datetime DDateTime,double D,double farD)
Yes it would allow to see the price of the PRZ stop in the projection text label.
Its calculated using the "intersection" method described earlier, applying specified slack. Taking the bullish Gartley example again assuming 0 interval slack, and you had the (0.786 + scalar slack) XA intersecting - i.e. coinciding with - the 1.272 BC ratio, the PRZ would end there and not extend all the way down to the 1.618 BC, BECAUSE the XA rule and ratio would not be satisfied there. This means that if the stop is reached, the pattern is invalid because not all of the ratios (even with added slack) are satisfied WHEN the price eventually reverses.
I am still a little unsure about some of the projected patterns, and the PRZ levels it is choosing. For example, I attach a chart with a projected Bearish Bat, with XAD 79 and CD 218. However, on this occasion the XAD 88.6 and CD 2.618 were very close to each other just a little higher (at 111.3), yet the indicator did not choose this as projected point D. Is there any reason for this?
The Bat pattern has XAD ideally at 88.6, and CD in 161 to 261.
But the indicator applies slack of 10 on the single numbered ratios and 1 on the interval ratios. However these numbers can be changed in the settings as unary slack and range slack.
So it will search for a zone from 78.6 (88.6 - 10) to 98.6 (88.6 + 10) where it deems the XAD ratio satisfied. The projection will start on the first possible number, in this case 79. It would only choose a higher number if it was forced by some other ratio, like the CD.
For example if the CD was only 150 at that particular price, the projection start would be increased to CD 160 (161 - 1), which might have given an XAD closer to the ideal one, or even higher. If the price would need to be increased above XAD 98.6 in order to have a CD of 160, the indicator would determine that the pattern cannot be satisfied and remove the projection.
On the other hand, if the projection is reached it will show the PRZ end line, either at XAD 98.6 or CD 262 (261 + 1), whichever comes first. So in a sense, from the XAD ratio zone it will choose the last possible number unless forced by the other ratio.
As such, whenever the price is in the PRZ zone the indicator does not care about where the ideal ratios are, all it considers is that the price is within each ratio plus/minus the slack.
That is correct if you consider the ratios as "ideal numbers but can have some slack". For example the XAB ratio of Gartley, I do not need the B point to be at an exact 61.8 XA but it should be "close enough". Otherwise I would be sidelined all the time.
In a purist sense the projected point D is really a bound to the pure PRZ, a bound that can be either permissive or restrictive to the PRZ according to the slack the purist allows and the particular alignment of ratios. The exact ratios are either tightly packed below that indicated point (permissive bound), or one leg ratio has been reached already but the projected point shows where that ratio is "close enough" to the other (restrictive bound).
So point D can only be considered as the beginning of the PRZ for holists and purists with zero slack tolerance. Its where the whole pattern is "close enough" to specification but not necessarily at any exact ratio.
The worst case for the purist would be if the pure PRZ is restrictively bounded by point D, and the subsequent PRZ stop is where the already visited ratio ceases to be "close enough" to the other ratio, which is even further below. Then the PRZ shown by the indicator would be in between the two exact ratios but have no ratio itself. The holist would say that the pattern is there, it is after all "close enough" to every ratio - while the purist would say not since there is no PRZ.