Why do you need ZigZag for that ? Just calculate the maximum/minimum between 2 crosses.
Something like :
double getMaximum(datetime firstCross,datetime secondCross) { double high[]; if(CopyHigh(_Symbol,_Period,firstCross,seconCross,high)!=-1) { int index=ArrayMaximum(high); if(index!=-1) return(high[index]); } return(-1); }
Why do you need ZigZag for that ? Just calculate the maximum/minimum between 2 crosses.
Something like :
What your code is supposed to return? Highest high between 2 crosses? This is far from the potential profit inbetween, marked on the screenshot.
ZigZag is a well-known tool for potential profit measurement - this is not my personal invention.
What your code is supposed to return? Highest high between 2 crosses? This is far from the potential profit inbetween, marked on the screenshot.
ZigZag is a well-known tool for potential profit measurement - this is not my personal invention.
You agree to website policy and terms of use
Hi guys, I´m building one EA based on MA crosses. This EA uses trailing stops. I want to find out values that would cause profit in majority of cases. I was wondering if we can calculate somehow "max achievable profit" If I open a trade just after 2 MA crosses, what is the max profit I can reach. I would need these values, their average value, modus and median. It can be displayed in chart or in xls file.
Any ideas? thanks