{"id":22609095,"url":"https://github.com/bitfinexcom/bfx-hf-strategy-exec","last_synced_at":"2025-08-04T04:38:57.430Z","repository":{"id":38082386,"uuid":"206343359","full_name":"bitfinexcom/bfx-hf-strategy-exec","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-16T12:15:45.000Z","size":57,"stargazers_count":3,"open_issues_count":8,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-28T17:10:22.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2019-09-04T14:48:41.000Z","updated_at":"2021-12-09T13:59:35.000Z","dependencies_parsed_at":"2023-10-11T15:45:34.230Z","dependency_job_id":"5299cad0-8eb3-4bd7-a774-14d87c1d566b","html_url":"https://github.com/bitfinexcom/bfx-hf-strategy-exec","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/bitfinexcom/bfx-hf-strategy-exec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-strategy-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-strategy-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-strategy-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-strategy-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-hf-strategy-exec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-hf-strategy-exec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268649819,"owners_count":24284195,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-08T15:10:53.300Z","updated_at":"2025-08-04T04:38:57.396Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Bitfinex Honey Framework Trading Strategy Live Execution Module for Node.JS\n\n[![Build Status](https://travis-ci.org/bitfinexcom/bfx-hf-strategy-exec.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-hf-strategy-exec)\n\nThis module can execute strategies built with `bfx-hf-strategy` on a live data stream from Bitfinex via v2 of the WS API. Strategy indicators are initially seeded with the last 1000 candles by default, but this is configurably with the `seedCandleCount` argument. Trade data can be included on the stream by passing `includeTrades: true` when calling `exec()`.\n\n### Features\n\n* Cross-compatible with `bfx-hf-backtest` allowing the same strategy to be both backtested and executed seamlessly\n* Execute trading strategies on the live Bitfinex markets\n* Utilizes a multiplexing websocket connection manager to scale with channel subscriptions\n\n### Installation\n\n```bash\nnpm i --save bfx-hf-strategy-exec\n```\n\n### Quickstart \u0026 Example\n```js\nconst { SYMBOLS, TIME_FRAMES } = require('bfx-hf-util')\nconst { RESTv2 } = require('bfx-api-node-rest')\nconst { Manager } = require('bfx-api-node-core')\nconst LiveStrategyExecution = require('bfx-hf-stratey-exec')\nconst CustomTradingStrategy = require('./somewhere')\n\nconst ws2Manager = new Manager({ /*...*/ }) // see bfx-api-node-core docs\nconst strategy = await CustomTradingStrategy({ /* optionally pass args */ })\n\nconst rest = new RESTv2({ \n  url: 'https://api.bitfinex.com', \n  transform: true \n})\n\nws2Manager.onceWS('event:auth:success', {}, async (authEvent, ws) =\u003e {\n  strategy.ws = ws\n\n  const strategyOpts = {\n    symbol: SYMBOLS.EOS_USD, // data stream symbol\n    tf: TIME_FRAMES.ONE_DAY, // candle data stream time frame\n    includeTrades: true,\n    seedCandleCount: 5000    // indicator candle seed window\n  }\n\n  const liveExecutor = new LiveStrategyExecution({ strategy, ws2Manager, rest, strategyOpts })\n\n  liveExecutor.on('error', (err) =\u003e {\n    // handle errors\n    console.error(err)\n  })\n  \n  await liveExecutor.execute()\n})\n\nws2Manager.openWS()\n```\n\n#### Reconnections\n\nPlease note that the connection is handled by the `bfx-api-node-core` websocket manager. For a full example that uses the Watchdog Plugin, take a look at the [example](/examples/exec.js)\n\n### Docs\n\nFor executable examples refer to the [`examples/`](/examples) folder. JSDoc generated API documentation can be found [within `docs/api.md`](/docs/api.md).\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n### Note\n\nThis package will be maintained only via github, please use latest relases from github instead of npm.\n\nExample on how to install specific version from github:\n```\nnpm i --save-prod https://github.com/bitfinexcom/bfx-hf-strategy-exec.git#v1.1.0\n```\n\nExample on how to install it latest version from github:\n```\nnpm i --save-prod https://github.com/bitfinexcom/bfx-hf-strategy-exec.git\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-hf-strategy-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-hf-strategy-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-hf-strategy-exec/lists"}