How to use ZigZag [advanced]
-
@miro1360 Hi Miro! I am going to try! But I need to know, you are the best. Thank you for helping us!!
-
@miro1360 Hi Miro, I appreciate so much your help. I am trying to create a sell and buy pending orders.
I tried to put sell pending orders in the last bottom and put buy pending orders in the last top, mas I donΒ΄t know what is happening. I was so difficult, could you help me to create those orders, or at least one (buy pending order or sell pending order).
Bellow the project!
https://fxdreema.com/shared/UGVmGrF9
Thank you a lot!
-
here are limits and stops pending orders, one is above current price and another is below current price, so you should compare current price with desired zigzag price and with condition decide which pending order you want to open ...
next you need some comparison in zigzag prices, and when these prices are changed - new zigzag leg is comfirmed and after this comfirmation you need to change your current pending order (delete it and create new one in another price, or wait for another one pending order)
so as result, this can be pretty complicated algorithm, because here are more orders combinations (buy limits, buy stops, sell limits, sell stops), + zigzag variations ...
I can assure you that it is possible to do, but you will need to make more testing efforts with every small section of changes
I am sure that using my trick for zigzag from this tutorial, you can do all with pending orders 
-
@miro1360 Thank you! I am going to try again. I would like to learn more about how create EA MQL5. Do you indicate an intermediate or advanced course for this? I know to create basic EA's like MM, stchocastic, RSI and other, but I would like to know more deeply. I like the strategy of breakouts, dow theory, and is so difficult to create. Do you have a recommendation?
Thank you!
Darlan
-
I dont know if some course can help you because here is nothing specific how it can be learned by following steps, there are few abstract things connected with creativity using logic
... you can follow few examples and tutorials with the assumption of capturing the principle of connecting (or to uncover the possibilities) blocks in fxdreema into logic assemblies ... after this assumption you must start with your own creativity ... if you have a big complicated goal, you must (not should, but you must) divide it into smaller working parts and test every part if it is working as you expected, when right working is confirmed than you can connect these parts into bigger and bigger assemblies and test them again for logic conflicts (you can test it with visual tester, plotting graphical objects and comments as temporary auxiliary) ... it is the same as LEGO, but with extension to create own "blocks" 
-
@miro1360 Thank you!
-
Thank you!
I have a question, could you help me? I am using zigzag indicator that you send for me. Is ok, my only problem is about the tests. When I run the test in "Open prices only" is ok, but I don't like this test. I like at least OHLC 1 min. But when I run 1 min OHLC the tests takes a long time. I don't what happen,. When I remove the zigzag structure the tests run well.
Could you help me?
Thank you!
-
zigzag needs a lot of calculation, and it is reason why it is slower ... the faster procesor you have (+SSD disk) the faster test result can be ..
-
-
You can speed this up considerably if you use the "Once per bar" block before the calculations. https://fxdreema.com/shared/jLyXfD5Ed
-
in case Once per bar do not use values with ID=0

-
Thank you! I will try using Once per bar.
-
[][][][][][][][][][][
-
Hi Miro,
This is really great stuff and what I was looking for.Is there a way to label the waves so we know which one is actually the L1 and H1 of the structure?
What I want to do is have an impulse up, (top is H0), then next move down (L0), then next move up (H1), then sell here and take the L1 down. The problem i am having is I don't actually know which one the calculation is actually labeling as L1.
Thank you in advance and for this great script
-
the whole project is about this what you asked ...
variables:
var_zz_H0_ID, var_zz_H1_ID, var_zz_H2_ID
var_zz_L0_ID, var_zz_L1_ID, var_zz_L2_IDif you compare them as this:
var_zz_L0_ID < var_zz_H0_ID, if the condition is true, then you know that L0 is the last zigzag leg (pointing down), and you know where is L1
if the condition is false, then you know that H0 is the last zigzag leg (pointing up), and you know where is H1ID is not the price, it is ID of specific zigzag candle ...
prices are variables without ID (var_zz_L0, var_zz_H0, ...) -
Hi Miro,
thank you for the reply.
Maybe I am not understanding. for instance this is the script I have added a few blocks for the sell.
https://fxdreema.com/demo/simpleIt sells below what i believe is the H1.

What I hope hoping to achieve:
BUYS

SELLS

How possible is this? Thank you!!
-
H1 and L1 are not future points, they are past points ... candles are marked 0,1,2,... from left (0 is the most recent candle) to the right (past candles)
-
Thank you again.
Okay so it didn't work.
This is what I have so far. Also I changed the Depth variable from "12" to "6" to capture the smaller zigzag.
https://fxdreema.com/shared/FSzlRw9udWhat I want to achieve is when you have a zigzag, when it completes the 3 wave structure, you look for 6 candles dropping with lower highs and lower lows consecutively, then you BUY once the high of the lowest candle (1) is broken.
Below is a picture of the structure.

Can this be done?
Thank you so much!
-
because you messed up it completely
... I told many times, and I repeat myself once again and again: zigzag is not simple for beginners (or not coders)
... and I'm banging my head on the table, why the hell I got this idea to create the zigzag thread, because instead of explaining how the zigzag works I do the whole project for people from scratch
...https://fxdreema.com/shared/8Xeio059c



Anyway, this is my last reply for this ZigZag thread. Everything was covered here into details with many examples ... If you does not understand zigzag, read it once again, and once again. Notice also how important are block IDs - order. If you failed, give a break for zigzag and do anything other. Come back after a few days and read everything again and give a new try.
-
You are a life saver. Thank you so much for clearing this up. I will stop annoying you on this now.


