hi
i used CHARTEVENT_OBJECT_CREATE to change color and the name of every trend line user draw on chart
and i used a Counter to add number to a origin name and put it on trend line
but it's cause a endless loop and Counter don't stop Counting
You can do something like this to avoid endless looping:
string namePrefix = "ROB_TREND"; if(id==CHARTEVENT_OBJECT_CREATE && StringFind(sparam,namePrefix)<0 && ObjectType(sparam)==OBJ_TREND) { ObjectSetString(0,sparam,OBJPROP_NAME,namePrefix+(string)numtr); ObjectSetInteger(0,namePrefix+(string)numtr,OBJPROP_COLOR,clrBlue); Comment(numtr); numtr++; }
You can do something like this to avoid endless looping:
thanks
the problem solved
but i want name them like A1,A2,A3,...
but the number is going significantly large and then counting stopped
how i can just set one iteration per CHART_EVENT?
thanks
the problem solved
but i want name them like A1,A2,A3,...
but the number is going significantly large and then counting stopped
how i can just set one iteration per CHART_EVENT?
I don't understand your question, because the number only increase once based on my suggestion above... show your latest code if you're still having issues...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi
i used CHARTEVENT_OBJECT_CREATE to change color and the name of every trend line user draw on chart
and i used a Counter to add number to a origin name and put it on trend line
but it's cause a endless loop and Counter don't stop Counting