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

sma.js & ema.js vwap function usage & wrong variable definition #61

Open
orblgc opened this issue Mar 2, 2024 · 0 comments
Open

sma.js & ema.js vwap function usage & wrong variable definition #61

orblgc opened this issue Mar 2, 2024 · 0 comments

Comments

@orblgc
Copy link

orblgc commented Mar 2, 2024

const vwapCrossSMA = async (period, input) => { let vwap = await vwap(input) let maVal = await sma(parseInt(period), 'close', input), price = vwapval.slice(-2), up = crossover(price, maVal), down = crossunder(price, maVal) return { cross: up || down, direction: up ? 'up' : down ? 'down' : 'none', } }

let vwap usage is preventing vwap function to call. That's why it is causing error. After i change the let vwap variable as let vwapVal it is worked. sma.js & ema.js have the same error and needs to be updated.

You can see the files here.
image

For ema.js this line is also missing.
const { vwap } = require('../indicators/vwap.js')

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

No branches or pull requests

1 participant