Adding Market Functions
- A market function can be any VTS function that accepts a symbol as a parameter and returns a positive number.
- The fnGetBestMarket function calls a market function for all selected symbols and returns the symbol with the highest score.
- Although a market function can be dragged and dropped onto a drawing, typically this is not done. Instead the market function is selected in Function section of the fnGetBestMarket function.
Any MQL function in VTS can be used as a market function. The function must have a single string parameter and return a double value.
To have the function appear in Function section of the fnGetBestMarket function, the function name is added to the marketfunction.lst file.
The marketfunction.lst file is a text file that lists all of the available market functions. It can be edited with any text editor, including NotePad.
The marketfunction.lst file is located at:
C:\Program Files (x86)\iExpertAdvisor\Visual Trader Studio Connect\cfg\list
The original contents of the marketfunction.lst file:
"fnGetVolatility"
"fnGetVolume"
"fnGetTrendUp"
"fnGetTrendDown"
"fnGetBreakOut"
To add a new function, enter the name of the function, in quotes, on a new line and save the file. For example:
"MyNewMqlFunction"