Variable Basic Questions

Login or Register

Please login or register in order to view and post in the Forum.

3 posts / 0 new
Last post
Daniel Diemer
Last seen: 2 years 1 month ago
Joined: 05/26/2020 - 13:05
Variable Basic Questions

I have a few questions as I dive deeper into charts.

1. What is the difference between a C variable and a V variable? Are there certain times when you should use one over the other?
2. Are variables local to chart by default, and only made global by the scope dropdown, or how to control this?
3. Is there an easy way to see what variables have assigned values on a given chart, or perhaps on a global scale? I couldn't see anything in object manager or indicators. It didn't look like the info box could be used this way.

I looked in docs and searched the forums and couldn't find what I'm looking for, I apologize if I missed these being answered already.

Thanks a bunch.

0
william-linn
Last seen: 17 hours 36 min ago
Joined: 06/03/2011 - 00:00
User Variables, an Overview

There are 3 kinds of user variables in Investor/RT, V# variables, C# variables, and T# variables.

V# and C# variables are numeric. T# variables are textual variables.

V#, C#, and T# variables can be set in various ways using RTL or by editing a cell in quotepage for example. Some indicators are programmed to store a series of numeric values into one or more adjacent V# or C# variables.

V# and T# variables are per symbol. V#1 for symbol X can have value A while V#1 for symbol Y can have value B. You may have many charts open on symbol X, each of them, for example, drawing a reference line at value V#1. Thus the value of V#1 is known across many charts that contain the same symbol.

C# variables are per chart. The value of C#1 in Chart A is known only inside Chart A.

V#1...V#512 are supported. All values are persistent on the database when you exit and start up again later.

C#1...C#128 are supported in RT 14. C#1...C#60 are persistent on the database while C#61...C#128 are temporary variables that begin with value 0.0 when you open the chart and can be set to other values while the chart is open. C# variables are independent of the symbol in the chart. If you are charting symbol X in a chart and C#7 has value 3.14, changing the symbol from X to Y in that chart has no effect on C#7. In contrast, V#7 can change value in the context of a chart when you change symbols because V# variable are symbol specific.

T#1...T#64 are supported in RT 14. Each T# can contain a string of text, e.g. a label of some kind, up to 29 characters in length. T#1...T#32 are persistent, per symbol, on the database. T#33...T#64 are for temporary usage, they have no textual content each time Investor/RT starts up; once set, the value is retained until Investor/RT exits.

If you reference a user variable inside RTL, e.g. V#33 the value is obtained from the symbol upon which the RTL formula is being calculated. If you have a chart of symbol X and some RTL signal or custom indicator in the chart that refers to V#33, the V#33 of symbol X is implied. If you want the RTL to refer to the value of V#33 from some other symbol other than the implied meaning, you can add the symbol is parentheses, e.g. V#33(ESM0) directly refers to ESM0's user variable 33 regardless of which symbol happens to be the implied symbol for that RTL expression.

The values of V# variables can be displayed in quotepages as column's. You can add annotation indicator(s) to a chart that display user variable values is you wish, e.g. the text "C#17=%C#17" in the annotation setup will produce text on the chart reading "C#17=3.14159" for example. Even the button title of a button that sets a particular C# variable can be specified using the % notation so that button title display the current value at all times.

RT 14 has a nice feature in the right-click menu (Show > Chart Variable Report) to review the values of all of the C# variables set in the particular chart.

Most indicators enable certain numeric parameters to be specified via a V# or a C# variable, e.g. the period of a moving average. Chart buttons can be used to make setting of V# or C# value easy with a click of the mouse. See button purposes “Set V# Variable” and “Set C# Variable”.

V# variables can be assigned a title and display format to help you keep track of their meaning. See File > Preferences > User Variables. This preference panel also has a button titled Usage Report you can click to produce a report the usage of V# and C# variables in the charts that are open at the time.

Daniel Diemer
Last seen: 2 years 1 month ago
Joined: 05/26/2020 - 13:05
Re User Variables, an Overview

This is perfect and exactly what I needed.

Thanks for all the details! Looks like you really set this system up thinking of everything to help programmers and non programmers alike.