Skip to content

Instantly share code, notes, and snippets.

@sivaraj-v
Created May 28, 2019 12:54
Show Gist options
  • Save sivaraj-v/35de752bbd91fe373d69cb6174069906 to your computer and use it in GitHub Desktop.
Save sivaraj-v/35de752bbd91fe373d69cb6174069906 to your computer and use it in GitHub Desktop.
Supertrend
const SampleData = require('SampleData);
const { Indicator } = require('../../study/index');
const { Supertrend } = require('../../study/Supertrend');
const newStudySuperTrend = new Indicator(new Supertrend());
const calculateSupertrend = newStudySuperTrend.calculate(ATR_DATA, { period: 7, multiplier: 3 });
console.log(calculateSupertrend);
Output:
[
Direction: 1,
Up: 651.0916850531078,
Down: 706.9636508963451,
ActiveTrend: 651.0916850531078
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment