Professionals, let's create an EA together! - page 5

 
Vladimir Gribachev:

So what if the zigzag redraws, then .... What do we do now?

Tell me what you need me to do.

When the deal is opened - close its half at 0.23% and the remaining half at 0.618%, since the right side of the zigzag is re-drawn we will TP1 and TP2 count as follows

For buy positions: TP1 = Price 100% Fibonacci (first point of the zigzag)+(Open Price - Price 100% Fibonacci (first point of the zigzag))*1.23 and TP2 = Price 100% Fibonacci (first point of the zigzag)+(Open Price - Price 100% Fibonacci (first point of the zigzag))*1.618

For sell positions: TP1 = Price 100% Fibonacci (first point of the zigzag) - (Price 100% Fibonacci (first point of the zigzag) - Open Price) *1,23 and TP2 = Price 100% Fibonacci (first point of the zigzag) - (Price 100% Fibonacci (first point of the zigzag) - Open Price) *1,618

I think so, please correct me if I have made a mistake.

To determine the direction of trades - the primary signal is taken from the TF H4 and above by the same methodology, ie, the price touched the 50% level, and the adviser works on the lower TF, at the appearance of the signal, it fills according to the direction of the primary signal

 
One more thing, if the position was closed by the previous values of the zigzag ray, and the new ray has not yet appeared, we will work the last ray by the new values, that is already a new price for the 50% level. Perhaps this is already in the EA - we need to check it.
 
Alexey Kozitsyn:
As a rough guide, the backstep zig-zag parameter can be set to 1.
alternatively
 
romariogold:
Try writing owls on this zig-zag. it's without redrawing.
Thank you, we're still using the standard one. Redrawing is needed.
 
Izzatilla Ikramov:
Thank you, we're still using the standard one. A redraw is needed.
He probably doesn't mean redrawing the current beam, but redrawing the previous ones. What's that for?! It's an error in zig-zag logic.
 
While also no stop loss should be implemented, it should be with two options - a) a stop loss is triggered if price touches the 61.8% level, b) a stop loss is triggered if price closes below (buy) / above (sell) 61.8% on the TFSL timeframe (eg: H4 bar close price below / above 61.8%)
 
I'll do it tomorrow, that's it for today, rest.
 

Added closure

Files:
Fibo.mq4  10 kb
Fibo.ex4  21 kb
 
but still no solution to the redrawing problem.
 
Write what you need, then I'll finish it when I'm free