Harmonic Trading - page 315

 

AB=MathAbs(dotA-dotB);

CD=MathAbs(dotC-dotD);

AC=MathAbs(dotA-dotC);

BD=MathAbs(dotB-dotD);

AB, CD, AC & BD are legs (length of legs)

 
grandaevus:
This is the zup version that I prefer to use. It is light, fast & uses less memory. It's modified and it's zigzag search is far better. zup_v113modgrandaevus.mq4

Nice work grandaevus!

It doesn't draw a pRZ though.

 
waltpips:
Nice work grandaevus! It doesn't draw a pRZ though.

I removed it because it's unnecessary and uses a lot of memory.

 

There's one thing I have to say.

Starting with zup_v116 nen star revolution, search pattern criteria of void _gartley function is completely changed. In older versions up to v113 , void _gartley function uses if.... else function to define & find harmonic patterns. This functionality gives an advantage to user to define & create his own patterns or search criteria and even calculate more precise D point, which is what I did in Zupv113modgrandaevus.

Zup v116-zup v134 uses a complex matrix (static array) instead of if..... else. In order to modify it and turn it into a more user friendly code, (like zup113) I had to break it's complex matrix search function but everything has a price(A lot of improvements done over older versions would be gone.

I still use my modified zup113 since I don't use those new functions or improvements(Because I write my own code.) But for you may be it's important.

If you would write your code to create your patterns on modified zup134 , it would be nearly the same to write code on modifiedzup113 since you wouldn't need to use a lot functions of zup134 .

Differences of modified zup134 vs modified zup113 are;

Advantages

* Ability to turn on/off to search patterns only on last leg(v03 I'll upload today)

* Ability to draw Ray AB=CD instead of triangle

Disadvantages

*Bulky (it's not light and uses a lot of arrays which uses a lot of memory)

*A lot of functions may be you'll never need or use

zigzag function is the same so it doesn't make a difference in pattern search.

That's all

I'll stick with my modified zup113 since it's light & very fast but I'll show you how to write your own code on modified zup134. The logic is same so it doesn't matter which version you use.

 

poruchik:
I didn't see your last post

=======================

let's make a fresh start

select pattern =8 if we use Dragon,4PointPattern, 5-0,ABCD

select pattern =7 if we use 1,2,3 - or all 27 patterns

poruchik, there's a way to add your custom patterns to the original code without changing it.

All defined patterns (27 patterns as shown in the code) would be searched by indicator's original code , you will just add your custom patterns search code.

or

you would write and define your D point for each pattern(I've already written classic patterns, cypher, shark, 5_0 & real ABCD but other patterns in the list or your custom patterns should be written manually.

Which one do you prefer?

Files:
 

I need:

(that I could enter the rаtions)

see code in 110 (I gave link you)

extern string ____________3.1___________ = "Parameters for CUSTOM Pattern 1";

extern bool CustomPattern1 = true;

extern string nameCP1 = "BLACK Swan";

extern double minXB1 = 1.382;

extern double maxXB1 = 2.618;

extern double minAC1 = 0.236;

extern double maxAC1 = 0.5;

extern double minBD1 = 1.128;

extern double maxBD1 = 2.0;

extern double minXD1 = 1.128;

extern double maxXD1 = 2.618;

extern string ____________3.2___________ = "Parameters for CUSTOM Pattern 2";

extern bool CustomPattern2 = true;

extern string nameCP2 = "TU-160 WHITE Swan";

extern double minXB2 = 0.382;

extern double maxXB2 = 0.724;

extern double minAC2 = 2.0;

extern double maxAC2 = 4.237;

extern double minBD2 = 0.5;

extern double maxBD2 = 0.886;

extern double minXD2 = 0.382;

extern double maxXD2 = 0.886;

extern string ____________3.3___________ = "Parameters for CUSTOM Pattern 3";

extern bool CustomPattern3 = true;

extern string nameCP3 = "121";

extern double minXB3 = 0.5;

extern double maxXB3 = 0.618;

extern double minAC3 = 1.272;

extern double maxAC3 = 2.0;

extern double minBD3 = 0.446;

extern double maxBD3 = 0.618;

extern double minXD3 = 0.382;

extern double maxXD3 = 0.786;

.

.

.

extern string ____________3.10___________ = "Parameters for CUSTOM Pattern 10";

Files:
 
poruchik:
I need:

(that I could enter the rаtions)

see code in 110 (I gave link you)

extern string ____________3.1___________ = "Parameters for CUSTOM Pattern 1";

extern bool CustomPattern1 = true;

extern string nameCP1 = "BLACK Swan";

extern double minXB1 = 1.382;

extern double maxXB1 = 2.618;

extern double minAC1 = 0.236;

extern double maxAC1 = 0.5;

extern double minBD1 = 1.128;

extern double maxBD1 = 2.0;

extern double minXD1 = 1.128;

extern double maxXD1 = 2.618;

extern string ____________3.2___________ = "Parameters for CUSTOM Pattern 2";

extern bool CustomPattern2 = true;

extern string nameCP2 = "TU-160 WHITE Swan";

extern double minXB2 = 0.382;

extern double maxXB2 = 0.724;

extern double minAC2 = 2.0;

extern double maxAC2 = 4.237;

extern double minBD2 = 0.5;

extern double maxBD2 = 0.886;

extern double minXD2 = 0.382;

extern double maxXD2 = 0.886;

extern string ____________3.3___________ = "Parameters for CUSTOM Pattern 3";

extern bool CustomPattern3 = true;

extern string nameCP3 = "121";

extern double minXB3 = 0.5;

extern double maxXB3 = 0.618;

extern double minAC3 = 1.272;

extern double maxAC3 = 2.0;

extern double minBD3 = 0.446;

extern double maxBD3 = 0.618;

extern double minXD3 = 0.382;

extern double maxXD3 = 0.786;

.

.

.

extern string ____________3.10___________ = "Parameters for CUSTOM Pattern 10";

Ok poruchik , I'll show how to add your custom patterns without changing the original code . (we're going to change it again but without modifying original code. We'll just add some extra codes)

Could you provide a picture of these custom patterns(with X, A, B, C & D points both bullish and bearish) so we can define it's shape.

 

you make a code, I will insert then the rаtions

 
poruchik:
you make a code, I will insert then the rаtions

Ok I'll show how to add your custom patterns to original code. All functions of the original code will be kept.

First add this highlighted extern line to here

extern bool ABCD = true;

extern bool visibleABCDrayZZ = true;

extern int ABCDrayZZStyle = 0;

extern int ABCDrayZZWidth = 4;

extern string ABCDAlternate = "0.382,0.5,0.618,0.786,0.886,1.272,1.618,2.0,2.618";

extern bool NameofCustomPattern=true;

 

Then add these highlighted lines to here

void _Gartley function

color colorPattern;

bool yes;

double dotX=0;

double dotA=0;

double dotB=0;

double dotC=0;

double dotD=0;

Reason: