Harmonic Trading - page 308

 

Thanks poruchik. Here's the code needed to be modified. I'll try to modify it.

if (ABCD && StringLen(vNamePattern)==0 && PotencialsLevels_retXD<2)

{

vBullBear = "";

vNamePattern = "";

AB=MathAbs(zz[aXABCD] - zz[aXABCD[A]]);

CD=MathAbs(zz[aXABCD[D]] - zz[aXABCD[C]]);

if (CD>AB*min_DeltaGartley && CD<AB*max_DeltaGartley)

{

vNamePattern=vABCD; // AB-CD

}

else

{

for (int iABCD=0;iABCD<_ABCDsize;iABCD++)

{

if (CD>_ABCDtype*AB*min_DeltaGartley && CD<_ABCDtype*AB*max_DeltaGartley)

{

vNamePattern=_ABCDtypetxt+"*AB=CD";

break;

}

}

}

 

Done ! Here's the modified code. Now it checks AC < AB * Fib(1.0) for AB=CD & (x) * AB=CD patterns

if (ABCD && StringLen(vNamePattern)==0 && PotencialsLevels_retXD<2)

{

vBullBear = "";

vNamePattern = "";

AB=MathAbs(zz[aXABCD] - zz[aXABCD[A]]);

CD=MathAbs(zz[aXABCD[D]] - zz[aXABCD[C]]);

if ( (CD>AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>AB*min_DeltaGartley && CD<AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=vABCD; // AB-CD

}

else

{

for (int iABCD=0;iABCD<_ABCDsize;iABCD++)

{

if ( (CD>_ABCDtype*AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>_ABCDtype*AB*min_DeltaGartley && CD<_ABCDtype*AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=_ABCDtypetxt+"*AB=CD";

break;

}

}

}

 

thank bro

I mod 133 with your code

same bug?

Files:
 
poruchik:
thank bro

I mod 133 with your code

same bug?

You're wellcome poruchik,

and for Real AB=CD , ratios should be

AB=CD Pattern

[.382/2.240]

[.500/2.000]

[.618/1.618]

[.707/1.414]

[.786/1.270]

[AB=CD]

Files:
image038.jpg  45 kb
 

Modified Code for checking Real AB=CD

The new code now checks the retAC , retBD ratios

With the new code, indicator finds less AB=CD patterns but they'll be very accurate

if (ABCD && StringLen(vNamePattern)==0 && PotencialsLevels_retXD<2)

{

vBullBear = "";

vNamePattern = "";

AB=MathAbs(zz[aXABCD] - zz[aXABCD[A]]);

CD=MathAbs(zz[aXABCD[D]] - zz[aXABCD[C]]);

retAC = (zz[aXABCD[C]] - zz[aXABCD]) / (zz[aXABCD[A]] - zz[aXABCD] + vDelta0);

retBD = (zz[aXABCD[C]] - zz[aXABCD[D]]) / (zz[aXABCD[C]] - zz[aXABCD] + vDelta0);

if(

(retAC>=0.382*min_DeltaGartley) && (retAC=2.240*min_DeltaGartley) && (retBD<=2.240*max_DeltaGartley)

||

(retAC>=0.500*min_DeltaGartley) && (retAC=2.000*min_DeltaGartley) && (retBD<=2.000*max_DeltaGartley)

||

(retAC>=0.618*min_DeltaGartley) && (retAC=1.618*min_DeltaGartley) && (retBD<=1.618*max_DeltaGartley)

||

(retAC>=0.707*min_DeltaGartley) && (retAC=1.414*min_DeltaGartley) && (retBD<=1.414*max_DeltaGartley)

||

(retAC>=0.786*min_DeltaGartley) && (retAC=1.270*min_DeltaGartley) && (retBD<=1.270*max_DeltaGartley)

)

{

if ( (CD>AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>AB*min_DeltaGartley && CD<AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=vABCD; // AB-CD

}

}

else

{

for (int iABCD=0;iABCD<_ABCDsize;iABCD++)

{

if ( (CD>_ABCDtype*AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>_ABCDtype*AB*min_DeltaGartley && CD<_ABCDtype*AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=_ABCDtypetxt+"*AB=CD";

break;

}

}

}

 
grandaevus:
Modified Code for checking Real AB=CD

The new code now checks the retAC , retBD ratios

With the new code, indicator finds less AB=CD patterns but they'll be very accurate

if (ABCD && StringLen(vNamePattern)==0 && PotencialsLevels_retXD<2)

{

vBullBear = "";

vNamePattern = "";

AB=MathAbs(zz[aXABCD] - zz[aXABCD[A]]);

CD=MathAbs(zz[aXABCD[D]] - zz[aXABCD[C]]);

retAC = (zz[aXABCD[C]] - zz[aXABCD]) / (zz[aXABCD[A]] - zz[aXABCD] + vDelta0);

retBD = (zz[aXABCD[C]] - zz[aXABCD[D]]) / (zz[aXABCD[C]] - zz[aXABCD] + vDelta0);

if(

(retAC>=0.382*min_DeltaGartley) && (retAC=2.240*min_DeltaGartley) && (retBD<=2.240*max_DeltaGartley)

||

(retAC>=0.500*min_DeltaGartley) && (retAC=2.000*min_DeltaGartley) && (retBD<=2.000*max_DeltaGartley)

||

(retAC>=0.618*min_DeltaGartley) && (retAC=1.618*min_DeltaGartley) && (retBD<=1.618*max_DeltaGartley)

||

(retAC>=0.707*min_DeltaGartley) && (retAC=1.414*min_DeltaGartley) && (retBD<=1.414*max_DeltaGartley)

||

(retAC>=0.786*min_DeltaGartley) && (retAC=1.270*min_DeltaGartley) && (retBD<=1.270*max_DeltaGartley)

)

{

if ( (CD>AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>AB*min_DeltaGartley && CD<AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=vABCD; // AB-CD

}

}

else

{

for (int iABCD=0;iABCD<_ABCDsize;iABCD++)

{

if ( (CD>_ABCDtype*AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>_ABCDtype*AB*min_DeltaGartley && CD<_ABCDtype*AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=_ABCDtypetxt+"*AB=CD";

break;

}

}

}

Made some revisions(removed unnnecessary brackets).

Final Code

if (ABCD && StringLen(vNamePattern)==0 && PotencialsLevels_retXD<2)

{

vBullBear = "";

vNamePattern = "";

AB=MathAbs(zz[aXABCD] - zz[aXABCD[A]]);

CD=MathAbs(zz[aXABCD[D]] - zz[aXABCD[C]]);

retAC = (zz[aXABCD[C]] - zz[aXABCD]) / (zz[aXABCD[A]] - zz[aXABCD] + vDelta0);

retBD = (zz[aXABCD[C]] - zz[aXABCD[D]]) / (zz[aXABCD[C]] - zz[aXABCD] + vDelta0);

if(

(retAC>=0.382*min_DeltaGartley && retAC=2.240*min_DeltaGartley && retBD<=2.240*max_DeltaGartley)

||

(retAC>=0.500*min_DeltaGartley && retAC=2.000*min_DeltaGartley && retBD<=2.000*max_DeltaGartley)

||

(retAC>=0.618*min_DeltaGartley && retAC=1.618*min_DeltaGartley && retBD<=1.618*max_DeltaGartley)

||

(retAC>=0.707*min_DeltaGartley && retAC=1.414*min_DeltaGartley && retBD<=1.414*max_DeltaGartley)

||

(retAC>=0.786*min_DeltaGartley && retAC=1.270*min_DeltaGartley && retBD<=1.270*max_DeltaGartley)

)

{

if ( (CD>AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>AB*min_DeltaGartley && CD<AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=vABCD; // AB-CD

}

}

else

{

for (int iABCD=0;iABCD<_ABCDsize;iABCD++)

{

if ( (CD>_ABCDtype*AB*min_DeltaGartley && CD zz[aXABCD] && zz[aXABCD[A]] > zz[aXABCD[C]] && zz[aXABCD[C]] > zz[aXABCD])

||

(CD>_ABCDtype*AB*min_DeltaGartley && CD<_ABCDtype*AB*max_DeltaGartley && zz[aXABCD[A]] < zz[aXABCD] && zz[aXABCD[A]] < zz[aXABCD[C]] && zz[aXABCD[C]] < zz[aXABCD])

)

{

vNamePattern=_ABCDtypetxt+"*AB=CD";

break;

}

}

}

 
grandaevus:
poruchik , I know what "ExtDeltaGartley=0.09" is . As far as I know, this paramater controls the max deviation from the ideal fibos.

In zup130 there's also ExtDeltaStrongGartley=0.07.

What is the the difference of this parameter from ExtDeltaGartley?

poruckic, I know , I've asked before but in order to clarify the subject let me ask you once more.

What I've understood is,

ExtDeltaGartley=0.09 ; checks the lengths of the legs.

I mean in AB=CD pattern length of AB leg should be equal to length of CD leg

If we want to check whether lengths of the legs are within limits , we use the ExtDeltaGartley parameter

However ExtDeltaStrongGartley checks the retracement Fibonacci Ratios.

Like, if AC retracement of AB is 0.3820 , fib BD retracement of BC should be 2.240.

ExtDeltaStrongGartley here checks the fib ratios within limits not ExtDeltaGartley.

Am I right?

 

I add .886-1.13

.382-2.618 (not 2.24)

 

ExtDeltaStrongGartley - for strong patterns (exact patterns), it=0.07 (7%)

varStrongPatterns - options of algorithm of search of exact patterns |

// | = 0 search of exact five-dot patterns in algorithm, |

// | existing to 122 versions inclusive. The pattern was considered |

// | found if retresment of XD-XB-AC-BD got to borders |

// | admission. |

// | |

// | = 1 by search of patterns in limits of the admission have to |

// | to get only XB-AC-BD retresment. |

// | Retresment of XD in this case is considered spravochno, |

// | participates only for calculation of border of development of a point of the D pattern

 
poruchik:
ExtDeltaStrongGartley - for strong patterns (exact patterns), it=0.07 (7%)

varStrongPatterns - options of algorithm of search of exact patterns |

// | = 0 search of exact five-dot patterns in algorithm, |

// | existing to 122 versions inclusive. The pattern was considered |

// | found if retresment of XD-XB-AC-BD got to borders |

// | admission. |

// | |

// | = 1 by search of patterns in limits of the admission have to |

// | to get only XB-AC-BD retresment. |

// | Retresment of XD in this case is considered spravochno, |

// | participates only for calculation of border of development of a point of the D pattern

Then ExtDeltaStrongGartley is for 5 dot patterns like Bat, Gartley, ButterFly & Crab.

and ExtDeltaGartley is for others.(AB=CD , Alternate AB=CD, etc)

Right?