add ObjectDelete(object_name);
if(i % 2 == 0) { // i = It's even ObjectDelete(object_name); ObjectCreate(object_name,OBJ_TEXT,WindowNumber,Time[i],1); ObjectSetText(object_name, DoubleToStr(MathAbs((MA_1 - MA_2)/ Point/xecn), 1),10,"Arial",FontColor1); } else { // i = It's odd ObjectDelete(object_name); ObjectCreate(object_name,OBJ_TEXT,WindowNumber,Time[i],2); ObjectSetText(object_name, DoubleToStr(MathAbs((MA_1 - MA_2)/ Point/xecn), 1),10,"Arial",FontColor2); }
qjol:
add ObjectDelete(object_name);
Very kind of you. Thanks a lot for your help.

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
I'm not too familiar with MT4 and have encountered a small problem and ask if someone might know where I got wrong.
Attached is a very simple indicator which should write the pips difference of 2 Ma's in a separate indicator window in two alternated rows.
It seems okay for past bars but after assigning the indicator it writes only in the lower row even though the colour assignment seems to be ok. (see picture)
Any help would be really appreciated.
THANKS