Public properties for indicators

Questions about MultiCharts .NET and user contributed studies.
drolles
Posts: 50
Joined: 03 Dec 2012
Has thanked: 4 times

Public properties for indicators

Postby drolles » 25 Dec 2012

Hi,

I’ve been looking at the structure of an indicator like Bollinger Band.

Could you please help me understand a design decision?

I’m wondering why the property values (like m_testpricelband) public so they could be retrieved via a Signal / Strategy? Don’t we want to access those values? Sorry if I’ve missed an obvious design decision here, but isn’t that how NT implement their indicators?

Thanks and regards,

drolles

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

Re: Public properties for indicators

Postby Henry MultiСharts » 26 Dec 2012

Hello Drolles,
the property values (like m_testpricelband) public
It has been already changed in MultiCharts 8.1 beta 1. These values are private now.
isn’t that how NT implement their indicators?
We have a different approach. Please refer to the corresponding indicators/signals for examples in the latest version MultiCharts 8.1 beta 1.

drolles
Posts: 50
Joined: 03 Dec 2012
Has thanked: 4 times

Re: Public properties for indicators

Postby drolles » 27 Dec 2012

Henry,

Thanks very much for the reply.

Just to clarify you have made the property values “private” in the later versions?

Thanks for clarifying what the design decision is not (i.e. not like NT). Great. Can you possibly elaborate more on what the design decision is? I have looked at the examples and find them a little hard to understand.

Thanks and regards,

drolles

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

Re: Public properties for indicators

Postby Henry MultiСharts » 27 Dec 2012

Just to clarify you have made the property values “private” in the later versions?
Changes were done in MultiCharts 8.1 beta 1 and would be available in all further versions.
Can you possibly elaborate more on what the design decision is? I have looked at the examples and find them a little hard to understand.
Private (or class-private) restricts the access to the class itself. Only methods that are part of the same class can access private members.
Protected (or class-protected) allows the class itself and all its subclasses to access the member.
Public means that any code can access the member by its name.
Source: Class (computer programming)

drolles
Posts: 50
Joined: 03 Dec 2012
Has thanked: 4 times

Re: Public properties for indicators

Postby drolles » 27 Dec 2012

Henry,

Thanks for the reply.

I wanted to confirm that I understood correctly that you are saying that the properties are being made “private”. I.e. they have been moved from public to private?

I now understand that I wasn’t clear in my question. I’m aware of the logic in C# design (and OO programming) around having hidden properties of objects.

However, my question was focused on the implementation of that logic for MC Indicators. I understand that a design decision in the MC Dev / Design team around the making of those properties private and they contain values we want to accesses (e.g. the upper value of BB).

I’m trying to understand what the expectation of the design team on the best use of those values (i.e. how to access them) without the properties being public. There must have been a logic to the design. Once i’m able to understand the logic I can access the values in the way designed.

Cheers,

drolles

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

Re: Public properties for indicators

Postby Henry MultiСharts » 28 Dec 2012

Hello Drolles,

If you want to have the class' methods and variables available outside of the class then you need to make them (methods and variables) public.
If methods and variables should not be available outside of the class then make them private.
The design decision lies on the script developer and depends on the functionality he is trying to implement in certain environment. You can set the access specifier the way you like it.


Return to “MultiCharts .NET”