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

Need help about SRSI #4

Open
shamanaia opened this issue Nov 27, 2023 · 4 comments
Open

Need help about SRSI #4

shamanaia opened this issue Nov 27, 2023 · 4 comments

Comments

@shamanaia
Copy link

shamanaia commented Nov 27, 2023

Hi @sindelio, coding is my hobby and async arrow functions is new for me, I could't find any ansewer on MDN, even SOF :), so please can you excplain me line 95-111 in bot_public.js

I use it without yarn.

// Initializes the Ehlers filter (super smoother)
const initializeSmoother = async (SRSI) => {
	console.log('INITIALIZING SUPER SMOOTHER');
	filter[0] = c1 * (SRSI[1].stochRSI + SRSI[0].stochRSI);
	filter[1] = c1 * (SRSI[2].stochRSI + SRSI[1].stochRSI) + c2 * filter[0];
	filter[2] = c1 * (SRSI[3].stochRSI + SRSI[2].stochRSI) + c2 * filter[1] + c3 * filter[0];
	console.log('smoothedStochRSI: ', filter[2], '\n');
}

// Calculates next value for the Ehlers filter
const calculateSmoother = async (SRSI) => {
	console.log('CALCULATING SUPER SMOOTHER');
	let newValue = c1 * (SRSI[3].stochRSI + SRSI[2].stochRSI) + c2 * filter[2] + c3 * filter[1];
	filter.push(newValue);
	filter.shift();
	console.log('smoothedStochRSI: ', filter, '\n');
}

(SRSI) and SRSI[*].stochRSI

they are variables, function names or refference to some external node modules like line 90?

StochasticRSI.calculate(inputStochRSI)`

or something else. I can't realise there origin and nature.

As can see in console it's array:

srsi

Thanks in advance.

@sindelio
Copy link
Owner

sindelio commented Nov 27, 2023 via email

@shamanaia
Copy link
Author

Thanks for reply.
so, as I understand here ".stochRSI" is reference to "/node_modules/technicalindicators" and "SRSI" is parameter of async, but if SRSI is NOT declared yet, how it can own array ellement? SRSI[1]?
I will be grateful for your answer.

Thanks.

@sindelio
Copy link
Owner

sindelio commented Nov 27, 2023 via email

@shamanaia
Copy link
Author

Thanks and good luck!

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

2 participants