stringo wrote:
Try to copy one line from init function to start function
Try to copy one line from init function to start function
int start() { if (Bars<AllBars+Per || AllBars==0) NB=Bars-Per; else NB=AllBars; int CB=IndicatorCounted(); ...
Stringo, thank you. I tested the recommended change as a cut amd paste and all arrows on chart disappeared. I'm now testing as you stated a copy and paste.
wackena wrote:
Stringo, thank you. I tested the recommended change as a cut amd paste and all arrows on chart disappeared. I'm now testing as you stated a copy and paste.
Stringo, I tested your recommendation and it did not work. Still have to manually
reset indicator to get indicator to update position of arrows. Any other suggestions
will be appreciated.
stringo wrote:
Try to copy one line from init function to start function
Try to copy one line from init function to start function
int start() { if (Bars<AllBars+Per || AllBars==0) NB=Bars-Per; else NB=AllBars; int CB=IndicatorCounted(); ...
Stringo, thank you. I tested the recommended change as a cut amd paste and all arrows on chart disappeared. I'm now testing as you stated a copy and paste.
Have you tried
start()
..
for(SH=0;SH<NB; etc..
wackena, I cannot reproduce your problem
wackena:
I'm using this Trend Signal indicator and it fails to keep the trend up and trend down arrows on the chart current. When indicator is reset manually by either reloading, opeing propeties and clicking OK or changing chart timeframe and back again, it redraws the latest arrow with new data. But it doesn't do this automatically.
Can someone please review code below and advise if this indicator code can be altered to keep chart arrows current.
Thanks in advance,
Wackena
If I understood your problem correcly you want that the indicator would update all
arrows to have the actual situation. If so you should use BarsPerWindow() function.
so it calculates all visible dataset. so change the lineI'm using this Trend Signal indicator and it fails to keep the trend up and trend down arrows on the chart current. When indicator is reset manually by either reloading, opeing propeties and clicking OK or changing chart timeframe and back again, it redraws the latest arrow with new data. But it doesn't do this automatically.
Can someone please review code below and advise if this indicator code can be altered to keep chart arrows current.
Thanks in advance,
Wackena
if(CB<0) return(-1); else if(NB>Bars-CB) NB=Bars-CB;
because it makes the code calculate just one bar -- after first calculatiod CB=1 and this means that if the new Bar is created it calculates only new data. what you need is something like
if(CB<0) return(-1); else if(CB==0) NB=Bars; else NB=BarsPerWindow(); ObjectsDeleteAll(EMPTY, OBJ_ARROW); for(int n=0;nNB;n++) { BufU[n]=0.00; BufD[n]=0.00; }
now the code calculates at first time all Bars and after that all visible bars and deletes all old arrows before that. It looks that your problem is constantly new arrows (groups) if the signal is coming...
this should do what you asked for...
stringo wrote:
wackena, I cannot reproduce your problem
Stringo, I use the indicator on H4 chart. But that is too long for you to wait to see the problem. Attached indicator
to M1 chart and wait a few minutes. Place curser over one of the arrows until text ID box appears. Right-click
on the arrow and select indicator's properties, and then click OK. you will see the newest arrow redrawn in new
position. The indicator's data is current, but it is unable to keep chart current. wackena, I cannot reproduce your problem
Can a reset be coded into indicator or in the EA attached to same chart?
Any advice is greatly appreciated.
Wackena
zolero wrote:
because it makes the code calculate just one bar -- after first calculatiod CB=1 and this means that if the new Bar is created it calculates only new data. what you need is something like
now the code calculates at first time all Bars and after that all visible bars.
to be sure you see only new arrows use ObjectsDeleteAll(EMPTY, OBJ_ARROW); by deinit(). ..
this should do what you asked for...
zolero, I tried your suggestion. New arrow is now drawn, but preceding arrow does
not delete itself. So, after a few minutes on M1 chart, there can be multiple same
colour arrows next to each other. I put put the suggested delete code as follows;wackena wrote:
I'm using this Trend Signal indicator and it fails to keep the trend up and trend down arrows on the chart current. When indicator is reset manually by either reloading, opeing propeties and clicking OK or changing chart timeframe and back again, it redraws the latest arrow with new data. But it doesn't do this automatically.
Can someone please review code below and advise if this indicator code can be altered to keep chart arrows current.
Thanks in advance,
Wackena
If I understood your problem correcly you want that the indicator would update all
arrows to have the actual situation. If so you should use BarsPerWindow() function.
so it calculates all visible dataset. so change the lineI'm using this Trend Signal indicator and it fails to keep the trend up and trend down arrows on the chart current. When indicator is reset manually by either reloading, opeing propeties and clicking OK or changing chart timeframe and back again, it redraws the latest arrow with new data. But it doesn't do this automatically.
Can someone please review code below and advise if this indicator code can be altered to keep chart arrows current.
Thanks in advance,
Wackena
if(CB<0) return(-1); else if(NB>Bars-CB) NB=Bars-CB;
because it makes the code calculate just one bar -- after first calculatiod CB=1 and this means that if the new Bar is created it calculates only new data. what you need is something like
if(CB<0) return(-1); else if(CB==0) NB=Bars; else NB=BarsPerWindow();
now the code calculates at first time all Bars and after that all visible bars.
to be sure you see only new arrows use ObjectsDeleteAll(EMPTY, OBJ_ARROW); by deinit(). ..
this should do what you asked for...
int deinit()
{
ObjectsDeleteAll(EMPTY, OBJ_ARROW);
return(0);
}
When I reset indicator, the multiple arrows delete and newest arrown remains drawn.
Wackena
wackena:
When I reset indicator, the multiple arrows delete and newest arrown remains drawn.
Wackena
if(CB<0) return(-1); else if(CB==0) NB=Bars; else NB=BarsPerWindow(); ObjectsDeleteAll(EMPTY, OBJ_ARROW); for(int n=0;nNB;n++) { BufU[n]=0.00; BufD[n]=0.00; }this deletes multiple arrows
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
Can someone please review code below and advise if this indicator code can be altered to keep chart arrows current.
Thanks in advance,
Wackena