Order ( On Top / Behind ) of TrendLines

Created at 21 Oct 2021, 13:56
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JO

Jobauma

Joined 07.10.2020

Order ( On Top / Behind ) of TrendLines
21 Oct 2021, 13:56


Hi.

I have discovered that the order ( on top / behind ) of trendlines is random.

var TrendLine = Chart.DrawTrendLine(Name, Index, Value_1, Index, Value_2, Color, 4, Style);
TrendLine.IsLocked = true;
TrendLine.ExtendToInfinity = false;

Can, for example, the name of "TrendLine" be the main factor for ordering trendlines, regardless of time created?

And the second factor is when "TrendLine" is used (created), from, for example, a method. :)

The name of "TrendLine" could be the main factor for ordering: "TrendLine_A", "TrendLine_B", "TrendLine_C"...

Can this be solved?

Best regards,

Johannes Hillestad Baumann


cTrader
@Jobauma
Replies

Jobauma
22 Oct 2021, 18:06

When is actually working right. After a restart of cTrader or reloading my indicators, the last trendline created is on top, and the first one is behind.

But what if you want all horizontal lines to be on top regardless of when, then diagonal lines behind, and lastly, vertical lines behind diagonal lines?

Could there be a function to sort this out in indicators?

Best regards,

Johannes Hillestad Baumann


@Jobauma

Jobauma
22 Oct 2021, 18:18

In live time when is an issue.

Best regards,

Johannes Hillestad Baumann


@Jobauma

Jobauma
24 Oct 2021, 11:00 ( Updated at: 24 Oct 2021, 12:01 )

A better idea would be:

TrendLine_Horizontal.Layer = 2;
TrendLine_Diagonal.Layer = 3;
TrendLine_Vertical.Layer = 1;

This way this solution will not affect finished indicators. :)

Layer 1 would be default. :P

What is usual, and not desired, is trendlines that are behind others. So I think the greater the number of "Layer" pushes the trendlines of that layer on top of the lower layer.

Can this be implemented?

Best regards,

Johannes Hillestad Baumann


@Jobauma

Jobauma
24 Oct 2021, 12:31

I found the solution!

"ZIndex" is the layer of chart objects. :)

Thanks for a great trading platform, that has almost everything figured out.

Best regards,

Johannes Hillestad Baumann


@Jobauma