what is detail of "type_of_indicator" in AddIndicator()?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
gztanwei
Posts: 32
Joined: 15 Aug 2015
Has thanked: 6 times
Been thanked: 5 times

what is detail of "type_of_indicator" in AddIndicator()?

Postby gztanwei » 06 Feb 2016

One of the override is as below. what is detail of "type_of_indicator" in AddIndicator()? What does it do?

Code: Select all

protected object AddIndicator(
Type type_of_indicator,
int data_stream
);

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: what is detail of "type_of_indicator" in AddIndicator()?  [SOLVED]

Postby Henry MultiСharts » 10 Feb 2016

Hello gztanwei,

You can access indicators data by one of the following methods:
1. Pass the indicator's name into the AddIndicator() function:
PowerLanguage.Indicator.ADX m_adx1;
m_adx1 = (PowerLanguage.Indicator.ADX)AddIndicator("ADX", 1);

2. Pass the types declaration for the required indicator into the AddIndicator() function:
PowerLanguage.Indicator.ADX m_adx2;
m_adx2 = (PowerLanguage.Indicator.ADX)AddIndicator(typeof(PowerLanguage.Indicator.ADX), 2);

Both ways provide the identical functionality.
For more information please refer to Type Class @ MSDN.

gztanwei
Posts: 32
Joined: 15 Aug 2015
Has thanked: 6 times
Been thanked: 5 times

Re: what is detail of "type_of_indicator" in AddIndicator()?

Postby gztanwei » 10 Feb 2016

Hello gztanwei,

You can access indicators data by one of the following methods:
1. Pass the indicator's name into the AddIndicator() function:
PowerLanguage.Indicator.ADX m_adx1;
m_adx1 = (PowerLanguage.Indicator.ADX)AddIndicator("ADX", 1);

2. Pass the types declaration for the required indicator into the AddIndicator() function:
PowerLanguage.Indicator.ADX m_adx2;
m_adx2 = (PowerLanguage.Indicator.ADX)AddIndicator(typeof(PowerLanguage.Indicator.ADX), 2);

Both ways provide the identical functionality.
For more information please refer to Type Class @ MSDN.
Thanks. Sounds like the 2nd way is more appropriate and can avoid typo in the name string.


Return to “MultiCharts .NET”