3_Level_ZZ_Semafor (indicator for MT4) - page 39

 
TEAMTRADER:
I have tested a lot of these - but when they do not repaint they are much delayed at least 3 candles) before showing the signal.

All the Semafors I have repaint.

The signal dots for the 4 level semafor are off the screen - what can I change in the code to place them close to the candles?

Thanks.

TEAMTRADER

TEAMTRADER

The way it is made it uses the "deltaInPips" for a distance of arrows from upper or lower value. Try changing that parameter

 

Hi MLaden,

I have tested a lot of these - but when they do not repaint they are much delayed at least 3 candles) before showing the signal.

All the Semafors I have repaint.

The signal dots for the 4 level semafor are off the screen - what can I change in the code to place them closer to the candles?

Thanks.

TEAMTRADER

 

Thanks.

Some of the signal dots moved and others stayed in the same position.

I changed the '10' to '1' but the signal dots still are varying distances from the candles - see attached.

Attached is the result of my testing - specific S&R based on YELLOW signal dots.

TEAMTRADER

 

And this is the same chart later with the same system of drawing S&R lines from the yellow signal dots.

It is an easy manual system to follow but the signal dots still are too far away from the candles for comfortable trading.

2 Questions

1. Is it possible to get these S&R levels drawn autmatically? I have attached the indicator again in case it is required.

2. Can the dot signals all be made to show closer to the candles? It appears to be selective as to which signal dots are close and those that are not.

Thanks

TEAMTRADER

 
TEAMTRADER:
And this is the same chart later with the same system of drawing S&R lines from the yellow signal dots.

It is an easy manual system to follow but the signal dots still are too far away from the candles for comfortable trading.

2 Questions

1. Is it possible to get these S&R levels drawn autmatically? I have attached the indicator again in case it is required.

2. Can the dot signals all be made to show closer to the candles? It appears to be selective as to which signal dots are close and those that are not.

Thanks

TEAMTRADER

TEAMTRADER

Some similar ideas can bee seen at this thread : https://www.mql5.com/en/forum/175712 or this thread : https://www.mql5.com/en/forum/178570

Maybe you can find what you need there

 

After looking into the code a bit more, I'm a bit disappointed to see that the code is exactly based on the original 2005 MT4 ZigZag code. I had mistakenly thought it was a different algorithm, but no.

As such, it suffers from some of the bugs and performance issues similar to the original zigzag. There are better versions that could be used, perhaps: MultiZigZag - Another Variant of ZigZag (Economic ZigZag) - MQL4 Code Base

However, it would still be regular ZigZag waves, and because I've seen crazy things occur with regular ZigZag, it's probable those same things are going to occur with that version. Teamtrader's chart shows a good example, in that the bubbles are way off and away from what it seems should be the obvious pivots.

Why? Because the parameter choices for Deviation are ridiculous. (Now that I've studied the code, I see it plainly).

When I first looked at the parameters (3 level), I saw the obvious number progression related to the Fibo series, so when I added the 4th, I blindly continued to follow a similar progression:

extern double Period1=5;

extern double Period2=13;

extern double Period3=34;

extern double Period4=55; // The new 4th level

extern string Dev_Step_1="1,3"; //Note it's "1,3" as was the original release.

extern string Dev_Step_2="8,5";

extern string Dev_Step_3="13,8";

extern string Dev_Step_4="21,13"; // The new 4th level

Now that I've looked at the code, it is absurd to use these numbers for "Deviation". The "Period" and "Step" values are the #bars, but "Deviation" is price! (Edit: Originally "pips" but sometimes "pips/10" or dollars or...) Not only is it price (Edit: pips...), but its multiplied by "Point" in the code. When the zigzag algorithm was written, most Fx brokers were 2/4-digit brokers for Fx (so Point was typically 0.01/0.0001), but now they're 3/5-digits (so, 0.001/0.00001 for Fx). If the code uses "Point", logically the deviation numbers should be 10x larger. (I changed my code to use "myPoint" (a hack) everywhere because it stays the same regardless of 2/4 or 3/5 digit Fx feeds).

HOWEVER, if you have a chart like Teamtraders FT100, what is "Point"? I'm guessing it's "1", so the Deviation is now in full DOLLARS (or Pounds, or...). That has a huge impact on how the algorithm draws the chart.

What is Deviation? Suppose ZigZag identifies a pivot low and is going to mark it. However, a nearby future bar (within the #back-steps specified) comes down to almost a double-bottom, but does NOT actually form a new low, but it's close, and WITHIN the Deviation amount... then ZigZag is going to MOVE the pivot to the new low BUT will maintain the price of the original low. IMO, the fact that the code will move a pivot low to the right FARTHER than a new pivot high is a bug with the algorithm. That's why you may get crazy orders of pivots, with two consecutive Highs or two consecutive lows, which should never occur but it does. At the very least, it puts the pivots in strange places, far away from pivots.

The Deviation values you use for Fx and FT100 should probably be very different because "Point" is very different.

However, I suggest to just make all Deviation values "0" and see what happens. IMO, I want to see the pivots occur at the true High and true Low. I don't want them shifted forward in time at all.

The values for Period and Step are the #bars, so it's fine if those values are related to the Fibo series, but they can be anything.

Here's a new 4 level version. It now uses my own code-hack to use "myPoint" instead of "Point", which will make it work the same regardless of 2/4 or 3/5 digit Fx brokers. I also changed all default Deviation values to "0". I increased the 4th level period from 55 to 89 because the former was too close.

//---- input parameters

extern double deltaInPips = 10.0;

extern double Period1=5;

extern double Period2=13;

extern double Period3=34;

extern double Period4=89;

extern string Dev_Step_1="0,3"; // For all these Period/Deviation/back-Step values, use whatever works for you. NOTE! Period/Step are in #bars. Deviation is in #pips

extern string Dev_Step_2="0,5";

extern string Dev_Step_3="0,8"; // Perhaps "13" could be used.

extern string Dev_Step_4="0,13"; // Perhaps "34"

extern int Symbol_1_Size=0;

extern int Symbol_2_Size=1;

extern int Symbol_3_Size=2;

extern int Symbol_4_Size=3;

int Symbol_1_Kod=140; // These arrow numbers don't need to be "extern" variables. Change them here in the source if needed.

int Symbol_2_Kod=141;

int Symbol_3_Kod=142;

int Symbol_4_Kod=143;

Files:
 

Thanks .....

 

Hello,

How can I write in an EA, "Sell if 3up" based on 3 level zz semafor ?

Thanks.

 
Jovager:
Hello,

How can I write in an EA, "Sell if 3up" based on 3 level zz semafor ?

Thanks.

Jovager

That is a zigzag based indicator. It means that you will have signals after the fact (they will be "repainted"). That kind of signals are in general not suitable for EAs, but only for eastimation

 

I have found a very interesting trading strategy with 3 level zz semafore indicator. We all know that semafore indicator repaints, so here in this strategy cleverly using of this repainting indicator. I am posting here a link to a thread, please watch the chart carefully of that thread you will understand how to put buy sell order.

Semafor Trend Trading

Reason: