Click here to Login

How to create a custom trading indicator

Updated on 2011-10-19 04:55:48

Share |

In QuantShare, you can use CSharp or JScript.Net programming languages to create your own trading indicators. The custom indicator tool is very powerful and it allows you to create basic or complex indicators quickly. Once created, a custom indicator can be used in the QuantShare language.


- In the main menu, select "Tools" then "Create Functions"
- Click on "Add" (on the top of the new form)
- Type the indicator name (Example: MyIndicator) then click on "Save Item"
- In the Script panel, type your formula then click on "Save".

At any moment, you can use CONTROL+SPACE shortcut to display the list of available functions and variables.

Formula Example:
result = TA.Rsi(14) - TA.Rsi(7);

This will create a custom indicator that returns the difference between the 14-bar RSI and the 7-bar RSI.

The custom indicator returns the variable "result" and therefore you must assign the indicator result to this variable.

After you click on "Save" and make sure that there are no errors in the formula, follow the next steps:
- Close "Create Functions" form.
- Select a chart and create a new pane
- Click on "Add Indicator" icon in the new pane (first icon at the top)
- Select "All Indicators" tab then type your indicator name in the "Search" box
- Select your indicator then click on "OK".

Your indicator is now displayed on the chart.

To see how it was used in the pane's formula:
- Right click on that pane
- Select "Edit formula"

a = MyIndicator();
Plot(a, "MyIndicator", colorBlack, chartLine, StyleSymbolNone);

The custom trading indicator was referenced in QuantShare language by calling the function: MyIndicator().

no reviews (Log in)

Other how-to articles

How to create a custom trendline

How to create trading rules based on Put and Call volume data

How to add a trading indicator to a chart

How to create a moving average of an indicator

How to optimize an indicator in your trading system

How to create a trading system

How to add custom position-based metrics to your trading system

How to hide a trading indicator from a particular time frame

How to create histogram charts

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.