Namespace: Scripting

CIQ. Scripting

Namespace for functionality related to study scripting.

Only available if subscribing to the scriptIQ module.

Namespaces

Builtins
Descriptors
Scripts

Methods


addCoffeeScriptStudyToLibrary(script)

Adds an unprocessed script to the studyLibrary. The study can then be created like any other one on the chart by simply calling CIQ.Studies.addStudy.

Parameters:
Name Type Description
script string

Source code for the script in CoffeeScript, as provided by end user

Since:
  • 6.2.0
Returns:

An object containing {ast, javaScript, studyScript, sd} or error. See CIQ.Scripting.processJavaScript

Type
object

addStudyToLibrary(script, sd)

Adds a processed script to the studyLibrary. The study can then be created like any other one on the chart by simply calling CIQ.Studies.addStudy.

Parameters:
Name Type Description
script string

Source code for the script in javaScript, as returned by CIQ.Scripting.processCoffee

sd studyDescriptor

The study descriptor generated by CIQ.Scripting.processCoffee. This will replace any existing studies in the library with the same name.


processCoffee(source)

Processes a coffee script for custom scripting. The coffee script is converted to javaScript and then CIQ.Scripting.processJavaScript is called to create the study.

You can then use CIQ.Scripting.addStudyToLibrary with the returned SD and script to finalize the process.

Parameters:
Name Type Description
source string

Coffee script source code

Returns:

An object containing {ast, javaScript, studyScript, sd} or error. See CIQ.Scripting.processJavaScript

Type
object

processJavaScript(source)

Processes javaScript source to create a custom study descriptor

** This method is internal to CIQ.Scripting.processCoffee and should not be called directly.

Parameters:
Name Type Description
source string

JavaScript source code for the study.

Returns:

Returns a script descriptor which can be stored or passed to CIQ.Scripting.addStudyToLibrary ast: an ast object (JSON format), studyScript: the transformed study, sd: a study descriptor which can be used to add this study to the studyLibrary error will be set if an error occurs.

Type
object