Add Pocket Option (forex binary-options) venue with time-based forecasts#28
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: Payel-git-ol#27
Add Pocket Option as a forex binary-options exchange: - New exchange entry with a 'binary-options' kind; spot venues stay 'spot'. - FrankfurterMarketData fetches ECB reference rates from frankfurter.dev and builds a deterministic candle path landing on the live spot, so all 13 strategy algorithms run unchanged. - Forecast now derives a binary-options expiry time (EXPIRY_BARS × interval) alongside the existing TP/SL bracket. - Trade Log shows a Time (expiry) column instead of TP/SL on binary venues. - Backtester gains a binary-options settlement mode (resolve on expiry by direction, Pocket Option-style payout). - Pocket Option defaults to forex majors (EURUSD, GBPUSD, …) for symbols. - Wire exchange/interval through RunReport so the UI picks the right columns. Tests cover the Frankfurter source, forex pair parsing, expiry derivation, binary settlement, forex symbol defaults, and the Time column.
README: describe the forex binary-options venue (Frankfurter rates, expiry time instead of TP/SL), the new TRADEFAST_EXCHANGE / TRADEFAST_FRANKFURTER_API env vars, the pocketoption market source, the binary-options backtest settlement, and the updated /exchange command.
Working session summaryThe task is complete. Here's a summary of what was delivered for issue #27. SummaryPR #28 — #28 — is now ready for review with a full description, passing CI, and 126 passing tests. What was implementedThe issue asked to add a Pocket Option forex binary-options venue, wire up its API via frankfurter.dev, keep the strategy algorithms unchanged, and replace TP/SL with a TIME (expiry) value in the result.
Verification
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $10.557159📊 Context and tokens usage:Claude Opus 4.8: (3 sub-sessions)
Total: (26.5K new + 301.3K cache writes + 12.3M cache reads) input tokens, 87.4K output tokens, $10.337608 cost Claude Haiku 4.5:
Total: (2.9K new + 79.8K cache writes + 681.6K cache reads) input tokens, 9.7K output tokens, $0.219551 cost 🤖 Models used:
📎 Log file uploaded as Gist (5357KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit c7023fd.
Add Pocket Option (forex binary-options) venue with time-based forecasts
Fixes #27
What the issue asked for
https://api.frankfurter.dev/v2/rate/EUR/USD→{"amount":1.0,"base":"EUR","date":"2026-05-30","rates":{"USD":1.15186}}.How it works
pocketoptionregistered alongside the crypto spot venues (src/cli/exchanges.ts). It is classified asbinaryviaisBinaryOptions()/exchangeKind().FrankfurterMarketDatainsrc/services/market-data.ts). Frankfurter returns a single ECB reference quote (no OHLCV), so we reuse the existingcandlesFromSpothelper to build a deterministic candle path that lands on the live spot — feeding the unchanged strategy/forecast pipeline. Endpoint is configurable viaTRADEFAST_FRANKFURTER_API.TRADEFAST_SYMBOLSis unset, defaults switch to forex majors (EURUSD,GBPUSD, …) instead of crypto tickers (src/config.ts). User-pinned symbol lists are always honoured, and switching exchanges only swaps symbols when the current list matches the previous venue's defaults.expiryMinutes(src/strategies/forecast.ts), and the trade log renders a Time column instead of TP/SL for binary venues (src/cli/trade-log.ts). Expiry =intervalMinutes(interval) × EXPIRY_BARS.simulateBinaryTrade(src/services/backtest.ts) which settles each trade on the timed expiry bar (win → +0.92R Pocket-Option-style payout, loss → −1R, flat → 0) instead of bracketing with TP/SL. The strategy/forecast logic itself is untouched.How to reproduce / try it
TRADEFAST_EXCHANGE=pocketoption npm run dev # or inside the CLI: /exchange pocketoptionThe forecast/trade-log output for Pocket Option shows an expiry Time column (e.g.
2h) in place of TP/SL.Tests
All 126 tests pass;
npm run typecheckandnpm run buildare clean. New/updated coverage:tests/config.test.ts— forex vs crypto default symbols andloadConfigresolution.tests/market-data.test.ts— Frankfurter endpoint URL, missing-rate error,toForexPair, and source selection forpocketoption.tests/forecast.test.ts— binary-options expiry minutes.tests/backtest.test.ts— binary settlement (payout/loss/timeout).tests/cli.test.tsx— exchange list includespocketoption, binary classification, and the Time column.Other
README.mddocuments the venue, theTRADEFAST_EXCHANGE/TRADEFAST_FRANKFURTER_APIenv vars, and the binary settlement behaviour.0.4.1 → 0.5.0to trigger the next release.This PR was generated by the AI issue solver.