Trendline (object) renaming in visual order left to right

 

HI,

I want to draw on my chart trendlines, just like drawing a ZIG ZAG, from peak to bottom, bottom to peak.

The trendline names are automatically allocated like Trendline 3235, Trendline 4575, Trendline 4654

I want to be able to run the thru these trendline objects and name them : Trendline 1 Trendline 2, Trendline 3, so that 1 is starting with the trendline further most left on the chart, and 3 is on the right hand side of the chart.

QUESTION: I know there are OBJECT functions, but how would I sort the trendlines so get the correct 1,2,3 allocation from left to right on the chart. Do I place details in an OBJECT ARRAY (?) and then sort them in the array, and then allocate name.

After I get them renamed then I can work out trading statistics of the price chart between trendline start and end points.

 
Code can set, but cannot change the name of an object.
 
phy wrote >>
Code can set, but cannot change the name of an object.

Can the Trendline description be changed then, and then read for my needs ?

If Trendlines dont allowing setting or renaming of the object, are they other object that can be renamed like labels or arrows ?

I need an object(s) on the chart to denote a pivot point on the chart, so that I can rename or orginise it some how the object rank from left to right visually on the chart.

 

The desciription text can be changed in your code.

ObjectSetText()

ObjectDescription()