int start(){ for(int i=limit; i>=0; i--){ : if(up[i]!=EMPTY && down[i]!=lower){
up[i]/down[i] haven't values yet, so they will always be EMPTY_VALUE. Not EMPTYUnnecessary decrement Contradictory information on IndicatorCounted() - MQL4 forum if(counted_bars>0) counted_bars--; limit=Bars-counted_bars;
limit=Bars-1-counted_bars;
double upper = Low[i] - (10*Point); double lower = High[i] + (10*Point); : else if (tma1trueupper+(CrossPips*Point)<ichimocupper ...
Not adjusting for 4/5 digit brokersif(Use_Babon_Slope==true){
You would never write if( (2+2 == 4) == true ) would you? You'd write if(2+2 == 4). So don't write if (boolean == true). if(boolean) and if(!boolean) is sufficient, especially if you name your variables logically (Use_X, is_X, do_X, etc.if (highest_lowest==true){ if(alert==true && NewBar()){
- Attaching the binary is useless for us humans to read.
if(babonup<999999 && babondownlast<999999 && babondown>999999){
Don't hard code numbers. Use a #define so you self-document the code. If you mean EMPTY_VALUE use it.double babonup = iCustom(NULL,0,"Babon+Slope+",BabonPeriod,BabonMethod,BabonPrice,0,i);
Do you really have an indicator named "Babon+Slope+.mq4"?- I recommend factoring code into functions as a matter of good coding. I have ONE exception NewBar() and equivalents. They can ONLY be called once per tick - they return false if called a second time. Thus I recommend inline coding of that to prevent multiple calls.
bool NewBar() { static datetime lastbar; datetime curbar = Time[0]; if(lastbar!=curbar) { lastbar=curbar; return (true); } else { return(false); } }
for(int i=limit; i>=0; i--) : if(alert==true && NewBar()){ if(down[i]==High[i] + (10*Point) ||up[i]==Low[i] - (10*Point)){
You are calling it every time in your loop.
A) must be outside the loop.
B) When NewBar is true high[0] == low[0] etc perhaps you mean to look at down[1] etc.
C) Doubles rarely compare equal.
many many thanks Mr.William,
I think the problem was with the first solution you told above, I think that what made the indicator repaint.
many thanks too for your advices in coding that help me very well, really I don't find words help me to thank you.
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
Hello,,
this is the first time I post a topic here and hope to find solve to my problem
the problem is the indicator work correctly when attach it to the chart but when the price go there is a repainting in the signals and some signals disappear (but when reattach the indicator it appear!!)
the idea of the indicator :
there is a lot of conditions,, it will give signal of them but if there is any condition of it has a false signal it will not give any signal.
hope you will help me
the code of the indicator
and in attached the indicators this indicator depend on