thanhnguyennguyen / trading-indicator

provide trading technical indicator values based on data of almost crypto currency exchanges
https://www.npmjs.com/package/trading-indicator
238 stars 53 forks source link

Proper Example of Driver Code to Run the trading-indicator Project #58

Open JayCax opened 10 months ago

JayCax commented 10 months ago

Hello and thanks for your contribution,

My bad if this is a noobie question since I am rather new to JS. I am wondering what is the proper way to setup extremely basic driver code in order to call the indicators and run the project.

I have simply created an app.js in the root directory and tried to run the RSI indicator snippet, as an example:

Screen Shot 2023-11-06 at 16 26 48

However, I get this issue / error:

SyntaxError: await is only valid in async functions and the top level bodies of modules

Something that may be a contributing issue to the above one, I tried to npm start this project and the run stops at:

"example to fetch data from binance"

Which is line 7 on package.json.

Thanks for any insight, thanks for this contribution, and best regards.

sidewapboss commented 1 month ago

First you need to have both input and your console.log inside an async function, then you'll migrate to the next issue of "Ticker is not supported" Would be back when I am able to resolve it