How to dynamically update the settings of an indicator
Updated on 2012-05-18 04:38:58
|
Let us start by adding an indicator. Here is how:
How to add a trading indicator to a chart
After adding the simple moving average (SMA) indicator, QuantShare will create a formula and add it to your chart's pane.
You can update the period of SMA by updating the formula directly:
- Right click on the chart's pane
- Select "Edit Formula"
- Use "Left/Right icons" to select the "Simple Moving Average" formula (A pane contains one or several formulas)
- Update the formula
Example:
a = sma(50); // Period set to 50 bars
plot(a, "sma", colorred, chartline, stylesymbolnone);
Alternatively, you can update the period dynamically by following the next steps:
- Click on the third icon at the top of the chart's pane
- Select "Simple Moving Average"
- Update the value next to "timePeriod" (Use the slider or type a value directly in the input box)
Notice how the moving average is automatically updated each time you change that "timePeriod" value.

Nb: To specify high values (above slider max), type the number directly in the input box then hit ENTER.
|