Strategy based on the "ZigZag" indicator - "Last ZZ50" - page 5

 

You don't take into account that point A appears on a small pullback and will follow it as the pullback continues. it would be more logical to take points that have already formed. In our case they are BCD points. And the B point may become the A point and redraw further.

I have laid out the Expert Advisor for experimentation. The idea seemed interesting. I finetuned a lot of things in it myself. I tried different variants.

 
Dmitiry Ananiev:

You don't take into account that point A appears on a small pullback and will follow it as the pullback continues. it would be more logical to take points that have already formed. In our case they are BCD points. And the B point may become the A point and redraw further.

I have laid out the Expert Advisor for experimentation. The idea seemed interesting. I finetuned a lot of things in it myself. I tried different variants.

Everything has been already implemented and can be seen in the previous video.

The Expert Advisor you have laid out will not work by strategy!

 
Vladimir Karputov:

It is possible to store the price correctly in a global variable (i.e. data type double). But this is very dangerous: you can make a mistake with rounding, the user can unintentionally modify the order (intentionally and unintentionally).

But saving ticket (ulong type) is a more secure method - even if modified, the ticket stays the same (of course excluding rollovers and clearing (although in case of clearing I'm not 100% sure)).

In our case, we need to keep the prices of ZZ peaks

 

Last ZZ50 version "1.005"

Anyway, so far the code itself, description will come later in the same post.


Description

  • pending orders are placed only at the moment when a new bar is born
  • each time we look for points "A", "B" and "C".
  • to distinguish a pending order on the "AB" ray from the "BC" one - the order ticket is saved to global variables of the terminal - the ticket is stored in a variable name. The format is as follows:

//|  format: "Last ZZ50ABnnnnnnnn"                                   |
//|          "Last ZZ50BCnnnnnnnn"                                   |
//|          nnnnnnnn - ticket                                       |

  • when the "AB" ray changes, we move the corresponding pending order
  • When a new ray appears, all pending orders should be deleted

Files:
Last_ZZ50.mq5  45 kb
 
Vladimir Karputov:

Last ZZ50 version "1.005"

Anyway, so far the code itself, description will be later in the same post.

Great, the process is underway)

What's needed:

On one ray - one (1) trade, now there are several, which spoils the statistics.

If the order triggered, that's it, do not put it on this ray, and wait for the next.

 
Vladimir Karputov:

Last ZZ50 version "1.005"

Description

  • pending orders are placed only when a new bar is born
  • each time we look for "A", "B" and "C".
  • to distinguish a pending order on the "AB" ray from the "BC" ray - the order ticket is saved to global variables of the terminal - the ticket is stored in the variable name. The format is:

  • when the "AB" ray changes, we move the corresponding pending order
  • When a new ray appears, all pending orders are deleted

I told in the video about the strategy flaw


 

Last ZZ50 version "1.006"

The new: on each current ray "AB" or "BC" now can be open (not open, but BE OPEN) one position - that is, while the ray is current and it already triggered a pending order and therefore has an open position, a new pending order on this current ray is not exposed.

"Current Beam" -

  • BC" ray at which the "B" and "C" points have not changed
  • ray "AB" where point "B" has not changed.

Files:
Last_ZZ50.mq5  49 kb
 
Vladimir Karputov:

Last ZZ50 version "1.006"

The new: on each current ray "AB" or "BC" now can be open (not open, but BE OPEN) one position - that is, while the ray is current and it already triggered a pending order and therefore has an open position, a new pending order on this current ray is not exposed.

"Current Beam" -

  • BC" ray at which the "B" and "C" points have not changed
  • ray "AB" where point "B" has not changed

Seems to be all according to the logic of this version. There is still the moment of closure, we need to figure out the most correct under the TC.

Maybe we should start using trawl but trawl is portfolio (grid) i.e. buy separately, sell separately?

Then we will try to use stops.

 
Vitaly Muzichenko:

Everything seems to follow the logic of this version. There's still the point of closing, we need to find out the most correct way for the TS.

Maybe we should start with trawl, but trawl is portfolio (grid), i.e. buy separately, sell separately?

Then let's try with stops

Separate stops for long and short positions - that's already interesting.
 
Vladimir Karputov:
Separate for short and long - this is already interesting.

It's supposed to work without much slack, but it's very difficult to detect it now, because there are so many of them, and it's hard to see).