Any solution?
justify: What am I doing wrong?
int OnCalculate(... const double &low[], : for(i=limit; i>=0; i--) : extremum=low[iLowest(NULL,PERIOD_M30,MODE_LOW,InpDepth,i)]; and if(ExtHighBuffer[i]!=0.0) { lasthigh=iHigh(NULL,PERIOD_M30,i);
- Buffers are time series arrays (higher index is the past) OnCalculate's arrays are not. As the documentation says "you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with." or just use the predefined array Low.
- "i" is an index into the chart's time frame, 1 minute ago, 2 minutes ago, etc.
- You then pass that to iLowest as a M30 index, 1*30 minutes ago, 2*30 minutes ago, etc.
- iLowest then returns the lowest M30 index (n*30 minutes ago,) which you use to index the current chart's time frame low[] as n*1 minutes ago.
- Do not mix apples and oranges.
int iM30 = iBarShift(NULL, PERIOD_M30, Time[i]); int iM30LL = iLowest(NULL,PERIOD_M30,MODE_LOW,InpDepth,iM30); extremum=iLow(NULL, PERIOD_M30, iM30LL); and if(ExtHighBuffer[i]!=0.0) { iM30 = iBarShift(NULL, PERIOD_M30, Time[i]); lasthigh=iHigh(NULL,PERIOD_M30,iM30);
- The easier way would be to just use the iFractals function and not the code.
for(int i=Bars - 1 - IndicatorCounted(); i >= 0; --i){ int iM30 = iBarShift(NULL, PERIOD_M30, Time[i]); ExtHighBuffer[i] = iFractals(NULL, PERIOD_M30, MODE_UPPER, iM30); ExtLowBuffer[i] = iFractals(NULL, PERIOD_M30, MODE_LOWER, iM30); }
Thanks for your answer.
I'm learning. With the "ifractals" function already made that change. Now I wont do it withzigzag, but I see it's more complicated than it seems. But yet
quite understand.
I then have to change everything about high, low and bar time, so that the calculations made as if in M30, but give signals in the current chart.
It is what I have to do?
Thank you very much
I tried several ways but still can not find the solution.
Thank you very much
If I not mistaken, the zigzag would produce on current chart regardless timeframe settings. So, try on M30 chart.
By the way, M15 != M30 of how the chart is rendered. That is why the zigzag behaves like that (if I not mistaken).

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I made the following code, but does not show me the signs. What am I doing wrong?
Thank you very much