Plotting CCI TLine

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

Plotting CCI TLine

Postby designer01 » 28 Aug 2011

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
Chart.jpg (123.41 KiB) Viewed 172 times

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Plotting CCI TLine

Postby TJ » 28 Aug 2011

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

Postby designer01 » 29 Aug 2011

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

User avatar
TJ
Posts: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

Re: Plotting CCI TLine

Postby TJ » 29 Aug 2011

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


If you need more help, you have to give more information.
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

User avatar
Henry MultiСharts
Posts: 8378
Joined: 25 Aug 2011
Has thanked: 1199 times
Been thanked: 2677 times

Re: Plotting CCI TLine

Postby Henry MultiСharts » 30 Aug 2011

Please answer TJ's questions in order us to get more information regarding the issue or please come to our live chat Monday-Friday 6:30 am - 2 pm EST. We will do our best to help you.


Return to “MultiCharts”