GetGlobal from Visualizer
Author: abegy
Creation Date: 4/25/2020 11:38 AM
profile picture

abegy

#1
Hi Eugene,

I would like to create a custom Visualizer. In this Visualizer, I would like to get value which has been setup in the strategy script with SETGLOBAL instruction.

Is it possible to do that ? If yes, can you give me a code example that I need to put in the Visualizer source ?

Thanks for your help :-)
profile picture

Eugene

#2
Hi Alexandre,

This is not supported and I believe, not required. You can use Bars.Tag and Position.Tag to pass values to your performance visualizer.
profile picture

abegy

#3
Thanks you Eugene. I asked this question because I looked to manipulate Alert and I see that there is no Tag property.
Do you see another way to pass data for an alert to the Visualizer (without using a temporary file or SignalName) ?

profile picture

Eugene

#4
As the Position.Tag won't work for Alerts because the currentPos is null, you can resort to the Bars.Tag property of the Alert object. Each Alert has a Bars object linked with it.
profile picture

superticker

#5
QUOTE:
As the Position.Tag won't work for Alerts because the currentPos is null,...
That may be true for a Buy Alert, but I would hope a Sell Alert would point to the "existing" Position object (and its .Tag).
profile picture

Eugene

#6
QUOTE:
I would hope a Sell Alert would point to the "existing" Position object (and its .Tag).

I was mainly talking with PosSizers is mind (which do not size existing Positions). For visualizers, of course the SystemPerformance.Results.Alerts property contains the list of Alert objects with the Position object assigned in case of exit alerts. To sum up:

1. For entry alerts in a visualizer, use the Bars.Tag property which is accessible either with SystemPerformance.Bars collection or SystemPerformance.Results.Alerts
2. For exit alerts, use the SystemPerformance.Results.Alerts.Positions[i].Tag property.
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).