just after almost two months I got your last reply. I just don't know how I skipped that. I am still having trouble with "redrawing my indicator". now I will try to fix the issue with the information you gave me. thank you a lot,,,
just after almost two months I got your last reply. I just don't know how I skipped that. I am still having trouble with "redrawing my indicator". now I will try to fix the issue with the information you gave me. thank you a lot,,,
I read this thread and I think that there is an issue in your code => the WindowRefresh() function will not help you.
I guess I am trying to reset the indicator to force it to redraw all again from the beginning!? my issue is that I am using a function that changes the past data in function of the new data, and the result is that my chart becomes a mass over the time. I need to redraw my entire indicator periodically. lately, I've been changing the time frame, so that when I go back to the time frame I was, I get my chart windows clean (redrawn) . here is the schema of my code:
intstart(){intlimit;
intcounted_bars=IndicatorCounted();
//---- check for possible errorsif(counted_bars<0)return(-1);
//---- last counted bar will be recountedif(counted_bars>0)counted_bars--;
limit=Bars-counted_bars;
if(limit>GV)limit = GV;
//---- main loopfor(inti=limit; i>=1; i--){{calculatesthevariableandfeedthebuffers}return(0);}
intstart(){intlimit;
intcounted_bars=IndicatorCounted();
//---- check for possible errorsif(counted_bars<0)return(-1);
//---- last counted bar will be recountedif(counted_bars>0)counted_bars--;
limit=Bars-counted_bars;
doublestartTime=GetTickCount();
if(limit>GV)limit = GV;
//---- main loopfor(inti=limit; i>=1; i--){{calculatesthevariableandfeedthebuffers}doublefinishTime=GetTickCount();
Print("Calculation time is ",(finishTime-startTime)/1000.0," seconds");
return(0);}
The "problem" may be that the indicators use a limit, i.e. the IndicatorCounted() function
in order to not repaint bars.
Changing timeframe resets that, WindowRedraw() may not. Its function is to redraw objects, not indicator indexes.
I know I usually go ahead and recalculate 1000 bars or so on most of the things I write, and that is
kicked off by a right-click Refresh.
If you don't severely limit the loop for the indicator, you get an indicator refresh on every tick.
Thanks a lot,
Are you "hard of reading" ?
just after almost two months I got your last reply. I just don't know how I skipped that. I am still having trouble with "redrawing my indicator". now I will try to fix the issue with the information you gave me. thank you a lot,,,
Show your code...
hi phy,
just after almost two months I got your last reply. I just don't know how I skipped that. I am still having trouble with "redrawing my indicator". now I will try to fix the issue with the information you gave me. thank you a lot,,,
I guess I am trying to reset the indicator to force it to redraw all again from the beginning!? my issue is that I am using a function that changes the past data in function of the new data, and the result is that my chart becomes a mass over the time. I need to redraw my entire indicator periodically. lately, I've been changing the time frame, so that when I go back to the time frame I was, I get my chart windows clean (redrawn) . here is the schema of my code:
thanks a lot,,,
What is GV?
What I've been doing recently, is something like this:
for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--){
It redraws the visible part of the indicator on every tick, but not the bars that are out of sight.
What is GV?
What I've been doing recently, is something like this:
for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--){
It redraws the visible part of the indicator on every tick, but not the bars that are out of sight.
you guys are awesome!! I will implement this code this afternoon.
thanks for your generosity,,,