Order ( On Top / Behind ) of TrendLines
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
Replies
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
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