how to limit the NUMBER of bars to count for an indicator?
tried
SetIndexDrawBegin(0,NoOfBars);
but what it does is it subtracts the NoOfBars from the left side of the chart, instead of show #bars on chart, not exactly working.
thank you irtron! do you know if doing this will take less system resource? i have too many charts.
SetIndexDrawBegin(0,NoOfBars);
but what it does is it subtracts the NoOfBars from the left side of the chart, instead of show #bars on chart, not exactly working.
thank you irtron! do you know if doing this will take less system resource? i have too many charts.
Combined with the previous suggestion, it certainly will. I'm not sure if the function call alone does the trick though. The documentation says that it sets the default value, but it doesn't specify whether or not the whole array is calculated or initialised. May be the developers could shed light on this.
o6o2:
tried
SetIndexDrawBegin(0,NoOfBars);
but what it does is it subtracts the NoOfBars from the left side of the chart, instead of show #bars on chart, not exactly working.
Well, the question contains the answer - "it subtracts the NoOfBars from the
left side of the chart".tried
SetIndexDrawBegin(0,NoOfBars);
but what it does is it subtracts the NoOfBars from the left side of the chart, instead of show #bars on chart, not exactly working.
SetIndexDrawBegin(0, Bars - NoOfBars);
you are a genius! it works! although i have a hard time wrapping my head around
the reasoning of how it works, thank you soooo much irtron!
o6o2:
it works! although i have a hard time wrapping my head around the reasoning of how it works
it works! although i have a hard time wrapping my head around the reasoning of how it works
______________________________________Bars____________________________________________
________NoOfBars________ ________NoOfBars________
I|||||||||||||||||||||||I||||||||||||||||||||||||||||||||||||I|||||||||||||||||||||||I
^ ^ ^ ^
bar[Bars-1] SetIndexDraw(0,NoOfBars) SetIndexDraw(0,Bars-NoOfBars) bar[0]
o6o2:
thank you soooo much irtron!
thank you soooo much irtron!
You're welcome,
mqlexpert [at] gmail [dot] com
interesting take on it, could you explain why its better?
so i declared that the NoOfBars = 1000; i'v tried inserting it in different places in the indicator code, but it just completely messes the indicator. please help. thank you.