Errors 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. Debug 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. Editor 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.
|