Articles
Variable - Data Type Description
Variable - Variable is a symbolic name given to some known or unknown quantity or information, for the purpose of allowing the name to be used independently of the information it represents. Each variable must have an unique name, value and Data Type. As you can see in the image, when adding the variable you need to define at least two fields: Name and Type. The variable can also have Start value and Description. Description is used only for user info; it doesn't have any other functionality. Also the user can define the group where will be and Global parameter - which can be false or true. If Global is true - this makes this variable visible as a parameter of the strategy, when it's launched.
The name for variable should be defined by Java Name Conventions:
Every programming language has its own set of rules and conventions for the kinds of names that you're allowed to use, and the Java programming language is no different. The rules and conventions for naming your variables can be summarized as follows:
$
", or the underscore character "_
". The convention, however, is to always begin your variable names with a letter, not "$
" or "_
". Additionally, the dollar sign character, by convention, is never used at all. You may find some situations where auto-generated names will contain the dollar sign, but your variable names should always avoid using it. A similar convention exists for the underscore character; while it's technically legal to begin your variable's name with "_
", this practice is discouraged. White space is not permitted.cadence
, speed
, and gear
, for example, are much more intuitive than abbreviated versions, such as s
, c
, and g
. Also keep in mind that the name you choose must not be a keyword or reserved word.gearRatio
and currentGear
are prime examples of this convention. If your variable stores a constant value, such as static final int NUM_GEARS = 6
, the convention changes slightly, capitalizing every letter and separating subsequent words with the underscore character. By convention, the underscore character is never used elsewhere.