I suggest you to rebuild entirely the script.
It is quite difficult to check the lines. I admit that the structure of this template is not clear, it was done for my own use at the beginning. I will make a new template for the future EA, as I'm still finding errors in this one today.
to eliminate false divergence signal use filter
1. one HMA
2. cross 2 HMA
3. 2 RSI
for close trade can use:
3.Max value of stoch
all together or one of this.
reverse open stoch is still no good acting-better don't use
1a with constans Margincutoff
1b with flowing Margincutoff as percent of Balance
new version stoch divergence with second trade after close divergation trade.
it's not optimise, it's only example , so if somebody want to do it and show to us it will be very good. but optimisation take to much time
Can I suggest you try your Divergence on fib levels or cycles. You might miss a cycle or three but the divergence might find more cycles that are correct.
Do email me with any concerns or suggestions email@example.com
I will try and get some pics for you to observe how to apply divergence. Keep in mind divergence is a confirmation signal not a location of a trade. i.e You need to find the end of cycles then confirm it is the cycle rotation by having divergence at that point. This will not always work ( perhaps 60-80 % 0f the time working) but it will put the odds on your side.
Stay tuned for some pics later on.
Here are the pics you wanted...
Notice cycles are already formed (in darker colours) and they are noticable but if they werent then the divergence should be able to identify some of them.
Feel free to question anything.