### Access Dev Container and Serve Source: https://github.com/freqtrade/frequi/blob/main/README.md Executes a command inside the 'web-service' container to access its shell, then starts the development server. This is part of the dev container setup. ```bash docker-compose exec web /bin/bash pnpm run dev ``` -------------------------------- ### Install Project Dependencies with pnpm Source: https://github.com/freqtrade/frequi/blob/main/README.md Installs all necessary project dependencies using the pnpm package manager. This is a prerequisite for running development or build commands. ```bash pnpm install ``` -------------------------------- ### GET /show_config Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the current bot configuration. ```APIDOC ## GET /show_config ### Description Retrieves the current bot configuration. ### Method GET ### Endpoint /show_config ``` -------------------------------- ### Run Development Server Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Start the development server for FreqUI using pnpm. ```bash pnpm run dev ``` -------------------------------- ### GET /sysinfo Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves system information about the Frequi instance. ```APIDOC ## GET /sysinfo ### Description Get system information. ### Method GET ### Endpoint /sysinfo ### Response #### Success Response (200) - **SysInfoResponse** (object) - Description not provided ``` -------------------------------- ### Start Development Server Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Run the development server to preview your application locally. Requires Freqtrade running with API enabled. ```bash # Start dev server (http://localhost:5173) pnpm run dev # Requires Freqtrade running on http://localhost:8080 with API enabled ``` -------------------------------- ### POST /start Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Initiates the trading bot. This action starts the bot's operational processes. ```APIDOC ## POST /start ### Description Start the bot. ### Method POST ### Endpoint /start ### Response #### Success Response (200) - **Confirmation** (string) - Confirmation message ``` -------------------------------- ### GET /background Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves a list of all background jobs. ```APIDOC ## GET /background ### Description Retrieves a list of all background jobs. ### Method GET ### Endpoint /background ``` -------------------------------- ### Vue Component Structure Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Example of a basic Vue 3 component using the Composition API and Pinia store for managing trade data. Includes template, script setup, and store integration. ```vue ``` -------------------------------- ### Start Bot Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Initiates the trading bot. This endpoint is used by the `startBot()` function. ```http POST /start ``` -------------------------------- ### GET /pairlists Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the current pairlist configuration. ```APIDOC ## GET /pairlists ### Description Retrieves the current pairlist configuration. ### Method GET ### Endpoint /pairlists ``` -------------------------------- ### Login Flow Example Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/composables-login.md Demonstrates how to use the `useLoginInfo` composable to authenticate with a bot, access tokens and URLs, manually refresh tokens, and log out. ```typescript import { useLoginInfo } from '@/composables/loginInfo'; const botId = 'ftbot.1'; const loginInfo = useLoginInfo(botId); // Authenticate with bot await loginInfo.login({ botName: 'My Bot', url: 'http://localhost:8080', username: 'freqtrader', password: 'secretpassword', }); // Access tokens and URLs console.log(loginInfo.accessToken.value); // JWT token console.log(loginInfo.baseUrl.value); // http://localhost:8080/api/v1 console.log(loginInfo.baseWsUrl.value); // ws://localhost:8080/api/v1 // Manually refresh if needed const newToken = await loginInfo.refreshToken(); // Logout loginInfo.logout(); ``` -------------------------------- ### Strategy and Configuration Information Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/INDEX.md Get information about the currently loaded strategy and its configuration. ```APIDOC ## GET /strategy, /config/strategy ### Description Retrieves details about the active trading strategy and its associated configuration parameters. ### Method GET ### Endpoint /strategy, /config/strategy ### Response #### Success Response (200) - **strategy** (object) - Information about the loaded strategy. - **config** (object) - Strategy-specific configuration parameters. ``` -------------------------------- ### Start Development Server with Hot Reloading Source: https://github.com/freqtrade/frequi/blob/main/README.md Compiles and runs the development server, enabling hot-reloading for rapid development. Ensure freqtrade API is accessible. ```bash pnpm run dev ``` -------------------------------- ### GET /ui_version Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the version of the UI, served from the backend. ```APIDOC ## GET /ui_version ### Description Get UI version (served from backend). ### Method GET ### Endpoint /ui_version ### Response #### Success Response (200) - **version** (string) - Description not provided #### Response Example ```json { "version": "string" } ``` ``` -------------------------------- ### GET /strategy/{strategy_name} Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches the complete source code and configuration parameters for a specific strategy. ```APIDOC ## GET /strategy/{strategy_name} ### Description Get full strategy code and parameters. ### Method GET ### Endpoint /strategy/{strategy_name} ### Parameters #### Path Parameters - **strategy_name** (string) - Required - Strategy name ### Response #### Success Response (200) - **strategy** (string) - Name of the strategy - **timeframe** (string) - Default timeframe for the strategy - **code** (string) - Full source code of the strategy - **params** (array) - Array of strategy parameters ### Response Example { "strategy": "SampleStrategy", "timeframe": "1h", "code": "...", "params": [ {"name": "stoploss", "value": "-0.1"} ] } ``` -------------------------------- ### GET /strategies Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves a list of all available trading strategies. ```APIDOC ## GET /strategies ### Description Retrieves a list of all available trading strategies. ### Method GET ### Endpoint /strategies ``` -------------------------------- ### GET /strategies Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of all available strategies within the Freqtrade system. ```APIDOC ## GET /strategies ### Description Get list of available strategies. ### Method GET ### Endpoint /strategies ### Response #### Success Response (200) - **strategies** (string[]) - List of strategy names ### Response Example { "strategies": [ "strategy1", "strategy2" ] } ``` -------------------------------- ### GET /whitelist Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the list of currently tradeable pairs. ```APIDOC ## GET /whitelist ### Description Retrieves the list of currently tradeable pairs. ### Method GET ### Endpoint /whitelist ``` -------------------------------- ### Start Trading Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Resumes trading activities after a pause. This endpoint is used by the `startTrade()` function. ```http POST /start_trade ``` -------------------------------- ### GET /strategy/{name} Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves detailed information about a specific strategy. ```APIDOC ## GET /strategy/{name} ### Description Retrieves detailed information about a specific strategy. ### Method GET ### Endpoint /strategy/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The name of the strategy. ``` -------------------------------- ### GET /backtest/wallet Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches the wallet history associated with a backtest simulation. ```APIDOC ## GET /backtest/wallet ### Description Get wallet history for backtest. ### Method GET ### Endpoint /backtest/wallet ### Response #### Success Response (200) - **WalletHistoryPerBot** (object) - WalletHistoryPerBot data ``` -------------------------------- ### Create New Pinia Store Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Define a new Pinia store using the `defineStore` function. This example shows how to manage state with `ref`, use computed properties, and define asynchronous actions like `fetch`. ```typescript export const useMyStore = defineStore('myStore', () => { const state = ref(initialValue); const computed = computed(() => state.value.transform()); async function fetch() { const botStore = useBotStore(); // Use botStore.api for API calls } return { state, computed, fetch }; }, { persist: { key: 'ftMyStore' }, // Optional persistence }); ``` -------------------------------- ### Run Standalone FreqUI with Docker Compose Source: https://github.com/freqtrade/frequi/blob/main/README.md Starts a pre-built FreqUI container using Docker Compose. Ensure freqtrade is running and CORS is configured correctly in freqtrade to allow connection to the API. ```bash docker compose up -d ``` -------------------------------- ### GET /freqaimodels Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of available FreqAI models. ```APIDOC ## GET /freqaimodels ### Description Get available FreqAI models. ### Method GET ### Endpoint /freqaimodels ### Response #### Success Response (200) - **freqaimodels** (string[]) - Description not provided #### Response Example ```json { "freqaimodels": [] } ``` ``` -------------------------------- ### GET /hyperopt-loss Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of available hyperopt loss functions. ```APIDOC ## GET /hyperopt-loss ### Description Get available hyperopt loss functions. ### Method GET ### Endpoint /hyperopt-loss ### Response #### Success Response (200) - **hyperopt_loss_functions** (HyperoptLossObj[]) - Description not provided #### Response Example ```json { "hyperopt_loss_functions": [] } ``` ``` -------------------------------- ### Get UI Version Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches the current UI version served from the backend. The response contains the version string. ```typescript { version: string; } ``` -------------------------------- ### Formatting Numerical and Time Values Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Provides examples of using utility functions to format numbers, percentages, and timestamps for display in the UI. Shows how to format price, profit, and date values. ```typescript import { formatNumber, formatPercent, timestampms } from '@/utils/formatters/numberformat'; import { timestampms } from '@/utils/formatters/timeformat'; export default { setup() { return { price: computed(() => formatNumber(1234.5678, 2)), // '1234.57' profit: computed(() => formatPercent(0.0512, 2)), // '5.12%' date: computed(() => timestampms(Date.now())), // '2024-06-20 15:30:45' }; }, }; ``` -------------------------------- ### Using Custom API Calls with Composables Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Illustrates how to create an authenticated API instance using useApi and useLoginInfo composables, and then perform a custom GET request to a specific endpoint. ```typescript import { useLoginInfo } from '@/composables/loginInfo'; import { useApi } from '@/composables/api'; export default { setup() { const botId = 'ftbot.1'; const loginInfo = useLoginInfo(botId); const { api } = useApi(loginInfo, botId); const customApiCall = async () => { const { data } = await api.get('/some-endpoint'); return data; }; return { customApiCall }; }, }; ``` -------------------------------- ### GET /ping Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Performs a health check to verify the API is responsive. ```APIDOC ## GET /ping ### Description Health check endpoint to verify API responsiveness. ### Method GET ### Endpoint /ping ``` -------------------------------- ### Build and Run Dev Container Source: https://github.com/freqtrade/frequi/blob/main/README.md Builds the development Docker image and starts the container(s) in detached mode. This is used for developing inside a containerized environment. ```bash cd .devcontainer docker-compose up -d ``` -------------------------------- ### GET /backtest/ Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the current progress status of an ongoing backtest. WebSocket is preferred for real-time updates. ```APIDOC ## GET /backtest/ ### Description Get backtest progress (WebSocket preferred). ### Method GET ### Endpoint /backtest/ ### Response #### Success Response (200) - **Current backtest status** (any) - Current backtest status ``` -------------------------------- ### useApi Composable Usage Example Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/composables-api.md Demonstrates how to import and use the useApi composable within a Vue component or store to create an authenticated Axios instance for making API requests to a Freqtrade bot. ```typescript import { useApi } from '@/composables/api'; import { useLoginInfo } from '@/composables/loginInfo'; // In a component or store const botId = 'ftbot.1'; const loginInfo = useLoginInfo(botId); const { api } = useApi(loginInfo, botId); // Make authenticated requests const response = await api.get('/status'); const trades = await api.get('/trades', { params: { limit: 500 } }); ``` -------------------------------- ### Detect and Use Bot Features Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/configuration.md Example of how to evaluate available features based on the bot's state and API version, and conditionally use a feature like WebSocket connection. ```typescript import { evaluateFeatures } from '@/utils/features'; const features = evaluateFeatures(botState, botState.api_version); if (features.websocketConnection) { // Use WebSocket } ``` -------------------------------- ### Get Bot Configuration and State Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieve the complete bot configuration, including version, trading mode, run mode, and strategy parameters. This is useful for understanding the current operational status of the bot. ```typescript { version: string; api_version: string; dry_run: boolean; trading_mode: 'spot' | 'margin' | 'futures'; runmode: string; state: 'running' | 'stopped' | 'reload_config'; timeframe: string; stake_currency: string; // All trading parameters and strategies } ``` -------------------------------- ### GET /trades Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a paginated list of all closed trades. Allows specifying the number of results per page and the starting offset. ```APIDOC ## GET /trades ### Description Retrieves a paginated list of all closed trades. Allows specifying the number of results per page and the starting offset. ### Method GET ### Endpoint /api/v1/trades ### Parameters #### Query Parameters - **limit** (number) - Optional - Results per page (default: 500) - **offset** (number) - Optional - Starting index (default: 0) ### Request Example No body ### Response #### Success Response (200) - **trades** (array) - Array of ClosedTrade objects - **total_trades** (number) - Total number of closed trades #### Response Example ```json { "trades": [ // ClosedTrade objects... ], "total_trades": 1234 } ``` ``` -------------------------------- ### Build for Production Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Create a production-ready build of your application. The output will be in the dist/ directory. ```bash # Build pnpm run build # Output in dist/ directory ``` -------------------------------- ### Get Closed Trades with Pagination Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a paginated list of all closed trades. You can specify the number of results per page and the starting offset. The response includes the trades and the total count. ```typescript { trades: ClosedTrade[]; total_trades: number; } ``` -------------------------------- ### POST /start Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Initiates the bot's operation. ```APIDOC ## POST /start ### Description Starts the bot. ### Method POST ### Endpoint /start ``` -------------------------------- ### Get UI Version Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-settings.md Retrieves the formatted UI version string, including the version number and commit hash. ```typescript const uiVersion: ComputedRef ``` -------------------------------- ### Get Full Strategy Code and Parameters Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches the complete source code and configurable parameters for a specific strategy. Requires the strategy name as a path parameter. Used by `getStrategy()`. ```typescript { strategy: string; timeframe: string; code: string; params: Array; } ``` -------------------------------- ### GET /performance Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves per-pair performance statistics, including the number of trades, average profit, and profit percentage. ```APIDOC ## GET /performance ### Description Retrieves per-pair performance statistics, including the number of trades, average profit, and profit percentage. ### Method GET ### Endpoint /api/v1/performance ### Parameters ### Request Example No body ### Response #### Success Response (200) An array of objects, where each object contains: - **pair** (string) - The trading pair - **trades** (number) - Number of trades for the pair - **profit_mean** (number) - Average profit per trade - **profit_sum** (number) - Total profit for the pair - **profit_pct** (number) - Overall profit percentage for the pair #### Response Example ```json [ { "pair": "BTC/USDT", "trades": 150, "profit_mean": 1.2, "profit_sum": 180, "profit_pct": 15.5 } // ... more pairs ] ``` ``` -------------------------------- ### Making API Calls with Vue Composables Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Shows how to fetch trade and profit data from the API using async functions within a Vue setup, leveraging the useBotStore composable. Includes basic error handling. ```typescript import { useBotStore } from '@/stores/ftbot'; export default { setup() { const store = useBotStore(); const fetchData = async () => { try { await store.getTrades(); await store.getProfit(); } catch (error) { console.error('Failed to fetch data', error); } }; return { fetchData }; }, }; ``` -------------------------------- ### Preview Production Build Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Serve the production build locally to test it before deployment. Deploy the dist/ directory to your web server. ```bash # Preview pnpm run preview # Deploy dist/ to web server ``` -------------------------------- ### GET /backtest/history Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the history of past backtests. ```APIDOC ## GET /backtest/history ### Description Retrieves the history of past backtests. ### Method GET ### Endpoint /backtest/history ``` -------------------------------- ### GET /entries Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Provides statistics for entry signals, including the number of trades, average profit, and profit percentage per entry tag. ```APIDOC ## GET /entries ### Description Provides statistics for entry signals, including the number of trades, average profit, and profit percentage per entry tag. ### Method GET ### Endpoint /api/v1/entries ### Parameters ### Request Example No body ### Response #### Success Response (200) An array of objects, where each object contains: - **entry_tag** (string) - The tag for the entry signal - **trades** (number) - Number of trades using this entry tag - **profit_mean** (number) - Average profit for trades with this entry tag - **profit_pct** (number) - Overall profit percentage for trades with this entry tag #### Response Example ```json [ { "entry_tag": "my_entry", "trades": 100, "profit_mean": 1.5, "profit_pct": 18.2 } // ... more entry tags ] ``` ``` -------------------------------- ### GET /whitelist Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the current list of whitelisted trading pairs. This endpoint returns an array of strings representing the whitelisted pairs and the total count. ```APIDOC ## GET /whitelist ### Description Retrieves the current list of whitelisted trading pairs. ### Method GET ### Endpoint /whitelist ### Response #### Success Response (200) - **whitelist** (string[]) - Array of whitelisted trading pairs. - **length** (number) - The total number of whitelisted pairs. #### Response Example ```json { "whitelist": ["BTC/USDT", "ETH/BTC"], "length": 2 } ``` ``` -------------------------------- ### GET /plot_config Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the chart configuration settings. ```APIDOC ## GET /plot_config ### Description Retrieves the chart configuration settings. ### Method GET ### Endpoint /plot_config ``` -------------------------------- ### Preview Production Build Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Preview the production build of the FreqUI application locally. ```bash pnpm run preview ``` -------------------------------- ### GET /blacklist Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the list of blacklisted pairs. ```APIDOC ## GET /blacklist ### Description Retrieves the list of blacklisted pairs. ### Method GET ### Endpoint /blacklist ``` -------------------------------- ### Build Production Application Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Create a production build of the FreqUI application. ```bash pnpm run build ``` -------------------------------- ### GET /balance Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the current account balance. ```APIDOC ## GET /balance ### Description Retrieves the current account balance. ### Method GET ### Endpoint /balance ``` -------------------------------- ### Build Project for Production Source: https://github.com/freqtrade/frequi/blob/main/README.md Compiles and minifies the project for production deployment. This command generates optimized static assets. ```bash pnpm run build ``` -------------------------------- ### GET /trades Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves a list of all closed trades. ```APIDOC ## GET /trades ### Description Retrieves a list of all closed trades. ### Method GET ### Endpoint /trades ``` -------------------------------- ### Build and Run Docker Version Source: https://github.com/freqtrade/frequi/blob/main/README.md Builds the Docker image for the project and then runs the container in detached mode. Access the application via http://localhost:3000. ```bash docker-compose build docker-compose up -d ``` -------------------------------- ### Add Custom API Call to Bot Store Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Implement a new asynchronous method within the bot store to make API requests. This example demonstrates using `api.get` and handling potential errors. ```typescript async function myNewMethod() { try { const { data } = await api.get('/endpoint'); // Update state myState.value = data; return data; } catch (error) { console.error(error); showAlert('Error message', 'error'); return Promise.reject(error); } } ``` -------------------------------- ### POST /backtest Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Initiates a new backtest simulation. ```APIDOC ## POST /backtest ### Description Starts a backtest simulation. ### Method POST ### Endpoint /backtest ``` -------------------------------- ### GET /status Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the status of currently open trades. ```APIDOC ## GET /status ### Description Retrieves the status of open trades. ### Method GET ### Endpoint /status ``` -------------------------------- ### Read and Update Settings Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-settings.md Demonstrates how to read and update various settings from the `useSettingsStore`. Settings are automatically persisted. Use this to configure UI elements, data display, and user preferences. ```typescript import { useSettingsStore } from '@/stores/settings'; import { OpenTradeVizOptions } from '@/stores/settings'; const settings = useSettingsStore(); // Read settings console.log(settings.currentTheme); // 'dark' console.log(settings.isDarkTheme); // true console.log(settings.chartTheme); // 'dark' // Update settings (persisted automatically) settings.currentTheme = 'light'; settings.timezone = 'Europe/London'; settings.useHeikinAshiCandles = true; // Toggle boolean settings.backgroundSync = !settings.backgroundSync; // Notification preferences settings.notifications[FtWsMessageTypes.entryFill] = false; // Load UI version from server await settings.loadUIVersion(); ``` -------------------------------- ### POST /backtest Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Initiates a backtest simulation with specified parameters including strategy, timerange, trade limits, stake amount, and FreqAI model configuration. ```APIDOC ## POST /backtest ### Description Start a backtest. ### Method POST ### Endpoint /backtest ### Parameters #### Request Body - **strategy** (string) - Required - Strategy name - **timerange** (string) - Required - Date range - **max_open_trades** (integer) - Required - Max trades - **stake_amount** (number) - Required - Stake per trade - **enable_protections** (boolean) - Required - Enable protections - **freqaimodel** (string) - Optional - FreqAI model name ### Response #### Success Response (200) - **status** (string) - Status of the backtest job - **job_id** (string) - Optional - ID of the backtest job ``` -------------------------------- ### GET /exchanges Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of all supported exchanges that FreqUI can interact with. ```APIDOC ## GET /exchanges ### Description Get supported exchanges. ### Method GET ### Endpoint /exchanges ### Response #### Success Response (200) - **ExchangeListResult** (array) - Array of exchange objects with modes ``` -------------------------------- ### GET /background/{id} Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the status of a specific background job. ```APIDOC ## GET /background/{id} ### Description Retrieves the status of a specific background job. ### Method GET ### Endpoint /background/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the background job. ``` -------------------------------- ### GET /pair_candles Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves the current candle data for a given pair. ```APIDOC ## GET /pair_candles ### Description Retrieves the current candle data for a given pair. ### Method GET ### Endpoint /pair_candles ``` -------------------------------- ### Run Unit Tests Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Execute unit tests for the FreqUI project. ```bash pnpm run test:unit ``` -------------------------------- ### Accessing and Switching Themes Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-settings.md Demonstrates how to access the current theme, check if it's a dark theme, and retrieve chart-specific colors based on the theme. Requires the useSettingsStore hook. ```typescript const settings = useSettingsStore(); // Predefined themes const themes: ThemeName[] = ['dark', 'bootstrap_dark', 'light', 'bootstrap']; // Get current and switch const current = settings.currentTheme; const isDark = settings.isDarkTheme; // For chart rendering const chartColors = settings.chartTheme === 'dark' ? darkColors : lightColors; ``` -------------------------------- ### GET /backtest/market_change Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves market change data relevant to a backtest simulation. ```APIDOC ## GET /backtest/market_change ### Description Get market change data for backtest. ### Method GET ### Endpoint /backtest/market_change ### Response #### Success Response (200) - **BacktestMarketChange** (object) - BacktestMarketChange object ``` -------------------------------- ### System Information Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-ftbot.md Methods for retrieving bot configuration, state, logs, and system information. ```APIDOC ## getState() ### Description Fetch bot configuration and state. ### Method GET ### Endpoint /api/v1/state ### Response #### Success Response (200) - **BotState** - BotState object including version, API version, trading mode, strategy, configuration, etc. ``` ```APIDOC ## getLogs() ### Description Fetch recent bot logs. ### Method GET ### Endpoint /api/v1/logs ``` ```APIDOC ## getSysInfo() ### Description Fetch system information. ### Method GET ### Endpoint /api/v1/sys-info ``` -------------------------------- ### Run Unit Tests Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Execute unit tests for your application using the configured test runner. ```bash # Unit tests pnpm run test:unit ``` -------------------------------- ### forceentry(payload: ForceEnterPayload): Promise Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-ftbot.md Manually initiates a trade entry for a specified pair, with options for side, price, stake amount, entry tag, and leverage. ```APIDOC ## forceentry(payload: ForceEnterPayload): Promise ### Description Manually enters a trade for a given trading pair. Allows specifying entry price, stake amount, side (long/short), entry tag, and leverage for futures. ### Method `async function forceentry(payload: ForceEnterPayload): Promise` ### Parameters #### Request Body - **pair** (string) - Required - The trading pair (e.g., 'BTC/USDT'). - **side** (OrderSides) - Optional - The order side, either `OrderSides.long` or `OrderSides.short`. - **price** (number) - Optional - The desired entry price. - **stakeamount** (number) - Optional - The custom amount to stake for the trade. - **entry_tag** (string) - Optional - A tag to identify the entry signal. - **leverage** (number) - Optional - The leverage to apply (for futures trading). ### Example ```typescript await store.forceentry({ pair: 'BTC/USDT', side: OrderSides.long, stakeamount: 100, }); ``` ``` -------------------------------- ### Bot Control Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/INDEX.md Control the Freqtrade bot, including starting, stopping, and reloading. ```APIDOC ## Bot Control Endpoints ### Description Allows for direct control of the Freqtrade bot's operational state. ### Method POST ### Endpoint /bot/start, /bot/stop, /bot/reload ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the action taken (e.g., 'Bot started successfully.'). ``` -------------------------------- ### Status and Configuration Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/INDEX.md Retrieve the current bot configuration and status. ```APIDOC ## GET /show_config ### Description Retrieves the current configuration of the Freqtrade bot. ### Method GET ### Endpoint /show_config ### Response #### Success Response (200) - **config** (object) - The bot's current configuration settings. ``` -------------------------------- ### GET /locks Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches the current list of pair locks and the total count of locks. ```APIDOC ## GET /locks ### Description Get pair locks. ### Method GET ### Endpoint /locks ### Response #### Success Response (200) - **locks** (array) - Array of lock objects - **lock_count** (integer) - Total number of locks ### Response Example { "locks": [ {"pair": "BTC/USDT", "id": "123", "until": 1678886400} ], "lock_count": 1 } ``` -------------------------------- ### View Bot State in Console Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Log the bot's current configuration and state from the Pinia store to the browser's developer console. ```typescript // In browser DevTools console.log(store.botState); // View bot config ``` -------------------------------- ### GET /profit or /profit_all Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Retrieves profit statistics, either for all trades or a specific pair. ```APIDOC ## GET /profit or /profit_all ### Description Retrieves profit statistics. Use `/profit` for a specific pair or `/profit_all` for overall stats. ### Method GET ### Endpoint /profit or /profit_all ``` -------------------------------- ### fetchPing() Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-ftbot.md Checks the bot's connectivity to ensure it is online and responsive. This method is crucial for monitoring the bot's status. ```APIDOC ## fetchPing() ### Description Checks bot connectivity. Resolves if the ping succeeds, rejects otherwise. ### Method `async function fetchPing(): Promise` ### Returns - `Promise`: A promise that resolves if the ping is successful, indicating the bot is online. Rejects if the ping fails. ### Side Effects - Sets `isBotOnline` based on the success or failure of the ping. - Stores the response in the `ping` reactive ref. ### Example ```typescript try { await store.fetchPing(); console.log('Bot is online'); } catch { console.log('Bot is offline'); } ``` ``` -------------------------------- ### GET /logs Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves recent bot logs. Supports filtering by a specified number of lines. ```APIDOC ## GET /logs ### Description Get recent bot logs. ### Method GET ### Endpoint /logs #### Query Parameters - **limit** (number) - Optional - Number of lines ### Response #### Success Response (200) - **logs** (LogLine[]) - Description not provided - **log_count** (number) - Description not provided #### Response Example ```json { "logs": [], "log_count": 0 } ``` ``` -------------------------------- ### GET /plot_config Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the plot configuration, including main and subplot indicators, for a given strategy. ```APIDOC ## GET /plot_config ### Description Get plot configuration for strategy. ### Method GET ### Endpoint /plot_config ### Parameters #### Query Parameters - **strategy** (string) - Required - Strategy name (webserver mode) ### Response #### Success Response (200) - **main_plot** (array) - Main indicators for plotting - **subplots** (array) - Subplot indicators for plotting ### Response Example { "main_plot": [ {"type": "sma", "value": 20} ], "subplots": [ {"type": "rsi", "value": 14} ] } ``` -------------------------------- ### Get Current Whitelist Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the current list of tradeable pairs. Used by the `getWhitelist()` function. ```typescript { whitelist: string[]; length: number; } ``` -------------------------------- ### GET /ping Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Checks the connectivity to the Freqtrade bot. It returns a 'pong' status if the bot is reachable. ```APIDOC ## GET /ping ### Description Checks the connectivity to the Freqtrade bot. It returns a 'pong' status if the bot is reachable. ### Method GET ### Endpoint /api/v1/ping ### Parameters ### Request Example No body ### Response #### Success Response (200) - **status** (string) - 'pong' #### Response Example ```json { "status": "pong" } ``` ``` -------------------------------- ### POST /forceentry Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/README.md Manually initiates a trade entry. ```APIDOC ## POST /forceentry ### Description Manually initiates a trade entry. ### Method POST ### Endpoint /forceentry ``` -------------------------------- ### Get Dark Theme Status Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-settings.md Checks if the current UI theme is set to dark mode. ```typescript const isDarkTheme: ComputedRef ``` -------------------------------- ### Pairlist Configuration Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/INDEX.md Manage and retrieve information about pairlist configurations. ```APIDOC ## Pairlist Configuration Endpoints ### Description Provides endpoints to manage and retrieve information related to pairlist configurations used by the bot. ### Method GET, POST ### Endpoint /pairlist ### Parameters #### Request Body (for updating pairlist) - **config** (object) - The new pairlist configuration. ### Response #### Success Response (200) - **pairlist** (object) - The current pairlist configuration. ``` -------------------------------- ### useApi Composable Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/composables-api.md Creates and configures an Axios HTTP client with built-in authentication token management, automatic token refresh, and error handling for Freqtrade bot connections. ```APIDOC ## useApi ### Description Creates and configures an Axios HTTP client with built-in authentication token management, automatic token refresh, and error handling for Freqtrade bot connections. ### Function Signature ```typescript function useApi(userService: ReturnType, botId: string): { api: AxiosInstance } ``` ### Parameters #### Parameters - **userService** (`ReturnType`) - Required - Login information composable providing authentication tokens and base URL - **botId** (`string`) - Required - Unique identifier of the bot to connect to ### Return Type Returns an object with: #### Properties - **api** (`AxiosInstance`) - Configured Axios instance ready for API calls ### Features - **Authentication**: Automatically adds `Authorization: Bearer ` header to all requests using the access token from `userService.accessToken`. - **Token Refresh**: Handles 401 Unauthorized responses automatically by calling `userService.refreshToken()`, retrying the original request with the new token, and clearing tokens if refresh fails. - **Error Handling**: Manages 401, 500, and network errors, setting bot offline status on critical failures and propagating network errors. ### Configuration - **baseURL**: `userService.baseUrl.value` - **timeout**: 20000 ms - **withCredentials**: true ### Usage Example ```typescript import { useApi } from '@/composables/api'; import { useLoginInfo } from '@/composables/loginInfo'; const botId = 'ftbot.1'; const loginInfo = useLoginInfo(botId); const { api } = useApi(loginInfo, botId); const response = await api.get('/status'); const trades = await api.get('/trades', { params: { limit: 500 } }); ``` ### Error Handling Scenarios - **401 Unauthorized**: Token automatically refreshed. The error is only thrown if the refresh also fails. - **500 or Network Error**: The bot will be marked offline automatically. Network errors are propagated to the calling code. ``` -------------------------------- ### GET /available_pairs Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of all available trading pairs. Supports filtering by timeframe and stake currency. ```APIDOC ## GET /available_pairs ### Description Get list of available trading pairs. ### Method GET ### Endpoint /available_pairs ### Parameters #### Query Parameters - **timeframe** (string) - Optional - Filter by timeframe. - **stake_currency** (string) - Optional - Filter by stake currency. ### Response #### Success Response (200) - **pairs** (string[]) - Array of available trading pairs. - **pair_interval** (Array<[string, string, string]>) - Array of [pair, timeframe, candletype] tuples. - **length** (number) - The total number of available pairs. #### Response Example ```json { "pairs": ["BTC/USDT", "ETH/BTC"], "pair_interval": [["BTC/USDT", "1h", "spot"]], "length": 2 } ``` ``` -------------------------------- ### Get Blacklist Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the current list of blacklisted pairs and the blacklist mode. Used by the `getBlacklist()` function. ```typescript { blacklist: string[]; length: number; blacklist_mode: string; } ``` -------------------------------- ### POST /forcebuy Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Manually initiates a trade entry. This endpoint is deprecated and users should refer to `forceentry`. ```APIDOC ## POST /forcebuy ### Description Manually initiates a trade entry. This endpoint is deprecated and users should refer to `forceentry`. ### Method POST ### Endpoint /api/v1/forcebuy ### Parameters #### Request Body - **ForceEnterPayload** (object) - Required - Payload for forcing a trade entry. ### Request Example (Request body is a ForceEnterPayload object) ### Response #### Success Response (200) Confirmation message with the trade ID. #### Response Example (Confirmation message with trade ID) ``` -------------------------------- ### Persistent Storage for Login Information Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/composables-other.md Demonstrates the usage of Pinia persistent storage for authentication details. The `allLoginInfos` ref automatically persists across sessions. ```typescript const allLoginInfos = useStorage(AUTH_LOGIN_INFO, {}); ``` -------------------------------- ### GET /trade/{tradeid} Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Fetches detailed information for a specific trade identified by its unique trade ID. ```APIDOC ## GET /trade/{tradeid} ### Description Fetches detailed information for a specific trade identified by its unique trade ID. ### Method GET ### Endpoint /api/v1/trade/{tradeid} ### Parameters #### Path Parameters - **tradeid** (number) - Required - Trade ID ### Request Example No body ### Response #### Success Response (200) Single `Trade` object with detailed information. #### Response Example (Response is a single Trade object) ``` -------------------------------- ### Configure Vue Router Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/configuration.md Set up Vue Router for client-side navigation. This snippet shows basic initialization with history mode and base URL. ```typescript const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes, }); ``` -------------------------------- ### Get List of Available Strategies Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of all available strategy names. This endpoint is used by the `getStrategyList()` function. ```typescript { strategies: string[]; } ``` -------------------------------- ### Settings Store API Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/INDEX.md Manages UI preferences, computed properties like theme and version, and persistence settings. ```APIDOC ## Settings Store API ### Description Manages UI preferences, computed properties like theme and version, and persistence settings. ### Methods - **Reactive State**: Access to all UI preference refs. - **Computed Properties**: Includes `isDarkTheme`, `chartTheme`, `uiVersion`. - **Methods**: `loadUIVersion()` for loading UI version. - **Enums and Types**: Defines types like `OpenTradeVizOptions` and `ThemeName`. - **Persistence**: Details on `localStorage` usage. - **Excluded from Persistence**: Identifies computed properties not saved. - **Manual State Reset**: Instructions on how to reset settings. - **Default Values**: Provides a complete settings table. - **Usage Example**: Demonstrates common operations. - **Integration with Bot Store**: Explains how settings affect bot behavior. - **Theme Switching**: Includes theme management code. - **Notification Settings**: Toggles for WebSocket event notifications. ``` -------------------------------- ### usePercentageTool Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/composables-other.md Provides utility functions for calculating percentages and conversions. It includes methods for finding a percentage of a value, calculating percent increase, and calculating percent decrease. ```APIDOC ## usePercentageTool Calculate percentages and conversions. ### Methods #### percentOf(value: number, percent: number): number Calculate percentage of value. **Example:** ```typescript const { percentOf } = usePercentageTool(); percentOf(100, 5); // 5 ``` #### percentIncrease(original: number, increased: number): number Calculate percent increase from original to new value. **Example:** ```typescript percentIncrease(100, 110); // 10 ``` #### percentDecrease(original: number, decreased: number): number Calculate percent decrease. **Example:** ```typescript percentDecrease(100, 90); // 10 ``` ``` -------------------------------- ### Get Chart Theme Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-settings.md Provides the theme value suitable for chart rendering, derived from the dark theme status. ```typescript const chartTheme: ComputedRef<'dark' | 'light'> ``` -------------------------------- ### Pairlist Configuration Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-ftbot.md Methods for managing and evaluating pairlist configurations. ```APIDOC ## getPairlists() ### Description Get the current pairlist configuration. ### Method GET ### Endpoint /api/v1/pairlists ### Response #### Success Response (200) - **PairlistsResponse** - The current pairlist configuration ``` ```APIDOC ## evaluatePairlist(payload: PairlistsPayload) ### Description Test a pairlist configuration without saving it. ### Method POST ### Endpoint /api/v1/pairlists/evaluate ### Request Body - **payload** (PairlistsPayload) - Required - The pairlist configuration to evaluate. ### Response #### Success Response (200) - **Job ID** - Job ID for async evaluation ``` ```APIDOC ## getPairlistEvalResult(jobId: string) ### Description Get the result of a pairlist evaluation. ### Method GET ### Endpoint /api/v1/pairlists/evaluate/result/{jobId} ### Parameters #### Path Parameters - **jobId** (string) - Required - The ID of the evaluation job. ### Response #### Success Response (200) - **PairlistEvalResponse** - The result of the pairlist evaluation ``` -------------------------------- ### Get Available FreqAI Models Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves a list of available FreqAI models. The response contains an array of model names. ```typescript { freqaimodels: string[]; } ``` -------------------------------- ### Get Pair Locks Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves the current list of pair locks and their total count. This endpoint is utilized by the `getLocks()` function. ```typescript { locks: any[]; lock_count: number; } ``` -------------------------------- ### Run End-to-End Tests Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/quick-start.md Execute end-to-end tests to verify the application's behavior in a simulated user environment. ```bash # E2E tests pnpm run test:e2e ``` -------------------------------- ### GET /exits Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves statistics for exit signals, detailing the number of trades and average profit associated with each exit tag. ```APIDOC ## GET /exits ### Description Retrieves statistics for exit signals, detailing the number of trades and average profit associated with each exit tag. ### Method GET ### Endpoint /api/v1/exits ### Parameters ### Request Example No body ### Response #### Success Response (200) An array of objects, where each object contains: - **exit_tag** (string) - The tag for the exit signal - **trades** (number) - Number of trades using this exit tag - **profit_mean** (number) - Average profit for trades with this exit tag #### Response Example ```json [ { "exit_tag": "my_exit", "trades": 90, "profit_mean": 1.3 } // ... more exit tags ] ``` ``` -------------------------------- ### createBotSubStore Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/api-reference/stores-ftbot.md Initializes a sub-store for a specific bot, providing access to its data and functionality. This function returns a store instance that can be used to manage bot-related states. ```APIDOC ## createBotSubStore ### Description Initializes a sub-store for a specific bot, providing access to its data and functionality. This function returns a store instance that can be used to manage bot-related states. ### Signature ```typescript export function createBotSubStore(botId: string, botName: string) ``` ### Parameters #### Path Parameters - **botId** (string) - Required - Unique bot identifier (e.g., ftbot.1) - **botName** (string) - Required - Bot display name ### Usage Example ```typescript const store = createBotSubStore('ftbot.1', 'Main Trading Bot'); ``` ``` -------------------------------- ### Get Bot Logs Source: https://github.com/freqtrade/frequi/blob/main/_autodocs/endpoints.md Retrieves recent bot logs. Specify the number of lines to fetch using the 'limit' query parameter. ```typescript { logs: LogLine[]; log_count: number; } ```