Skip to main content
Glama
sv

MCP Paradex Server

by sv

paradex_klines

Analyze historical price data for technical analysis, calculate indicators, identify support/resistance levels, and backtest trading strategies.

Instructions

Analyze historical price patterns for technical analysis and trading decisions. Use this tool when you need to: - Perform technical analysis on historical price data - Identify support and resistance levels from price history - Calculate indicators like moving averages, RSI, or MACD - Backtest trading strategies on historical data - Visualize price action over specific timeframes Candlestick data is fundamental for most technical analysis and trading decisions, providing structured price and volume information over time. Example use cases: - Identifying chart patterns for potential entries or exits - Calculating technical indicators for trading signals - Determining volatility by analyzing price ranges - Finding significant price levels from historical support/resistance - Measuring volume patterns to confirm price movements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket symbol to get klines for.
resolutionNoThe time resolution of the klines.
start_unix_msYesStart time in unix milliseconds.
end_unix_msYesEnd time in unix milliseconds.

Implementation Reference

  • The main execution logic for the paradex_klines tool. Fetches historical kline (OHLCV) data from the Paradex API for a given market, resolution, and time range, parses the raw response into OHLCV objects, and returns the list.
    @server.tool(name="paradex_klines") async def get_klines( market_id: Annotated[str, Field(description="Market symbol to get klines for.")], resolution: Annotated[ KLinesResolutionEnum, Field(default=1, description="The time resolution of the klines.") ], start_unix_ms: Annotated[int, Field(description="Start time in unix milliseconds.")], end_unix_ms: Annotated[int, Field(description="End time in unix milliseconds.")], ctx: Context = None, ) -> list[OHLCV]: """ Analyze historical price patterns for technical analysis and trading decisions. Use this tool when you need to: - Perform technical analysis on historical price data - Identify support and resistance levels from price history - Calculate indicators like moving averages, RSI, or MACD - Backtest trading strategies on historical data - Visualize price action over specific timeframes Candlestick data is fundamental for most technical analysis and trading decisions, providing structured price and volume information over time. Example use cases: - Identifying chart patterns for potential entries or exits - Calculating technical indicators for trading signals - Determining volatility by analyzing price ranges - Finding significant price levels from historical support/resistance - Measuring volume patterns to confirm price movements """ try: # Get klines from Paradex client = await get_paradex_client() response = await api_call( client, "markets/klines", params={ "symbol": market_id, "resolution": str(resolution), "start_at": start_unix_ms, "end_at": end_unix_ms, }, ) if "error" in response: raise Exception(response["error"]) results = response["results"] list_of_ohlcv = [ OHLCV( timestamp=result[0], open=result[1], high=result[2], low=result[3], close=result[4], volume=result[5], ) for result in results ] return list_of_ohlcv except Exception as e: await ctx.error(f"Error fetching klines for {market_id}: {e!s}") raise e
  • Pydantic model defining the output schema for each kline data point returned by the tool.
    class OHLCV(BaseModel): """OHLCV data for a market.""" timestamp: int open: float high: float low: float close: float volume: float
  • Type definition for the resolution parameter (timeframe in minutes: 1,3,5,15,30,60).
    KLinesResolutionEnum = Literal[1, 3, 5, 15, 30, 60]
  • Tool registration decorator that registers the get_klines function as the MCP tool named paradex_klines.
    @server.tool(name="paradex_klines")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sv/mcp-paradex-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server