Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Engine: Access to financial functions/Indicators #985

Open
AwooOOoo opened this issue Aug 16, 2020 · 9 comments
Open

Script Engine: Access to financial functions/Indicators #985

AwooOOoo opened this issue Aug 16, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@AwooOOoo
Copy link
Contributor

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

@AwooOOoo AwooOOoo added the enhancement New feature or request label Aug 16, 2020
@badgerwithagun
Copy link
Member

@all-contributors add @AwooOOoo for feature requests

@allcontributors
Copy link
Contributor

@badgerwithagun

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

@badgerwithagun
Copy link
Member

@all-contributors add @AwooOOoo for ideas

@allcontributors
Copy link
Contributor

@badgerwithagun

I've put up a pull request to add @AwooOOoo! 🎉

@AwooOOoo
Copy link
Contributor Author

@badgerwithagun,
Thanks for the add's. I wasn't familiar with the whole emoji / contributor thing and that getting added to channels could be automated. I'll try and remember that for future posts.

@badgerwithagun
Copy link
Member

No need to do anything! I just add people when they make contributions.

@AwooOOoo
Copy link
Contributor Author

Currently working on integrating https://github.com/ta4j/ta4j so we have programmatic access to indicators etc.

Any objections to this package or do you have any other preferences?

@badgerwithagun
Copy link
Member

I believe there's already an issue open (a very early one) covering this.

@badgerwithagun
Copy link
Member

No objections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants