This is a simple example of a trading bot programmed in js. As trading platform gemeni sandbox is used. You can find the api documentation on "https://docs.gemini.com/rest-api/" For price ticker and inidcators "CryptoCompare" is used ("https://min-api.cryptocompare.com/").
Many thanks to Ivan and Filip for the great course "Ethereum Game Programming" in your academy on "https://academy.ivanontech.com/"
-
Install node.js
-
Install yarn package manager
npm install yarn -g
-
Install node.js modules
- Gemeni API "https://github.com/mjesuele/gemini-api-node":
yarn add gemini-api
- CryptoCompare API "https://github.com/exodusmovement/cryptocompare"
yarn add cryptocompare yarn add node-fetch
You habe to sign up on Gemeni and Crypto Compare and create API Keys. echange.js and indicators.js access constants in .keys.js to retrieve the keys. So I have stored the API keys in the .keys.js. As an example see in example.keys.js
-
Open the Power Shell or another terminal in the project folder
-
Run index.js with node.js
node .\index.js