To avoid changes in output (or sectors ZigZag reversal prices High and Low) in the allocation patterns for the study, you can use any range indicator excluding the value of the last extreme. Then appeal to the indicator will be of the form
iCustom (NULL, 0, "ZigZag_NK", 89,5,3,1, shift);
shift - the number of bars ago.
In constructing the Kohonen network, I have not used the indicator. And in the PNN is used as an output. Trading signals are not changed. Kohonen network, I use mainly for the transformation of the initial indicators.
The new indicators allow us to generalize the original testimony and thus provide new job opportunities that improve the performance of trading systems.
Hello Mr Future,
Thank you for your generous contributions to this thread. I compliment you on your English, and apologize that I cannot communicate in Russian.
However,I do not fully understand your last post.
Perhaps I have misunderstood ZigZag. It does not display the last few bars, because if it did it would repaint. It cannot decide where the next pivot point is, until the pivot point occurs. So it does not know the slope of the last segment. This means that ZigZag is undertermined for the last few bars. But perhaps the version that you call is determined up to the current bar. If so it must be determined to be some value that will eventually change, since the slope of the last segment is unknown until the endpoint is found sometime in the future.
Perhaps the version of KOH that you use does not use ZigZag, but the version that you posted (KOH.mq4) does call ZigZag.
Here, there is a call in the start() routine
while(i>=0)
{
innet(i);
.
.
.
Then in innet(shift), there is calculation
double l=iCustom(NULL,0,"ZigZag_NK",89,5,3,0,shift);
double h=iCustom(NULL,0,"ZigZag_NK",89,5,3,1,shift);
if (l>0) {inarray[20]=1; inarray[21]=0;}
if (h>0) {inarray[20]=0; inarray[21]=1;}
if (h==0&&l==0) { inarray[20]=0; inarray[21]=0;}
So the input array to the Kohonen net includes a feature that depends on the value of ZigZag. Hence the output of the Kohonen net must also depend on ZigZag.
In PNN.mq4, there is a call to another innet function
void innet(int shift)
{
inarray[0]=iCustom(NULL,0,"KOH_1",0,shift);
inarray[1]=iCustom(NULL,0,"KOH_1",0,shift+1);
inarray[2]=iCustom(NULL,0,"KOH_1",0,shift+2);
inarray[3]=iCustom(NULL,0,"KOH_1",0,shift+3);
inarray[4]=iCustom(NULL,0,"KOH_1",0,shift+4);
}
So the output of PNN must depend on KOH as an input...
I don't understand why ZigZag does not cause PNN to repaint.
If KOH_1 is different, perhaps you could post it?