cinar / indicatorts

IndicatorTS - Stock technical indicators and strategies in TypeScript for browser and server programs.
MIT License
296 stars 53 forks source link

Edit an indicator! #311

Open amiralii opened 1 year ago

amiralii commented 1 year ago

Hello! I wanted to know how to edit an indicator? For example, I want to rewrite the Aroon indicator with the ability to change the period (it is fixed at 25), please help me if possible (I am a beginner in NodeJS).

cinar commented 1 year ago

Hi! Sure, please take a look at the following indicator:

https://github.com/cinar/indicatorts/blob/main/src/indicator/trend/communityChannelIndex.ts

There I have defined a defaultXXXXIndicator function that uses the default period, and the actual indicator accepts the period.

If you change the Aroon indicator the same way, please send over a PR and I'll merge it.