Using Comments in the PCF Editor

The PCF editor supports comments. It also has special Description <desc> and Tag <tag> comments that can be used in tooltips.

 

Function Description

New functions will come with the function description comment pre-loaded at the top of the function, this comment type is preceded by three forward slashes "///"

You can also auto-populate these tags by pressing the forward slash key 3 times "///" at the top of a blank editor window

Simply type your function description between the description opener <desc> and description closer </desc>, in this example we have created a function called DescriptionExample and inserted a place holder formula

The description for that function will now show in the tool-tip for that function

Function descriptions must be preceded by three forward slashes, be placed at the top of the function, and be enclosed by and opening and closing description tags

Parameter Description

When you add a parameter it will automatically include description tags, parameter descriptions are placed to the right of the parameter and are preceded by three forward slashes "///"

Simply type your description between the description opener <desc> and description closer </desc> tags, in this example we have created a parameter called span and used it in a formula to find the maximum close value of the last N bars, N is defined by the Span parameter. The parameter description is now included in the tool-tip for that parameter

Parameter descriptions will also show when used in functions, here we have saved that same formula "MAXC#Span" as a function titled #MaxClose. When we call the function and open a parentheses to assign a value to the #Span parameter the description is shown in the tool tip

Parameter descriptions must be placed directly to the right of a parameter, be preceded by three forward slashes "///" and be enclosed in opening and closing description tags

Function Tags

New functions will come with the function tag comment pre-loaded at the top of the function, this comment type is preceded by three forward slashes "///"

Tags allow you to add additional search terms for functions when searching for them in the library, you can add multiple tags if you like just be sure to surround them with <tag> and </tag>in this example we have added the tags; Tango, Alpha, Golf and saved the function

Here we have entered the word Tango into the search field and it returns our TagExample function

All tags associated with a function are shown to the right of the function title in gray text.

Comments

Comments can be added to any line in the PCF editor, they are started by typing in two forward slashes "//" followed by your comment text, commented text is excluded from formula calculations

Anything on the same line and to the right of the two forward slashes is commented out, comments only apply to the same line so in order to start a second line of comments you would have to begin the second line with two forward slashes.