trading-indicator icon indicating copy to clipboard operation
trading-indicator copied to clipboard

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

Open orblgc opened this issue 11 months ago • 0 comments

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')

orblgc avatar Mar 02 '24 16:03 orblgc