# Plotting CCI TLine

Questions about MultiCharts and user contributed studies.
designer01
Posts: 80
Joined: 02 Feb 2010

### Plotting CCI TLine

In the screenshot below I have a Price Barchart with its values on the Right Axis and an indicator (CCI ploted in Magenta) with its values in the Left Axis. The PL code below plots the Trendline in Cyan at value 116 based on the Price Barchart values.

My question is how do I modify the PL code (shown below)so it plots the Trendline based on the CCI values? In other words I want to plot the Line based on the CCI value ... that is at the 116 CCI value where the red arrow is shown in the screenshot and not at 116 Price value where the cyan line is ploted.
Thanks

If LastBarOnChart then Value5 = TL_New ( D, T, 116, D[100], T[100], 116);
Attachments
Chart.jpg (123.41 KiB) Viewed 261 times

TJ
Posts: 6868
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 984 times
Been thanked: 1976 times

### Re: Plotting CCI TLine

designer01 wrote:In the screenshot below I have a Price Barchart with its values on the Right Axis and an indicator (CCI ploted in Magenta) with its values in the Left Axis. The PL code below plots the Trendline in Cyan at value 116 based on the Price Barchart values.

My question is how do I modify the PL code (shown below)so it plots the Trendline based on the CCI values? In other words I want to plot the Line based on the CCI value ... that is at the 116 CCI value where the red arrow is shown in the screenshot and not at 116 Price value where the cyan line is ploted.
Thanks

If LastBarOnChart then Value5 = TL_New ( D, T, 116, D[100], T[100], 116);

if it is a straight line you want,
the easiest way is simply to use PLOT.

Code: Select all

`plot100( 116, "line");`

if you want to draw a trendline in a subchart, you have to use the keyword TL_NEW_SELF.

Code: Select all

`If LastBarOnChart then Value5 = TL_New_self ( D, T, 116, D[100], T[100], 116);`

designer01
Posts: 80
Joined: 02 Feb 2010

### Re: Plotting CCI TLine

Thanks,
I like the second option

Code: Select all

`If LastBarOnChart then Value5 = TL_New_self ( D, T, 116, D[100], T[100], 116);`

but when I insert the indicator in the chart it does not plot the Trendline at all. Am I missing something?
Thanks

TJ
Posts: 6868
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 984 times
Been thanked: 1976 times

### Re: Plotting CCI TLine

designer01 wrote:Thanks,
I like the second option

Code: Select all

`If LastBarOnChart then Value5 = TL_New_self ( D, T, 116, D[100], T[100], 116);`

but when I insert the indicator in the chart it does not plot the Trendline at all. Am I missing something?
Thanks

A line by itself is only a line by itself, you have to look at the whole picture for a total solution:
eg. what instrument are you applying this into? what is the chart resolution? what is your code? how do you insert this into your code? etc. Any one of the above items can/may affect the outcome.
These users thanked the author TJ for the post:
Henry MultiСharts

Henry MultiСharts
Posts: 8661
Joined: 25 Aug 2011
Has thanked: 1218 times
Been thanked: 2787 times