Trend lines drawn by Indicator on Price chart.  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
pdemontferrier
Posts: 4
Joined: 22 Jun 2017
Has thanked: 2 times

Trend lines drawn by Indicator on Price chart.

Postby pdemontferrier » 10 Aug 2017

Hello everyone,
From my signal I manage to call the Incator by adding the following :

Code: Select all

using PowerLanguage.Indicator;

private RSI_STR04 RSI_Indicator;

RSI_Indicator.Draw_RSI_PreEntry_Lines(RSI_01M_PEN_LO1_TIM, RSI_01M_PEN_LO1, RSI_01M_PEN_LO2_TIM, RSI_01M_PEN_LO2)


In the RSI Indicator I added the following :

Code: Select all

private ITrendLineObject RSI_PEN_TL;

public void Draw_RSI_PreEntry_Lines (DateTime RSI_01M_PEN_LO1_TIM, double RSI_01M_PEN_LO1, DateTime RSI_01M_PEN_LO2_TIM, double RSI_01M_PEN_LO2)
{            
RSI_PEN_TL = DrwTrendLine.Create(new ChartPoint(RSI_01M_PEN_LO2_TIM, RSI_01M_PEN_LO2), new ChartPoint(RSI_01M_PEN_LO1_TIM, RSI_01M_PEN_LO1), true);
RSI_PEN_TL.Style  = ETLStyle.ToolSolid;
RSI_PEN_TL.Size  = 1;
RSI_PEN_TL.Color = Color.DarkOrange;
}   


My problem is that the indicator draw the trend lines on the Price chart and not in the RSI chart.
Does someone can help me with this.
Thank you in advance for your contributions.
Attachments
Screen Shot 08-10-17 at 02.12 PM.PNG
Screen Shot 08-10-17 at 02.12 PM.PNG (35.1 KiB) Viewed 227 times

User avatar
JoshM
Posts: 2089
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1485 times
Contact:

Re: Trend lines drawn by Indicator on Price chart.  [SOLVED]

Postby JoshM » 11 Aug 2017

pdemontferrier wrote:My problem is that the indicator draw the trend lines on the Price chart and not in the RSI chart.


This shouldn't happen based on the information in your post. You already use the correct overloaded method of the `DrwTrendLine.Create()` method for drawing the trend line on the subchart (and not on the main price chart). So I can't tell unfortunately why it does happen.

What MultiCharts .NET version do you use?
These users thanked the author JoshM for the post:
pdemontferrier

pdemontferrier
Posts: 4
Joined: 22 Jun 2017
Has thanked: 2 times

Re: Trend lines drawn by Indicator on Price chart.

Postby pdemontferrier » 11 Aug 2017

Hi JoshM,
I use the latest version of Multicharts.net.
I take profit of your post to thank you for your incredible website TradingCode.net. It's a gold mine of intel that helps me every day on my programing work.
About the problem I think I understood what's going on.
Wile backtesting, the strategy flag the price chart (SubChart#1) so when you use the function DrwTrendLine.Create() its creates the trend line on the chart that is flag, meaning the chart of the strategy, and not the chart of the indicator, enev if the function belongs to the indicator.
I didn't find the way to force to flag SubChart#2 so I manage the problem in a different way, using txt file and runing the drawing of the trend lines on the indicator after the backtesting is completed.
Kind regards

pdemontferrier
Posts: 4
Joined: 22 Jun 2017
Has thanked: 2 times

Re: Trend lines drawn by Indicator on Price chart.

Postby pdemontferrier » 11 Aug 2017

JoshM wrote:
pdemontferrier wrote:My problem is that the indicator draw the trend lines on the Price chart and not in the RSI chart.


This shouldn't happen based on the information in your post. You already use the correct overloaded method of the `DrwTrendLine.Create()` method for drawing the trend line on the subchart (and not on the main price chart). So I can't tell unfortunately why it does happen.

What MultiCharts .NET version do you use?


Hi JoshM,
I use the latest version of Multicharts.net.
I take profit of your post to thank you for your incredible website TradingCode.net. It's a gold mine of intel that helps me every day on my programing work.
About the problem I think I understood what's going on.
Wile backtesting, the strategy flag the price chart (SubChart#1) so when you use the function DrwTrendLine.Create() its creates the trend line on the chart that is flag, meaning the chart of the strategy, and not the chart of the indicator, even if the function belongs to the indicator.
I didn't find the way to force to flag SubChart#2 so I manage the problem in a different way, using txt file and runing the drawing of the trend lines on the indicator after the backtesting is completed.
Kind regards

User avatar
JoshM
Posts: 2089
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1485 times
Contact:

Re: Trend lines drawn by Indicator on Price chart.

Postby JoshM » 11 Aug 2017

pdemontferrier wrote:I take profit of your post to thank you for your incredible website TradingCode.net. It's a gold mine of intel that helps me every day on my programing work.

Thank you, that's very kind of you. I'm glad it helps you that well.

pdemontferrier wrote:About the problem I think I understood what's going on.
Wile backtesting, the strategy flag the price chart (SubChart#1) so when you use the function DrwTrendLine.Create() its creates the trend line on the chart that is flag, meaning the chart of the strategy, and not the chart of the indicator, enev if the function belongs to the indicator.

Good catch, I did not notice that (what looks like) the price chart was indeed a subchart.

pdemontferrier wrote:I didn't find the way to force to flag SubChart#2 so I manage the problem in a different way, using txt file and runing the drawing of the trend lines on the indicator after the backtesting is completed.

I unfortunately also don't of a way to force `DrwTrendLine.Create()` to make a trend line on a specific subchart. But I'm glad to hear you found a good workaround.

Have a nice weekend. :)


Return to “MultiCharts .NET”