Powerlanguage namespace and classes questions

Questions about MultiCharts .NET and user contributed studies.
SysInv
Posts: 28
Joined: 25 Nov 2012
Has thanked: 1 time
Been thanked: 1 time

Powerlanguage namespace and classes questions

Postby SysInv » 08 Apr 2013

I've been working with the .Net version for a while now, and have mixed opinions about it. Hopefully I'm wrong regarding some (lack of) features so I would appreciate if the MC crew or any experienced user could point me in the right direction.

MC state that it's "tightly integrated" with visual studio, but Functions are not available in the solution as these are read only and you can't use it debug strategies real time?

Since we can't debug the strategies in VS, it leads to another problem with outputting information as it trades. It took me forever to find that you have to use Output to write to the power language log, and this limits the logging to classes in the Powerlanguage namespace only. I often use classes written outside these, that rely on writing to the console. Is there any way to get the debug information in VS as you run the strategies, or can I somehow write this info to the log window inside MC?

A rather simple thing I had difficulties with is to get the information which pair and timeframe that the strategy is applied to. The methods I thought would provide this information returns blank strings, and in all examples I've viewed this has been specified manually with an input instead. What class/method shall be used to retrieve name of symbol and resolution?

A documentation with some examples and explanations of the methods would be appreciated, and I know it have been discussed previously.

Thanks for an otherwise great platform!

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

Re: Powerlanguage namespace and classes questions

Postby Henry MultiСharts » 09 Apr 2013

Functions are not available in the solution as these are read only and you can't use it debug strategies real time?
Hello SysInv,

You can't get inside a function while debugging from VS, but that does not mean that you cannot debug in realtime at all.
you have to use Output to write to the power language log, and this limits the logging to classes in the Powerlanguage namespace only. I often use classes written outside these, that rely on writing to the console. Is there any way to get the debug information in VS as you run the strategies, or can I somehow write this info to the log window inside MC?
You can get the information for debugging in VS, that is also possible to utilize the PLEditor Output tab from an external class. Check how OpenPositionManager class does that in this example.
What class/method shall be used to retrieve name of symbol and resolution?
1) Bars.Info.Name
2) Bars.Info.Resolution
/* For example, for ES 5 min chart, Resolution.ChartType = ChartType.Regular; Resolution.Type = EResolution.Minute; Resolution.Size = 5; */


Return to “MultiCharts .NET”