Trendline dynamic changes  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
tradetree
Posts: 81
Joined: 29 Apr 2013
Location: www.threefoldmarkets.com
Has thanked: 12 times
Been thanked: 16 times
Contact:

Trendline dynamic changes

Postby tradetree » 07 Nov 2013

From the MC supplied indicator "Trendlines_Automatic" is this piece of code:

Code: Select all

m_uptlref.Value.End = new ChartPoint(Bars.Time[0], m_uptlref.Value.PriceValue(Bars.Time[0]));
Does the above code dynamically change the end point of the trendline?


If you do this code:

Code: Select all

m_uptlref.Value =
DrwTrendLine.Create(
new ChartPoint(m_swlotime[0][((m_index.Value))], m_swloval[0][((m_index.Value))]),
new ChartPoint(m_swlotime[0][0], m_swloval[0][0]));
are you creating a new trendline or overwriting the previous one? What I need is to understand how to change vs. how to create trendlines and how persistence of trendlines works?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Trendline dynamic changes  [SOLVED]

Postby Henry MultiСharts » 08 Nov 2013

From the MC supplied indicator "Trendlines_Automatic" is this piece of code:

Code: Select all

m_uptlref.Value.End = new ChartPoint(Bars.Time[0], m_uptlref.Value.PriceValue(Bars.Time[0]));
Does the above code dynamically change the end point of the trendline?
Hello tradetree,

That is correct.
If you do this code:

Code: Select all

m_uptlref.Value =
DrwTrendLine.Create(
new ChartPoint(m_swlotime[0][((m_index.Value))], m_swloval[0][((m_index.Value))]),
new ChartPoint(m_swlotime[0][0], m_swloval[0][0]));
are you creating a new trendline or overwriting the previous one?
This code creates a new trendline.
What I need is to understand how to change vs. how to create trendlines and how persistence of trendlines works?
Please refer to our Programming Guide that describes working with drawings in details: Drawings

tradetree
Posts: 81
Joined: 29 Apr 2013
Location: www.threefoldmarkets.com
Has thanked: 12 times
Been thanked: 16 times
Contact:

Re: Trendline dynamic changes

Postby tradetree » 13 Nov 2013

Thanks.


Return to “MultiCharts .NET”