Quote:
Originally Posted by Dimicr
If i understend correctly this indicator show these patterns or No?
|
By looking at your code I would say not so,and by looking at the indicator I would confirm,I modified from 500 to 50,to have more visual examples..there are several msh and msl that are not arrowed..and some arrows that are neither pattern
//==============================================
MSH[i]=EMPTY_VALUE;
int barH1 = iHighest(NULL, 0, MODE_CLOSE, 500, i+4);
int barH2 = iHighest(NULL, 0, MODE_CLOSE, 500, i+3);
if (barH1==i+4 && barH2 == i+3 && Open[i+2] > Close[i+2] && Close[i+1] < Close[i+2] ) MSH[i] = High[i]+ 5*Point;
//==============================================
MSL[i]=EMPTY_VALUE;
int barL1 = iLowest(NULL, 0, MODE_CLOSE, 500, i+4);
int barL2 = iLowest(NULL, 0, MODE_CLOSE, 500, i+3);
if (barL1==i+4 && barL2 == i+3 && Open[i+2] < Close[i+2] && Close[i+1] > Close[i+2] ) MSL[i] = Close[i]- 5*Point;
I would say..MSH would be :
Close(i+1)<Close(i+2)&&Close(i+2)>Close(i+3)...and then you have to code that "New Highs" issue..for the closes and for the highs...not necessarily among the last 500 bars...inverse for MSL..Anyway I am not a coder

.
Thanks for your interest,I believe we can codify some of the patterns.
Will try to post my idea for a code of MSH,MSL...probably on Monday,and you can check it .