# @format openapi: 3.0.0 info: title: ARA Backend API description: >- Trading, smart-money screening and IDX trading skills (VCP, Stockbee setups, market state, breadth, position sizing) on Indonesian stocks. Market data (stocks, brokers, IHSG, daily prices, broker summaries) is synced from Stockbit, and missing data is filled automatically on startup. version: 1.1.0 servers: - url: http://localhost:3000 description: Local Development Server paths: /api/v1/trade/auto-bracket: post: summary: Auto-place bracket orders from Screener description: Fetches top screener recommendations and places bracket orders on Stockbit automatically. tags: - Orders requestBody: content: application/json: schema: $ref: "#/components/schemas/AutoOrderParams" responses: "200": description: Orders submitted content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: executions: type: array items: $ref: "#/components/schemas/TradeExecution" /api/v1/orders: post: summary: Execute a trade order description: Places a buy or sell order on a specific broker or all brokers. tags: - Orders requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TradeCommand" responses: "200": description: Order executed successfully content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: executions: type: array items: $ref: "#/components/schemas/TradeExecution" "400": description: Invalid input or broker error content: text/plain: schema: type: string example: "broker not found: InvalidBroker" /api/v1/stocks/{symbol}: get: summary: Get stock details description: Retrieve real-time stock information (price, change, volume) from Stockbit. tags: - Stocks parameters: - in: path name: symbol schema: type: string required: true description: Stock symbol (e.g., BBCA) responses: "200": description: Stock details retrieved successfully content: application/json: schema: type: object properties: status: type: string example: success data: $ref: "#/components/schemas/StockDetail" "500": description: Internal Server Error /api/v1/stocks/{symbol}/analysis: get: summary: Analyze single stock description: Returns a detailed screener-like analysis (Buy/Hold/Avoid) for a single stock using real-time data. tags: - Stocks parameters: - in: path name: symbol schema: type: string required: true description: Stock symbol (e.g., BBCA) responses: "200": description: Analysis successful content: application/json: schema: allOf: - $ref: "#/components/schemas/ScreenerResult" - type: object properties: status: type: string example: success "500": description: Internal Server Error /api/v1/market-data/sync: post: summary: Sync stock data description: Triggers a background job to sync stock data from the local JSON source to the database. tags: - Market Data responses: "200": description: Sync started successfully content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: message: type: string example: "Stock sync started" /api/v1/market-data/sync-brokers: post: summary: Sync broker data description: Triggers a background job to sync broker list from the local JSON source to the database. tags: - Market Data responses: "200": description: Broker sync started successfully content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: message: type: string example: "Broker sync started" /api/v1/market-data/sync-summary: post: summary: Sync broker summary description: Triggers a background job to sync broker summary (bandar detector). Can filter by stocks and date range. tags: - Market Data requestBody: content: application/json: schema: type: object properties: stocks: type: array items: type: string example: ["BBCA", "BBRI"] from: type: string example: "2024-01-01" to: type: string example: "2024-01-01" regenerate: type: boolean example: false force: type: boolean example: false description: Run even inside Stockbit's nightly maintenance window (also ?force=true) responses: "200": description: Broker summary sync started successfully content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: message: type: string example: "Broker summary sync started" /api/v1/market-data/summary: get: summary: Get broker summaries from DB description: Retrieve stored broker summary and transactions for a stock within a date range. tags: - Market Data parameters: - in: query name: stock schema: type: string required: true description: Stock symbol - in: query name: from schema: type: string format: date description: Start date (YYYY-MM-DD), defaults to today - in: query name: to schema: type: string format: date description: End date (YYYY-MM-DD), defaults to today responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: summaries: type: array items: type: object transactions: type: array items: type: object /api/v1/market-data/sync-prices: post: summary: Sync historical stock prices description: Triggers a background job to sync historical daily stock prices from Stockbit. tags: - Market Data requestBody: content: application/json: schema: type: object properties: stocks: type: array items: type: string example: ["BBCA", "BBRI"] from: type: string example: "2024-01-01" to: type: string example: "2024-12-31" regenerate: type: boolean example: false force: type: boolean example: false description: Run even inside Stockbit's nightly maintenance window (also ?force=true) responses: "200": description: Stock price sync started successfully content: application/json: schema: type: object properties: status: type: string example: success data: type: object properties: message: type: string example: "Stock prices sync started" /api/v1/market-data/stocks: get: summary: Get all stored stocks description: Returns a list of all stocks available in the database. tags: - Market Data responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: array items: $ref: "#/components/schemas/Stock" /api/v1/market-data/brokers: get: summary: Get all stored brokers description: Returns a list of all broker firms available in the database. tags: - Market Data responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: array items: $ref: "#/components/schemas/BrokerFirm" /api/v1/market-data/transactions: get: summary: Get broker transactions description: Retrieve stored broker transactions. Can filter by broker, stock, and date range. tags: - Market Data parameters: - in: query name: broker schema: type: string description: Broker Code (optional) - in: query name: symbol schema: type: string description: Stock Symbol (optional) - in: query name: from schema: type: string format: date description: Start date (YYYY-MM-DD) - in: query name: to schema: type: string format: date description: End date (YYYY-MM-DD) responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: array items: $ref: "#/components/schemas/BrokerTransaction" /api/v1/market-data/prices: get: summary: Get stock prices from DB description: Retrieve stored historical stock prices for a stock within a date range. tags: - Market Data parameters: - in: query name: stock schema: type: string required: true description: Stock symbol - in: query name: from schema: type: string format: date description: Start date (YYYY-MM-DD), defaults to last 30 days - in: query name: to schema: type: string format: date description: End date (YYYY-MM-DD), defaults to today responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: array items: type: object /api/v1/screener/recommendations: get: summary: Get stock recommendations description: Returns a list of stocks to buy based on Bandar Accumulation and Technical Analysis. tags: - Screener parameters: - in: query name: ma_period schema: type: integer description: "Moving Average period (default: 20). Checks if Close > MA(N)." - in: query name: tp_count schema: type: integer description: "Number of Take Profit levels to generate (default: 3)." - in: query name: limit schema: type: integer description: "Number of stocks to return (default: 10)." - in: query name: date schema: type: string format: date description: "Date of screening (YYYY-MM-DD). Defaults to today." - in: query name: regenerate schema: type: boolean description: "If true, ignores cache and forces a new screener run." responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success data: type: array items: type: object properties: stock_symbol: type: string example: BBCA last_price: type: number example: 8750 recommendation: type: string example: BUY reason: type: string example: Accumulated by Bandar (BIG ACC) with Positive Foreign Flow support: type: number example: 8500 resistance: type: number example: 9000 stop_loss: type: number example: 8350 take_profits: type: array items: type: number example: [8850, 8950, 9000] score: type: number example: 85 description: "Smart Money ranking 0-100 (foreign flow, accumulation days, extension, range position). Not a probability." probability_up: type: number example: 0 description: "Deprecated: always 0. Use score." probability_down: type: number example: 0 description: "Deprecated: always 0. Use score." /api/v2/screener/recommendations: get: summary: Get V2 stock recommendations (Multi-Strategy) description: Advanced screener with customizable technical indicators (MA, RSI, MACD, OBV, ADX, Aroon, Stochastic, etc.) tags: - Screener parameters: - in: query name: limit schema: type: integer description: "Number of stocks to return (default: 10)" - in: query name: date schema: type: string format: date description: "Date of screening (YYYY-MM-DD). Defaults to today." - in: query name: regenerate schema: type: boolean description: "If true, forces regeneration of results." - in: query name: use_ma schema: type: boolean description: "Enable Moving Average indicator" - in: query name: ma_period schema: type: integer description: "MA period (default: 20)" - in: query name: use_rsi schema: type: boolean description: "Enable RSI indicator" - in: query name: rsi_period schema: type: integer description: "RSI period (default: 14)" - in: query name: use_macd schema: type: boolean description: "Enable MACD indicator" - in: query name: use_obv schema: type: boolean description: "Enable On-Balance Volume indicator" responses: "200": description: Successful retrieval content: application/json: schema: type: object properties: status: type: string example: success version: type: string example: v2 data: type: array items: $ref: "#/components/schemas/ScreenerResultV2" /api/v1/backtest/strategy: get: summary: Backtest screener strategy description: Validates screener results by comparing historical recommendations (Entry Price) against future price action. tags: - Screener parameters: - in: query name: stock schema: type: string required: true description: Stock symbol (e.g. BBCA) - in: query name: date schema: type: string format: date required: true description: Date of the screener result (Entry Date) - in: query name: period schema: type: integer description: "Number of days to look ahead (default: 30)" responses: "200": description: Successful backtest content: application/json: schema: type: object properties: status: type: string example: success data: $ref: "#/components/schemas/BacktestResult" /api/v1/health: get: summary: Check system health description: Returns the health status of the API and all connected adapters. tags: - Monitoring responses: "200": description: System is UP content: application/json: schema: $ref: "#/components/schemas/HealthResponse" "503": description: System is DOWN or PARTIAL content: application/json: schema: $ref: "#/components/schemas/HealthResponse" /api/v1/admin/telegram-users: get: summary: Get all telegram users description: Returns a list of all registered Telegram users and their subscription status. tags: - Admin responses: "200": description: Successful retrieval content: application/json: schema: type: array items: $ref: "#/components/schemas/TelegramUser" /api/v1/admin/telegram-users/{id}/extend: post: summary: Extend user subscription description: Extends the subscription validity for a specific Telegram user. tags: - Admin parameters: - in: path name: id schema: type: integer required: true description: Telegram User ID (internal DB ID) requestBody: content: application/json: schema: type: object properties: days: type: integer example: 30 responses: "200": description: Subscription extended successfully content: application/json: schema: type: object properties: message: type: string example: "Subscription extended" /api/v1/admin/telegram-users/{id}/status: post: summary: Set user active status description: Activates or deactivates a Telegram user. tags: - Admin parameters: - in: path name: id schema: type: integer required: true description: Telegram User ID (internal DB ID) requestBody: content: application/json: schema: type: object properties: is_active: type: boolean example: true responses: "200": description: Status updated successfully content: application/json: schema: type: object properties: message: type: string example: "Status updated" /api/v1/skills/vcp: get: summary: VCP screener (Minervini volatility contraction) description: >- Scans all stored IDX stocks for volatility contraction patterns. Port of tradermonty/claude-trading-skills vcp-screener + breakout-trade-planner, adjusted for IDX (Rupiah liquidity, IHSG benchmark, tick sizes, lots, ARA/ARB). Pass account_size to get sized trade plans. tags: [Trading Skills] parameters: - {in: query, name: min_price, schema: {type: number, default: 100}, description: Minimum price (Rp)} - {in: query, name: min_avg_value, schema: {type: number, default: 2000000000}, description: Minimum 50-day average traded value (Rp)} - {in: query, name: trend_min, schema: {type: number, default: 85}, description: Trend template gate (85 = 6 of 7 criteria)} - {in: query, name: strict, schema: {type: boolean}, description: Only valid VCPs in Pre-breakout or Breakout state} - {in: query, name: limit, schema: {type: integer, default: 50}} - {in: query, name: account_size, schema: {type: number}, description: Account size (Rp) to size actionable plans} - {in: query, name: risk_pct, schema: {type: number, default: 0.5}, description: Base risk per trade (%)} - {in: query, name: open_risk_pct, schema: {type: number, default: 0}, description: Risk already open in the portfolio (%)} responses: "200": {description: Screen results} /api/v1/skills/vcp/{symbol}: get: summary: VCP analysis for one stock tags: [Trading Skills] parameters: - {in: path, name: symbol, required: true, schema: {type: string}} - {in: query, name: account_size, schema: {type: number}} - {in: query, name: risk_pct, schema: {type: number, default: 0.5}} responses: "200": {description: VCP components, rating and trade plan} "404": {description: Symbol not found or not enough history} /api/v1/skills/momentum-burst: get: summary: Stockbee momentum burst screener description: Day-1 breakouts (4% gain, range expansion or price breakout on rising volume) from a tight base. tags: [Trading Skills] parameters: - {in: query, name: min_price, schema: {type: number, default: 100}} - {in: query, name: min_avg_value, schema: {type: number, default: 1000000000}, description: Minimum 20-day average traded value (Rp)} - {in: query, name: limit, schema: {type: integer, default: 50}} - {in: query, name: include_weak, schema: {type: boolean}} - {in: query, name: gate, schema: {type: string, enum: [allowed, neutral, restrictive]}, description: Override the market gate (default from market-state)} responses: "200": {description: Screen results} /api/v1/skills/exhaustion-hammer: get: summary: Stockbee exhaustion hammer screener description: Hammer candles after a 6-35% pullback in a stock with prior momentum. tags: [Trading Skills] parameters: - {in: query, name: min_price, schema: {type: number, default: 100}} - {in: query, name: min_avg_value, schema: {type: number, default: 5000000000}} - {in: query, name: limit, schema: {type: integer, default: 50}} - {in: query, name: include_weak, schema: {type: boolean}} - {in: query, name: gate, schema: {type: string, enum: [allowed, neutral, restrictive]}} responses: "200": {description: Screen results} /api/v1/skills/market-state: get: summary: IHSG follow-through day and distribution days description: >- O'Neil follow-through day state machine and IBD distribution-day count on IHSG (or a synthetic equal-weight index when IHSG prices are not synced). Also returns the market gate used by the Stockbee screeners. tags: [Trading Skills] responses: "200": {description: Market state} /api/v1/skills/breadth: get: summary: Market breadth composite description: Percent of liquid IDX stocks above their 200-day MA, smoothed, scored 0-100, plus the uptrend ratio. tags: [Trading Skills] parameters: - {in: query, name: history, schema: {type: integer, default: 120}, description: Number of daily breadth points to return} responses: "200": {description: Breadth result} /api/v1/skills/position-size: post: summary: Risk-based position size in IDX lots tags: [Trading Skills] requestBody: required: true content: application/json: schema: type: object required: [account_size, entry] properties: account_size: {type: number, example: 100000000} entry: {type: number, example: 1000} stop: {type: number, example: 950} risk_pct: {type: number, default: 1} atr: {type: number, description: Used when stop is omitted} atr_multiplier: {type: number, default: 2} max_position_pct: {type: number, default: 25} win_rate: {type: number} avg_win: {type: number} avg_loss: {type: number} responses: "200": {description: Lots, shares, risk and binding limit} "400": {description: Invalid input} /api/v1/market-data/sync-index: post: summary: Sync index prices (IHSG) from Stockbit description: >- mode=repair (default for this call) fetches the full history in one request and writes every missing day plus the last 7 days. mode=tail fetches from the newest stored day to today (what startup does). mode=full rewrites the whole history. Symbols come from INDEX_SYMBOLS (default IHSG), history start from INDEX_SYNC_START (default 2016-01-01). tags: [Market Data] parameters: - {in: query, name: mode, schema: {type: string, enum: [tail, repair, full], default: repair}} responses: "200": {description: Per-symbol sync result} "400": {description: Invalid mode} "502": {description: Stockbit request failed (e.g. expired info token)} /api/v1/market-data/index-prices/{symbol}: get: summary: Daily index prices tags: [Market Data] parameters: - {in: path, name: symbol, required: true, schema: {type: string, example: IHSG}} - {in: query, name: days, schema: {type: integer, default: 365}, description: Calendar days back from the latest stored date} responses: "200": {description: Daily bars, oldest first} /api/v1/market-data/catch-up: post: summary: Fill missing market data description: >- Runs in the background. mode=tail (default, also what runs on server startup) only fetches data after the newest stored date: IHSG from its last day, prices from each stock's last price, broker summaries from each stock's last summary. mode=repair also fills gaps further back or in the middle of history (market-wide missing days, stocks with no data, broker summaries for every traded day from the earliest stored summary, or from `from`), one symbol at a time. Stops if Stockbit rejects the info token. tags: [Market Data] parameters: - {in: query, name: mode, schema: {type: string, enum: [tail, repair], default: tail}} - {in: query, name: force, schema: {type: boolean, default: false}, description: Run every step even inside Stockbit's nightly maintenance window} - {in: query, name: from, schema: {type: string, format: date, example: "2026-01-01"}, description: "Repair only: check prices and broker summaries for gaps from this date (default: summaries from the earliest stored summary)"} - {in: query, name: refetch, schema: {type: boolean, default: false}, description: "With from: fetch prices and broker summaries again for every trading day from that date, overwriting stored rows (e.g. days fetched before the data settled)"} responses: "202": {description: Started; poll the status endpoint} "400": {description: Invalid mode} "409": {description: A catch-up is already running} "503": {description: Stockbit maintenance window; retry with force=true} /api/v1/market-data/catch-up/status: get: summary: Catch-up progress description: Current step and per-step planned / done / rows written / failed counts. tags: [Market Data] responses: "200": {description: Status of the current or last run} /api/v1/plan/latest: get: summary: Latest next-session plan description: >- The Trading Action Plan for the next session, built after the close from end-of-day data: the regime (panic to uptrend, with its position, money-in-stocks and risk limits), the day's order(s) with grade, limit, close-based stop, TP1 (half), trailing %, risk and lots (when PLAN_ACCOUNT_SIZE is set), plus the other qualified setups as a watchlist. Each order gets an outcome once later sessions are synced. tags: [Trading Plan] responses: "200": {description: Plan} "404": {description: No plan built yet} /api/v1/plan/{date}: get: summary: Plan built from a given data date tags: [Trading Plan] parameters: - {in: path, name: date, required: true, schema: {type: string, format: date}} responses: "200": {description: Plan} "404": {description: No plan for that date} /api/v1/plan/history: get: summary: Recent plans with outcomes tags: [Trading Plan] parameters: - {in: query, name: limit, schema: {type: integer, default: 20}} responses: "200": {description: Plans, newest first} /api/v1/plan/performance: get: summary: How planned orders played out, by setup description: >- Fill rate, win rate, average R and total R per setup over recent plans. Orders are replayed on daily bars: day orders fill only on the next session. Trading Action Plan orders use that plan's exits (close stop, half at TP1, trailing runner, broker early exit; no time exit); older orders exit at stop/target or after 10 sessions. Net of fees. tags: [Trading Plan] parameters: - {in: query, name: plans, schema: {type: integer, default: 60}} responses: "200": {description: Summary} /api/v1/plan/schedule: get: summary: After-close scheduler status tags: [Trading Plan] responses: "200": {description: Whether the scheduler is enabled and its last run} /api/v1/plan/build: post: summary: Build the plan now from the latest data description: Re-scores recent plans and builds (or replaces) the plan for the latest data date. Does not send Telegram. tags: [Trading Plan] responses: "200": {description: Plan} /api/v1/backtest/run: get: summary: Back-test a strategy over stored history description: >- Replays the strategy day by day: each session's screen runs on data known at that close, signals become the same orders as the next-session plan (next-session fill, stop, target >= 1.5R, exit after max_hold sessions), net of fees, one position per stock at a time. Works for any stock or the whole market. With a single stock and no trades, `diagnostics` counts the days by the first rule that failed. Range up to about one year. tags: [Backtest] parameters: - {in: query, name: strategy, required: true, schema: {type: string, enum: [smart_money, vcp, momentum_burst, exhaustion_hammer]}} - {in: query, name: from, required: true, schema: {type: string, format: date}} - {in: query, name: to, required: true, schema: {type: string, format: date}} - {in: query, name: symbol, schema: {type: string}, description: One stock; omit for the whole market} - {in: query, name: max_hold, schema: {type: integer, default: 10}, description: Maximum holding period in sessions (1-60)} responses: "200": {description: Stats, equity curve (cumulative R), trades, diagnostics} "400": {description: Invalid parameters} "429": {description: Another backtest is running} components: schemas: TradeExecution: type: object properties: broker: type: string example: Stockbit order_id: type: string example: sb-W1234 status: type: string example: SUCCESS details: type: string example: Executed BUY BBCA 10 @ 8750.00 timestamp: type: string format: date-time Stock: type: object properties: symbol: type: string example: BBCA company_name: type: string example: Bank Central Asia Tbk. created_at: type: string format: date-time updated_at: type: string format: date-time BrokerFirm: type: object properties: code: type: string example: YP name: type: string example: Mirae Asset Sekuritas Indonesia license: type: string example: PPE, WPPE, WPEE created_at: type: string format: date-time updated_at: type: string format: date-time StockDetail: type: object properties: symbol: type: string example: BBCA company_name: type: string example: Bank Central Asia Tbk. sector: type: string example: Keuangan last_price: type: number example: 8000 change: type: number example: -125 percentage: type: number example: -1.54 volume: type: number example: 82672500 TradeCommand: type: object required: - symbol - action properties: broker: type: string description: Target broker name. enum: [Stockbit, Ajaib, All] default: All example: Stockbit symbol: type: string example: BBCA action: type: string enum: [BUY, SELL] example: BUY quantity: type: integer description: Quantity in lots (for Normal trade). example: 10 price: type: number format: float description: Price limit. example: 8750 strategy: type: string description: Trading strategy. enum: [NORMAL, AVERAGE_DOWN, AVERAGE_UP, BRACKET] default: NORMAL example: AVERAGE_DOWN total_amount: type: number description: Total investment amount in IDR (for Smart Trading). example: 2000000 strategy_params: type: object description: Optional overrides for strategy config. example: max_avg_down_count: 3 avg_down_diff_percent: 8.0 take_profit_price: 1100 stop_loss_price: 900 HealthResponse: type: object properties: status: type: string example: UP version: type: string example: v1 components: type: object additionalProperties: type: string example: broker:Ajaib: UP broker:Stockbit: UP messenger:Slack: UP BacktestResult: type: object properties: summary: $ref: "#/components/schemas/BacktestSummary" details: type: array items: $ref: "#/components/schemas/BacktestDetail" BacktestSummary: type: object properties: stock_symbol: type: string example: BBCA entry_date: type: string format: date example: "2024-01-01" entry_price: type: number example: 8000 win_rate: type: number example: 85.5 description: "Percentage of profitable days in the period" max_profit_pct: type: number example: 12.5 max_loss_pct: type: number example: -2.1 best_hold_days: type: integer example: 15 description: "Number of days held to achieve Max Profit" BacktestDetail: type: object properties: date: type: string format: date day_index: type: integer example: 1 close_price: type: number profit_pct: type: number example: 1.5 is_profitable: type: boolean AutoOrderParams: type: object properties: lot: type: integer example: 1 description: "Number of lots per order (default 1)" max_amount_per_stock: type: number example: 5000000 description: "Max IDR amount per stock (overrides user config if set)" min_amount_per_stock: type: number example: 100000 description: "Min IDR amount per stock (skip if trade value is smaller)" max_orders: type: integer example: 5 description: "Max number of stocks to order (default 5)" min_prob: type: number format: float example: 75 description: "Minimum Smart Money score (0-100; fractions like 0.75 are read as 75)" max_prob: type: number format: float example: 100 description: "Maximum Smart Money score (0-100; fractions are read as percentages)" tp_diff: type: number example: 0 description: "Price adjustment for Take Profit" cl_diff: type: number example: 0 description: "Price adjustment for Stop Loss (Cut Loss)" regenerate: type: boolean example: true description: "Force regeneration of screener results" ScreenerResult: type: object properties: stock_symbol: type: string example: BBCA last_price: type: number example: 8750 recommendation: type: string example: BUY reason: type: string example: "Accumulated by Bandar (BIG ACC) with Positive Foreign Flow" support: type: number example: 8500 resistance: type: number example: 9000 stop_loss: type: number example: 8350 take_profits: type: array items: type: number example: [8850, 8950, 9000] score: type: number example: 85 description: "Smart Money ranking 0-100 (foreign flow, accumulation days, extension, range position). Not a probability." probability_up: type: number example: 0 description: "Deprecated: always 0. Use score." probability_down: type: number example: 0.15 description: "Deprecated: always 0. Use score." description: type: string example: "Detailed analysis description..." action_advice: type: string example: "BUY" ScreenerResultV2: type: object properties: stock_symbol: type: string example: BBCA last_price: type: number example: 8750 recommendation: type: string example: BUY reason: type: string example: "Strong uptrend confirmed by MA, RSI neutral, positive OBV" version: type: string example: v2 signals: type: object properties: ma_signal: type: string example: ABOVE rsi_signal: type: string example: NEUTRAL macd_signal: type: string example: BULLISH obv_signal: type: string example: RISING trend_strength: type: number example: 85 momentum_score: type: number example: 72 volume_score: type: number example: 90 overall_score: type: number example: 82.3 probability_up: type: number example: 0.85 take_profits: type: array items: type: number example: [8900, 9000, 9100] stop_loss: type: number example: 8500 BrokerTransaction: type: object properties: stock_symbol: type: string example: BBCA date: type: string format: date example: "2024-01-01" broker_code: type: string example: YP action: type: string example: BUY volume: type: number example: 1540 value: type: number example: 13500000000 average_price: type: number example: 8750 created_at: type: string format: date-time updated_at: type: string format: date-time TelegramUser: type: object properties: id: type: integer example: 1 telegram_id: type: integer example: 123456789 username: type: string example: "john_doe" first_name: type: string example: "John" last_name: type: string example: "Doe" email: type: string example: "john@example.com" role: type: string example: "viewer" subscription_expires_at: type: string format: date-time is_active: type: boolean example: true created_at: type: string format: date-time updated_at: type: string format: date-time