![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
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.
Hi, phy.....
Even i have the same problem as above, i have to change the time frame manually and then i get a refresh indicator status.....
As i am new to coding i dose'nt know where to to add the magic line................
for( int i = MathMax(WindowFirstVisibleBar(), Bars-IndicatorCounted()); i>= 0; i--){
Plesae suggest....
Thanks... a .....lot.
Harry.
Hey guys it is working fine. thanks again,,,
Hi, brspMA,
Even i have the same problem.........
Can u guide me where to add that lime...
Thanks......
Thread start date - 2007.11.29
WHRoeder - Why are you posting to a FIVE year old thread?
RaptorUK - Thread start date - 2007.11.29
============================
What's wrong with replying to old threads?
Google doesn't discriminate content against chronology (unless using filters), so there's nothing wrong with helping others who come across threads via search engines.
Do mods go to a school where they're taught how to vilify and condemn noobs?
WHRoeder - Why are you posting to a FIVE year old thread?
RaptorUK - Thread start date - 2007.11.29
============================
What's wrong with replying to old threads?
Google doesn't discriminate content against chronology (unless using filters), so there's nothing wrong with helping others who come across threads via search engines.
Do mods go to a school where they're taught how to vilify and condemn noobs?
There is nothing wrong with replying to an old thread in principle.
It is replies like yours that have nothing to do with the topic that annoy others.
Also, replies to a 5 year old question are often not useful as mql4 evolves over time. Bringing an old thread to the top of the list will often mean that noobs are reading information that is no longer relevant.
It is possible that we have to redraw an indicator, but we don't know how many bars we have to redraw. If we create a fractal indicator, we have to recalculate the last three bars, because the third bar may become a fractal if the next 2 bars on the left satisfy the rules. I've created an indicator which will mark a support or resistance level when it is broken. However this could append after 10 bars or after 1000 bars. So be don't really know how many bars we have to recalculate. And if we recalculate all the bars on each tick, we will usually need to limit our indicator to the last 500 or 1000 bars.
It is also possible to refresh the chart so that it will recalculate all the bars of our indicator. But how do we do it programmatically? WindowsRedraw() and ChartRedraw() won't trigger a refresh for the indicator. If we change the another time frame and come back, the indicator will be recalculated, as described in first post. We can put an Expert with a CHARTEVENT_CLICK handler in our chart and then call the method ChartSetSymbolPeriod(0, NULL, 0). This will set the chart to the actual symbol period and actually allow the indicator to be automatically recalculated each time we click on the chart. using a click event is only an example and you can use it the way you want.
At the end of indicator's code put "ChartNavigate(0,CHART_CURRENT_POS,0);"
{
...
ChartNavigate(0,CHART_CURRENT_POS,0);
return(rates_total);
}