how to get name of security inside an indicator or strategy?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
novaleaf
Posts: 49
Joined: 17 Apr 2014
Has thanked: 9 times
Been thanked: 4 times

how to get name of security inside an indicator or strategy?

Postby novaleaf » 13 May 2015

Hello, I am trying to debug a portfolio strategy, one of my securities is causing an exception to be thrown from my strategy.

How can I obtain the name of the security that is causing the error? I am trying to use Output.WriteLine but don't see where to get the name of the current security.

Thank you.

novaleaf
Posts: 49
Joined: 17 Apr 2014
Has thanked: 9 times
Been thanked: 4 times

Re: how to get name of security inside an indicator or strat

Postby novaleaf » 13 May 2015

I see the symbol listed at the top of a thrown exception, which is probably good enough, but any way I can actually obtain the symbol itself?

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

Re: how to get name of security inside an indicator or strat  [SOLVED]

Postby Henry MultiСharts » 14 May 2015

Hello novaleaf,

IInstrumentSettings.Name Property - returns name of the symbol.

novaleaf
Posts: 49
Joined: 17 Apr 2014
Has thanked: 9 times
Been thanked: 4 times

Re: how to get name of security inside an indicator or strat

Postby novaleaf » 14 May 2015

thanks henry, that is

Code: Select all

this.Bars.Info.Name
for anyone who need it.


Return to “MultiCharts .NET”