JavaScript and Indicore SDK

From FxCodeBaseWiki
Jump to: navigation, search

JavaScript support in Indicore SDK

Starting from release 3.1, Indicore SDK allows writing indicators and strategies using JavaScript. The same will be available for FX Trading Station starting from version 2015-R2.

Indicore SDK provides JavaScript and Lua with almost equal means for writing indicators and strategies.

To learn how to write an indicator in JavaScript, see My first simple indicator in JS.
To learn how to write a strategy in JavaScript, see My first simple strategy in JS


JavaScript support was added to lighten development of indicators and strategies for those who already know JavaScript or find it easier to learn.

Despite Indicore SDK now officially supporting JavaScript, Lua is still the recommended language. Indicators and strategies working on Lua will have better performance than those working on JavaScript. Moreover, Integrated Lua EditorDebugger in Indicore 3.1 does not support JavaScript. Development requires using 3rd party editors and checking indicators in the Trading Station. Still, there are plans to add limited JavaScript support to Integrated Lua EditorDebugger to create, edit and backtest JavaScript indicators and strategies. There are no plans to add means for debugging indicators and strategies though.

Indicore SDK includes several examples of indicators and strategies written in JavaScript. These examples are similar to appropriate Lua indicators and strategies and may be used as templates for creating own ones. JavaScript indicators and strategies have JSL extension.

Please note that by default Trading Station has JavaScript support disabled. To enable, on Marketscope options, find tab Extension Permissions and select check box Allow JavaScript (restart required). Then restart the Trading Station. After that you will be able to install and use JavaScript indicators and strategies as usual.

Differences between Lua and JavaScript APIs

Indicore JavaScript API does not support the following features:


The list of differences
Lua JavaScript
http_loader HttpLoader
win32 Win32
expat_lua ExpatLua
math Math
mathex MathEx
string String
db Db
#arr length(arr)