BySymbol Visualizer sample code
Author: BryanStanton
Creation Date: 8/20/2012 2:37 AM
profile picture

BryanStanton

#1
I would like a customised version of the built-in BySymbol Visualizer tab. I've downloaded, investigated, and been modifying the MS123.demo visualizer, and considered using ByTrades+, but I didn't see an example of BySymbol. I tried to find a BySymbol example that I could modify, but without success. Is there some sample code available for this purpose? If not, do you have any suggestions, eg. is using the ByTrades+ code the best place to start, and change it to behave like the BySymbol tab? Thanks.
profile picture

Eugene

#2
By Symbol is a built-in visualizer, part of the product, created by Fidelity and therefore closed source (alas).

The general idea goes like this: check that SystemPerformance.Bars.Count is not empty, and then loop by each Bars object in the returned Bars collection that represent all Bars of the DataSet the Strategy was executed upon:

CODE:
Please log in to see this code.
profile picture

BryanStanton

#3
Thanks Eugene. That has clarified things a lot.

For further clarification, is this the most efficient way to collect and calculate performance data? In CreateVisualization method, for each symbol in the Dataset processed by the Strategy, loop through Positions in the SystemResults looking for positions for the current symbol collecting the relevant performance data, then calculate all performance metrics.

CODE:
Please log in to see this code.
profile picture

Eugene

#4
Yes Bryan, you're moving in the right direction.
profile picture

BryanStanton

#5
Thanks for your help.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).