Profile Picture

Custom settings for user-defined indicators

Posted By ssdarvin 7 Years Ago
Posted Sunday October 30 2011
Hi, I'm designing some user-defined indicators. Some of them need custom settings, such as, parameters.

I wish a custom setting form could be shown when a indicator being used.

How can I realise this?


Posted Sunday October 30 2011
How are you using your indicators? If you are creating them from code then you would need to use code to set the settings. If you are dragging them onto a chart or the system designer, a settings dialog will show up that lets you set the values for constructor parameters. So make your indicator take the parameters in the constructor and mark it with the ConstructorArgument attribute. For example, this is what it looks like for the MACD indicator:

[ConstructorArgument("Period 1", ConstructorArgumentType.Integer, "12", 1)]
[ConstructorArgument("Period 2", ConstructorArgumentType.Integer, "26", 2)]
public MACD(int period1, int period2)


Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems