In QuantShare, there are several ways to add trading indicators in a chart. You can do this programmatically, by dragging & dropping or double clicking on an indicator in the formulas/indicators form (This form can be opened by selecting View then Indicators) or by clicking on the "Plus" icon located in the top-left corner of the chart (Add a Function). In this post, we will explain the difference between the "Add a Function" and "Formulas/Indicators" forms. Add a Function The "Add a Function" form contains a list of all trading indicators available in QuantShare. The list also contains indicators that that have been downloaded from the sharing server. All these indicators are implemented using the .Net language and can be referenced or invoked in the QuantShare vector-based language (Please read the QuantShare Lessons for more information). This means that the Average True Range indicator for example is simply a function coded in C# and it can be used as a trading rule or can be displayed on a chart by invoking it with the appropriate parameters. Example: a = Atr(14); The "Add a Function" control creates a QuantShare formula that displays a graph of the trading indicator you have chosen by using the "Plot" function. The formula is then added to the active pane/chart and it can be updated later by right clicking on the pane then selecting "Edit Formula". It can also be updated by clicking on the third icon on the top-left corner of the pane. Here is the formula that is created when you select the Average True Range indicator with a period of 14 bars: a = Atr(14); Plot(a, "Atr", colorBlack, chartLine, StyleSymbolNone); Formulas/Indicators List When you select View then Formulas/Indicators, a list of indicators is displayed. These indicators are QuantShare formulas that may contain one or several indicators and plot one or several lines, bars or candlestick bars. These formulas correspond to files located under the QuantShare folder and then under the "Formulas" directory. The Category list contains the sub-directories and the indicators list contains the files/formulas that are located under these sub-directories. For example, you can create a new formula by right clicking on the formulas list grid and then selecting "New Formula". You can then type "ATR" as the formula name and type the next formula: a = Atr(14); Plot(a, "Atr", colorBlack, chartLine, StyleSymbolNone); b = Atr(7); Plot(b, "Atr", colorRed, chartLine, StyleSymbolNone); After that, click on "Save Formula". Your formula will now display two lines, the first corresponds to the 14-Bar ATR and the second to the 7-Bar ATR.
|