Signal
Persistent storage of [symbol->key,value] pairs that can be used for maintaining a state across all functions/tasks. This interface allows storing and querying of key/value pairs of data for each symbol. The current value of a signal will be displayed next to the UI chart. Each signal value has a timestamp assocaited with it. The timestamp of a signal will only change if a value has changed, so in effect, the timestamp represents the date and time when a current value of a signal was last set.
Parameters#
| Parameter | Type | Description |
|---|---|---|
| symbol | String | the symbol of the ticker in the grid |
| name | String | the name of the signal, it will be used to retrieve its value |
| value | Variant | a value of the signal, can be string, a number, or a boolean |
| color | String | OPTIONAL. Applies to 'visual' signals only such as .Line. Must be a full HTML color value, i.e. '#FFFF00' |
| type | Number | OPTIONAL. Applies to .Line() only. A bit of an experimental feature. Supported values so far are 1 or 2, and they determine the placement of the label. |
Signal.set#
Creates a signal (key/value pair) for a given symbol. If a name already exists, its value will be updated.
- JavaScript
- Python
Signal.get#
Retrieve the value of a signal (state) for a given symbol.
- JavaScript
- Python
Signal.clear#
Clears a signal (state) for a given symbol.
- JavaScript
- Python
Signal.ageOf#
Returns an age of a modified signal: how long ago a value was changed (in milliseconds).
Important note: the age of a signal is not when Signal.set() was called last, but when a value was MODIFIED last with a call to Signal.set(). Multiple calls to Signal.set() with the same value will not result in change .ageOf() value.
- JavaScript
- Python
Signal.line#
Creates or updates a horizontal markup line (typically indicating a price level). It is one of the few signals with a visual component.

- JavaScript
- Python
Signal.all#
Returns an array of all signals currently set for a specified symbol.