Passing Variables into trade results visualizers
Author: sf631
Creation Date: 4/13/2010 10:44 PM
profile picture

sf631

#1
Have two questions about how to control what values get passed into the "Trades" and "By Symbol" visualizer tabs.

The first question is how TO pass a variable. I have a strategy that chooses trades based on one overall "composite" score (all parameters I'm considering factor into an overall number which is used to pick trades). How can I get this value to appear on the Trades tab and any other visualizers where possible?

Second, I have some strategies that have the opposite problem - they pass way too many useless variables into the "By Symbol" visualizer. The problem appears to come from a line of code that creates a DataSeries from two other dataseries, such as this:
CODE:
Please log in to see this code.


which creates hundreds of useless variables in the by symbol output like this:

http://www.freeimagehosting.net/image.php?03adc67f72.png

It slows down the refresh rate of the page to the point where it's virtually useless and makes me concerned about the app hanging.

Interesting this behavior doesn't exist when I instantiate the dataseries, and then use a for loop to populate it bar by bar, but that's more cumbersome code.

My main need at this point is the first problem, but the second has always puzzled me
profile picture

Eugene

#2
QUOTE:
How can I get this value to appear on the Trades tab and any other visualizers where possible?

1. With the built-in Trades visualizer: save the composite value to a Position's EntrySignal (or EntrySignal) property. If that's unacceptable (i.e. signal name at use), see p.2 or p.3.
2. Using the Trades+ tab from Community.Visualizers: save the value to a Position's Priority property.
3. In your custom visualizer, you can use the Position.Tag property. You can modify the open source code of the Trades+ tab to add a new column; here's how - Write to Trades Performance Visualizer
QUOTE:
they pass way too many useless variables into the "By Symbol" visualizer.

1. These are not "useless variables", it's the Bars.Cache mechanism at work (QuickRef for more). It is impossible to change/affect the way it works.
2. The line of code is not responsible for what you see. These columns reflect the components of the "PD" data series, and not the SMA.
QUOTE:
Interesting this behavior doesn't exist when I instantiate the dataseries, and then use a for loop to populate it bar by bar, but that's more cumbersome code.

This is expected. In this case, there's no need to cache every interim data series - a component of the PD series.
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).