Click here to Login

Adding Trading Indicators and Formulas to a Chart

Updated on 2011-01-11

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.

no comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1298 days ago

Profile Graphs
Posted 1403 days ago

Previous Posts

QS Trading Software: Global Script
Posted 4989 days ago

More Posts


Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.