Skip to content

Script Engine: Access to financial functions/Indicators #985

@AwooOOoo

Description

@AwooOOoo

Is your feature request related to a problem? Please describe.
Expose interface to the financial functions/Indicators that are available in the chart window.

Describe the solution you'd like
There are a lot of great functions/indicators drop-down in the chart window that I don't want to have to reinvent to build trading algorithms around so it would be good if there was a way to take advantage of them via the scripting interface. Perhaps we can expose a bunch of function handles you could call with their associated parameters.

First expose an indicators object;

{
  accumulationDistribution: <function object>,
  advanceDeclineLine: <function object>,
  advanceDeclineRatio: <function object>,
  ...
  ...
}

Each function would take 1 'parameters' object which contains all of the parameters for that function. The description of the parameters for each function would be described in documentation.

Documentation

Bollinger Bands Indicator:

A Bollinger Band® is a technical analysis tool defined by a set of trendlines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of a security's price, but which can be adjusted to user preferences.
Reference: [https://www.investopedia.com/terms/a/accumulationdistribution.asp]

Input Parameters:
The bollinger bands indicator takes the following parameters as inputs.

{
  resolution: 'SAME_AS_SYMBOL',
  length: 20,
  source: 'close',
  stdDev: 2,
  offset: '0.0'
}

Output:
The bollinger bans indicator returns the following structure.

{
  upperBandValue: '0.5714',
  lowerBandValue: '0.5523'
}

Calling:

var bb = indicators.bollingerBands; // grabs the function handle
 
var result = bb({resolution: 'SAME_AS_SYMBOL', length: 20, source: 'close', stdDev: 2, offset: '0.0'});

The indicator would have access to all of the historic data so that the indicator provides a valid response for the specific inputs.

Describe alternatives you've considered
It may be better to create an instance of the indicator and provide a callback so it is persistent as opposed to essentially creating it with each call which would likely use a lot more resources

Additional context
Script Access to all of these =D
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions