Click here to Login

Working with the formula editor

Updated on 2009-07-06


Every time you have an error in your code, there is an icon that is there specially to keep track of the correctness of your code.
This icon will turn red if the application cannot compile your code.
It is blue if your code is correct.
In case something is wrong, a red line will be displayed below the part of the code where the error occurred.


To debug your code, just right click on the text editor. A tab will show up, select the 'debug mode' tab.
The application will display a grid with some columns. The number of columns depends on your formula.
If you haven't typed anything yet, then there will be 2 visible columns and 5 hidden columns.
The 2 visible columns are: Bar and Close.
'Bar' contains the bar index while 'Close' contains the security close price for the corresponding bar.
If you type in your formula something like: 'a = rsi(14);', then a third visible column will appear, it will contain the values of the 'a' vector.


To add indicators and functions in your formula, you just need to type them.
If you want to create the relative strength index indicator of the close price, just type 'a = rsi(14);'
But someone needs to know that an 'rsi' function exists and that it accepts one parameter '14'.
What if you are a newbie? Or didn't know about the existence of such a function?

I will present you some tips to help you write your formulas quickly and easily.

First tip: Just above the formula control, there are two buttons 'Add Void' and 'Add function'.
Clicking on 'Add function' will display a small control. All functions that return value are displayed in this control.
You can perform a search among those functions or/and select a specific category.
After you select an indicator or a function, the right part of the control will show you the indicator or function name, description and the parameters that this item requires in order to execute properly.
In case of rsi or relative strength index, we can see that there are two instances and that each one accepts a different set of parameters.
In the grid where these parameters are displayed, click on the icons to display additional information and the types of elements this parameter accepts.

Second tip: While typing your formula, press on CONTROL and SPACE to display the list of available functions at the location of the cursor.
Example: at the beginning of the code CONTROL+SPACE will display 'void functions'.
After the text, 'a = ', CONTROL+SPACE will display others functions and the indicators.
Inside a function, CONTROL+SPACE will display the elements that the parameter accepts.

Third tip: The third and last tip deals with the function parameters, just type a function, example: 'rsi'.
As soon as you type the left bracket '(', a tooltip will appears.
In case of the 'rsi' function you should see '1 of 2', just click on the arrows to move from a parameter set to another.
For each parameter set, you will see how many parameters the function accepts, what kind of parameters and the description of each one.

no comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1227 days ago

Profile Graphs
Posted 1332 days ago

Previous Posts

Working with the formula editor
Posted 5395 days ago

Optimization of trading rules
Posted 5406 days ago

Volatility and trading systems
Posted 5408 days ago

Trading Optimization
Posted 5409 days ago

Same chart, different symbols
Posted 5416 days ago

Composite Indicators
Posted 5419 days ago

Example of advanced rule
Posted 5421 days ago

Beta release
Posted 5423 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.