How to use ZigZag [advanced]
-
After longer time I am adding new trick how I am using ZigZag indicator in fxDreema.
First something about ZigZag. ZigZag is indicator mostly used for plotting another lines based on its highs/lows, or placing pending orders here.
... but it is repainting indicator == dont expect 100% accuracy.
Most repainted is current leg - it can be used for comparing with previous legs (if last leg value is more or less as leg previous, but last leg is not good to use it for placing pending orders). Pending orders is good to place into previous legs.This current leg can have two scenarios, these (and it is important for understand) :


Question is, is it possible in fxdreema to find, if current leg is "low" or "high" ?
Yes, it is, but it is little tricky.
In fxdreema can be legs found by ID. But you cant find if last leg is L0 or if it is H0. You can not use simple condition for comparing current price with zigzag leg ID(0).
For right comparison you need some small algorithm which create order for IDs (or in another words, find if L0_id is > or < as H0_id).For this I create small algorithm which write zigzag candle ID values into variables called var_zz_H0_ID, var_zz_L0_ID, .......
parameter zz_ID_interval is candles interval, where searching is done
(note, important are only H0/L0 IDs, but I am creating this from my previous project where I had also H1 2 and L1 2 IDs, just for this example ignore H1,2 L1,2):

After this algorithm I can compare/find if last zigzag leg is Up/high or Down/low:

When I know this, I can use zigzag prices in right way (here for pending orders or ploting lines where current (not closed) zigzag leg is ignored) :

Inputs and variables used in project:


And result: ploting lines in tester where ZigZag current leg is ignored:


Shared project:
https://fxdreema.com/shared/8eW5li27dImportant note: Algorithm in this project was created fast, is not perfect, is slow and crazy behaviour can be expected. It can be done in better way, but I never needed another form

Have a fun

-
@miro1360
miro you are a real life saver
this is what i have been looking for -
@miro1360
so this is for finding if the current leg is in upward direction or in downward direction right ?

and this is for drawing the lines on high and lows right ?

and what is this ?

-
by the way i just tested it and it works perfect
-
glad to hear that it is working for you
... not connected block (alone) is not added into EA, I am using this Pass block only for adding scroll bars into fxdreema working area
(it have nothing to do with EA functionality) -
@miro1360
so it wont be a problem if i remove this alone block and add my own sauce?
i mean removing this block wont effect the functionality , right ? -
yes you can remove it
... dont worry to do things and test them 
-
-
hello . can you please help me out with a little thing?
actually i have an indicator it draws arrows on the zigzag high and low
could you please modify it in a way that it does not draw arrow on the leg of the zigzag
0_1504692041489_arrow.mq4
i would have done it myself but i dont have any programming skills -
it draw arrows not exactly on zigzag, it draws them based on highest/lowest thing ...

you need hide arrows? just change in settings color to None (in EA clrNone) ...

-
@miro1360
no no
i dont want all the arrows to disapear
i want only arrows that appears on the leg to disappear -
modification like this is something as create new indicator from scratch,
because it needs a lot of things == it cost a lot of time and I have not this time ...
... -
hmmm okay thanks
-
@miro1360
hello just tried to use this in an ea but 55 errors i know i must be doing something wrong can you help me out here?
-
never mind
i forgot to declare constants and variables , its good now -
@miro1360 Hi Miro! Do you have this algorithm for MT5? I can't make it work...
-
I have not it for MT5 ... not yet ...
-
@miro1360 Hi Miro, I am trying hardly to make this for MT5. I did all things that you show but when I try to create the EA I receive this message:
Compilation errors
'zzTF' - cannot convert enumCould you help me?
Thank you!
-
-
hi, you must do another system for crazy MQL5 with few changes in logic, something like this:
(import project to see details in externs-inputs) https://fxdreema.com/shared/jmgcWOcIc
