Z-Order for Plots and PlotType.DiscontinuousLine or change color for segment of one Plot

Created at 22 Mar 2025, 04:43
CT

ctid4529345

Joined 12.01.2024

Z-Order for Plots and PlotType.DiscontinuousLine or change color for segment of one Plot
22 Mar 2025, 04:43


Hi there,

new to cAlgo, and I'm trying to rewrite some indicators from another platform, I have currently come across two things
1) is there a way to specify the Z-axis order for Plots?
2) I have 4 Plots, i.e. one for each color, I used PlotType.DiscontinuousLine, unfortunately in cases where adjacent values ​​are from the same plot I am not able to achieve the desired result, i.e. the red segment should not be displayed and the yellow one below it should be displayed
Is there another solution how to change the color according to the value and have only one Plot?

red = decreasing below 0
yellow = increasing below 0

Thanks


@ctid4529345
Replies

firemyst
06 May 2025, 00:01

 

  1. Not that I'm aware of. However, you can adjust it somewhat depending on the order you have the plots listed in output. 
  2. Nope. that's a severe limitation with how cTrader stupidly implemented their system. The only way around it is instead of using the “output” feature, you have to draw individual trend-lines for each plot. Then that presents another issue is after about 500 drawing objects on the chart, cTrader's performance significantly degrades. So what I've done is keep track internally of what I draw, and every time a new bar is drawn, I remove all the drawings I had from 200 bars ago. 

Welcome to one of Spotware's many poor architectural designs. 


@firemyst

afhacker
06 May 2025, 05:59

Hi,

You can use SetLineAppearance method inside your indicator to set style of a segment of your indicator line outputs.


@afhacker