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
Public properties for indicators
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Public properties for indicators
Hello Drolles,
It has been already changed in MultiCharts 8.1 beta 1. These values are private now.the property values (like m_testpricelband) public
We have a different approach. Please refer to the corresponding indicators/signals for examples in the latest version MultiCharts 8.1 beta 1.isn’t that how NT implement their indicators?
Re: Public properties for indicators
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
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
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Public properties for indicators
Changes were done in MultiCharts 8.1 beta 1 and would be available in all further versions.Just to clarify you have made the property values “private” in the later versions?
Private (or class-private) restricts the access to the class itself. Only methods that are part of the same class can access private members.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.
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)
Re: Public properties for indicators
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
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
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Public properties for indicators
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.
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.