int start() { int i,limit,pos,nCountedBars=IndicatorCounted(); if(nCountedBars<0) return(-1); //---- last counted bar will be recounted if(nCountedBars==0) limit=Bars -(CandlesBeforeAfter*2+1); else limit=Bars-nCountedBars; //----Up and Down Fractals for(i=limit; i>=0; i--) { pos=ArrayMaximum(High,CandlesBeforeAfter*2+1,i); if(pos==i+CandlesBeforeAfter) { ExtUpFractalsBuffer[pos]=High[pos]+ArrowOffset; if(Time[0]>alert_time) { alert_time=Time[0]; doAlerts("HIGH FRACTAL",SoundFileShort); } } pos=ArrayMinimum(Low,CandlesBeforeAfter*2+1,i); if(pos==i+CandlesBeforeAfter) { ExtDownFractalsBuffer[pos]=Low[pos]-ArrowOffset; if(Time[0]>alert_time) { alert_time=Time[0]; doAlerts("LOW FRACTAL",SoundFileLong); } } } return(0); }
Naguisa Unada:
Thank you so much ... it works now just fine!

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
Hi I am going to attach a code for drawing fractals indicator. The indicator is working great with many option, the only problem that I have to refresh the chart in MT4 in order to see the new fractals. Can anyone tell me what is wrong with the code to make it work right without refreshing the chart everytime? ... Thanks!