|
Basic Indicators |
Top Previous Next |
|
To create a Basic Indicator, select "Indicators" on the left and click the "New" button. This will bring up the new indicator dialog:
Name for Code This is the name which will be used to access the indicator in a script. In this case we named our indicator averageClose. We can use this like a variable in our scripts, with or without indexing. You can use any name here that complies with the rules for creating variables.
Using the indicator name without indexing refers to the most recent available data, today. Example:
IF averageClose > averageClose[1] THEN
OR
IF instrument.averageClose > instrument.averageClose[1] THEN
Type There are many built-in indicators listed below. Each of these may require Parameter values, so set these up first if applicable.
Value The Value is the basis for the computation of the Indicator. The choices are:
For example, a "Simple Moving Average" indicator that used a value of "High" would be a simple moving average of the instrument's high.
Time Frame Reserved for future use.
Parameters Most types of indicators require numeric constants for their computation. For instance, the MACD indicator requires the days for the long and short moving averages. You can select from a list of Parameters that you have created, or you can choose "Enter Value" and enter a constant value in the box to the right.
For many indicators, there is a final option called "Smoothing." This option will smooth the indicator by the bars indicated, using the EMA formula. If you enter 1 for the number of bars to smooth, there will be no smoothing.
Example: To create an RSI indicator with a smoothed signal RSI line, create two indicators, one with smoothing, and one without.
Scope Set the scope based on what blocks and scripts need access to this indicator. If you set to Block scope (default) only the scripts in the block will have access. If you set to System scope, then all scripts in all block in the system will have access. When System Scoped, for other blox to access this indicator an IPV Series variable must be declared in the other blox with the Defined Externally in another Block checked. This will tell the parser that the variable is defined elsewhere.
Plots on Trade Graph Check to have the indicator plotted on the trade chart. When you plot an indicator on the trade graph, you can select the Display Name, the Color, and whether the indicator should be offset by one day.
Displays on Trade Graph Check to have the indicators value displayed in the right panel of the trade chart, as the cross hairs are moved by the mouse or cursor. By clicking on the indicator name on the trade chart, plotting can be dynamically enabled or disabled. The indicator can also be removed from the chart.
Offset Plot by One Day This option shifts the indicator ahead one day. This is useful when your indicator is used for stop or limit orders, and you want the indicator to visually cross the bar as an indication your order was hit. This is only a visual change on the graph, and does not change the calculations or results.
Graph Area The text in this field will determine where the indicator is plotted. If you select "Price Chart" the value will be plotted on the price chart area. If you select any other text value, it will create a new chart and put the indicator there. You can have multiple indicators on the same chart area.
Graph Style Select a graph style for the plot.
Notes on Priming The maximum amount of bars required to prime this indicator plus one will be added to overall priming. If the indicator is a 10 day moving average, then the first day scripts will run is day 11. Overall priming is the maximum bars required for indicators plus one, plus the maximum lookback parameter plus one.
|