The External Widget example in MyTrader and some of the code in this guide assigns extra ad-hoc functions and properties into the
The example code prefaces such property and function names with $. This is absolutely not compulsory (and nor does it have any special meaning in Javascript). It is done for two reasons:
It makes it clear which functions are built into the
It avoids accidental collision with the names of built-in members, which would delete and replace them. For example, choosing to overwrite Framework.Instruments or Framework.SendOrder with your own data or function would be a problem. If you preface names with $ then the only possible overlap is with the framework's own $T() helper function.
As described in the introduction, all functions in the framework which generate asynchronous callbacks exist in two versions: a "standard" version with a callback function as a parameter, and a version which issues a Javascript Promise. This guide mainly describes the standard versions. If you want to use the Promise versions, then apply the following rules to the documentation below:
The Promise version of the function starts with
The callback is dropped from the function's parameter list (and replaced by returning a Promise). For example,
Any dialog function which returns both an initial update and a final result is modified in the Promise version so that it only returns the final dialog result.