{"id":21942826,"url":"https://github.com/react-declarative/brainjs-cryptocurrency-trend","last_synced_at":"2026-02-08T03:07:40.292Z","repository":{"id":155161860,"uuid":"629141572","full_name":"react-declarative/brainjs-cryptocurrency-trend","owner":"react-declarative","description":"Cryptocurrency ML price prediction. Ready for connection to any crypto exchange to trade with limit orders","archived":false,"fork":false,"pushed_at":"2024-05-30T10:31:15.000Z","size":19982,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-17T13:03:41.794Z","etag":null,"topics":["binance","binance-api","brainjs","convolutional-neural-networks","easy-to-use","gpt-3","kucoin","kucoin-api","lightweight-charts","ml","neural-network","react","realtime","recurrent-neural-networks","rxjs","trading","trading-bot","tradingview","websocket"],"latest_commit_sha":null,"homepage":"https://github.com/react-declarative","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-declarative.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-17T17:53:31.000Z","updated_at":"2025-01-04T10:35:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"724b91d1-dad9-4c55-ad75-a71b52d33a3a","html_url":"https://github.com/react-declarative/brainjs-cryptocurrency-trend","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fbrainjs-cryptocurrency-trend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fbrainjs-cryptocurrency-trend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fbrainjs-cryptocurrency-trend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-declarative%2Fbrainjs-cryptocurrency-trend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-declarative","download_url":"https://codeload.github.com/react-declarative/brainjs-cryptocurrency-trend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250300950,"owners_count":21408059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binance","binance-api","brainjs","convolutional-neural-networks","easy-to-use","gpt-3","kucoin","kucoin-api","lightweight-charts","ml","neural-network","react","realtime","recurrent-neural-networks","rxjs","trading","trading-bot","tradingview","websocket"],"created_at":"2024-11-29T03:26:42.446Z","updated_at":"2026-02-08T03:07:35.245Z","avatar_url":"https://github.com/react-declarative.png","language":"TypeScript","readme":"# brainjs-cryptocurrency-trend\n\n\u003e Cryptocurrency ML price prediction. Ready for connection to any crypto exchange to trade with limit orders\n\n![screencast](./docs/screencast.gif)\n\n## Contribute\n\n\u003e [!IMPORTANT]\n\u003e Made by using [react-declarative](https://github.com/react-declarative/react-declarative) to solve your problems. **⭐Star** and **💻Fork** It on github will be appreciated\n\n## Usage\n\n**1. Start this app**\n\n\u003e Build\n\n```bash\nsh ./scripts/build.sh\n```\n\n\u003e Run\n\n```bash\nnpx open-cli http://localhost:8080\nnpm run start:binance\n```\n\n**2. Configure the neural network. If you can't just press save button, default config is good enough**\n\n**3. Wait for whales patterns interception (will take around 10 minutes or more). Open Chrome Dev Tools for detailed log**\n\n**4. (Optional) Start Telegram informer (./packages/informer)**\n\n**5. Enjoy!**\n\n## How it is made\n\nThe bot is observing `HIGH` values on the `1M` candle chart of the crypto exchange. It is trying to collect market whale patterns to detect them and predict price change.\n\n![candlechart1](./docs/candlechart1.png)\n\nTo do that It listening the exchange `1M` candle websocket until It finds a spike or a space between two spikes. From the technical side it combines values by groups with 100 records (each message per 250ms) and [uses linear regression to compute slope](https://stackoverflow.com/questions/6195335/linear-regression-in-javascript).\n\n![candlechart2](./docs/candlechart2.png)\n\nThe sign of Slope variable means the trend: negative (`red rect`) if price is going downward or positive (`green rect`) if price is going forward. So when the bot see the pair of groups with trend `[-1, 1]` or `[1, -1]` it capture them and start training neural network\n\n![net](./docs/net.png)\n\nThe neural net takes only the last 10 prices from a market as an input and 2 values as an output. If the price rises, it  return `[1, 0]`. If the price will fall it return `[0, 1]`\n\n![stride](./docs/stride.png)\n\nTo use a group with 100 price records as a set for training I am using [stride tricks](https://developers.google.com/machine-learning/practica/image-classification/convolutional-neural-networks). That helps me emulate receiving last 10 values from a websocket just like in real time. But as I am already known the trend, the training of neural network is easy peasy (check `green`, `violet`, `yellow`, `green` rects)\n\n![bucks](./docs/bucks.png)\n\nFYN If you have your own DAU which owns more than `10 000$` for trading feel free to contact me, I got a lot of solutions of that kind for crypto currencies\n\nP.S. for binance use `wget -qO- http://ipecho.net/plain | xargs` command to check your ip.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-declarative%2Fbrainjs-cryptocurrency-trend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-declarative%2Fbrainjs-cryptocurrency-trend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-declarative%2Fbrainjs-cryptocurrency-trend/lists"}