I'm trying to change and keep tags of manually drawing objects.
first I determine chart of object was drawn
protectedoverridevoid OnStartUp()
{
tag = BarsPeriod.Value.ToString()+ BarsPeriod.BasePeriodType.ToString();
}
and than change the object tag
protectedoverridevoid OnBarUpdate()
{
foreach (ChartObject co in ChartControl.ChartObjects)
{
if (co is ChartLine & co.UserDrawn == true)
{
if(co.Tag.Contains("Minute") == false)
{
string otag = co.Tag+tag;
co.Tag = otag;
}
}
}
Everything works, and the script changes tags. But if I switch chart to another time period it changes tags again. But I have check for new change. It seems that the tags are not saved.
My idea is to color global objects on other chart depends on color defined to chart on which it was first drawn automatically.
Regards.
Comment