← Back to all apps

Lona

Financeby Mindsight Ventures SL

Lona helps you develop, backtest, and optimize algorithmic trading strategies using AI. Upload market data from exchanges like Binance, write trading strategies, and run comprehensive backtests to see how your strategies would have performed historically. View detailed performance reports with interactive charts showing entry/exit points, returns, and risk metrics.

17ChatGPT Tools
Mindsight Ventures SLDeveloper
FinanceCategory

Available Tools

Lona Create Strategy

lona_create_strategy
Full Description

Use this when the user has existing Backtrader Python code to upload as a new strategy.

Prefer lona_create_strategy_from_description if the user wants to create a strategy from a description instead of uploading existing code.

Requirements for the code:

  • Must import backtrader: import backtrader as bt
  • Must define a class inheriting from bt.Strategy
  • Parameters use tuple format: params = (('name', value), ...)
  • Initialize indicators in __init__, trading logic in next()

Example:

import backtrader as bt

class Strategy(bt.Strategy):
    params = (('period', 20),)

    def __init__(self):
        self.sma = bt.indicators.SMA(period=self.p.period)

    def next(self):
        if self.data.close[0] > self.sma[0]:
            self.buy()
Parameters (2 required, 2 optional)
Required
codestring

Python Backtrader strategy code (must inherit from bt.Strategy)

namestring

Name of the strategy

Optional
descriptionstring

Description of what the strategy does

versionstring

Version string (e.g., "1.0.0")

Lona Create Strategy From Description

lona_create_strategy_from_description
Full Description

Use this when the user wants to create a new trading strategy from a natural language description. This is the recommended way to create strategies.

The tool will: 1. Analyze the user's description to extract trading requirements 2. Generate properly formatted Backtrader Python code 3. Save the strategy to the user's account 4. Return the strategy ID ready for backtesting with lona_run_backtest

Examples of valid descriptions:

  • "A momentum strategy that buys when RSI crosses above 30 and sells below 70"
  • "Trend following using 20 and 50 period moving averages with 2% stop loss"
  • "Mean reversion with Bollinger Bands - buy at lower band, sell at upper band"
  • "BTC trend strategy using EMA crossover with ADX filter and ATR-based stops"
Parameters (1 required, 3 optional)
Required
descriptionstring

Natural language description of the trading strategy you want to create

Optional
modelstring

Specific model to use (provider-specific)

namestring

Optional name for the strategy. If not provided, a name will be auto-generated based on the description.

providerstring

AI provider to use (default: xai)

Options:xaiopenaianthropicgoogle

Lona Download Market Data

lona_download_market_data
Full Description

Use this when the user wants to download cryptocurrency data from Binance for backtesting. Automatically downloads, processes, and uploads data to the user's Lona account.

Supported intervals: 1m, 5m, 15m, 30m, 1h, 4h, 1d

Practical limits (Binance REST API):

  • 1m data: up to ~6 months
  • 5m data: up to ~2 years
  • 1h+ data: several years of history

Returns a symbol ID that can be used immediately with lona_run_backtest.

Parameters (4 required, 1 optional)
Required
end_datestring

End date in YYYY-MM-DD format (e.g., 2024-12-31)

intervalstring

Candle interval/timeframe

Options:1m5m15m30m1h4h1d
start_datestring

Start date in YYYY-MM-DD format (e.g., 2024-01-01)

symbolstring

Trading pair (e.g., BTCUSDT, ETHUSDT, BNBUSDT). Must be a valid Binance spot pair.

Optional
namestring

Optional custom name for the symbol. If not provided, auto-generates name like "BTCUSDT-1h-2024-01-01-to-2024-12-31"

Lona Get Full Report

lona_get_full_report
Full Description

Use this when the user wants comprehensive backtest results including detailed metrics, trade history, and per-symbol performance breakdown. For visual trade analysis, follow up with lona_get_report_chart.

Parameters (1 required)
Required
idstring

The report ID to retrieve in full

Lona Get Report

lona_get_report
Full Description

Use this when the user wants to see a backtest report summary. Returns key performance metrics including total return, Sharpe ratio, maximum drawdown, win rate, and number of trades.

Parameters (1 required)
Required
idstring

The report ID to retrieve

Lona Get Report Chart

lona_get_report_chart
Full Description

Use this when the user wants to visualize a backtest on a chart. Displays an interactive candlestick chart with buy/sell markers showing entry and exit points. Only works for completed reports.

Parameters (1 required)
Required
idstring

The report ID to visualize

Lona Get Report Status

lona_get_report_status
Full Description

Use this to check the progress of a running backtest. Returns current status (PENDING, EXECUTING, PROCESSING, COMPLETED, or FAILED) and whether the backtest is complete. Call this after lona_run_backtest to monitor progress.

Parameters (1 required)
Required
idstring

The report ID to check status for

Lona Get Strategy

lona_get_strategy
Full Description

Use this when the user wants details about a specific trading strategy. Requires a strategy ID. Returns the strategy name, description, version, language, and timestamps.

Parameters (1 required)
Required
idstring

The strategy ID to retrieve

Lona Get Strategy Code

lona_get_strategy_code
Full Description

Use this when the user wants to view or analyze the source code of a trading strategy. Requires a strategy ID. Returns the Python Backtrader code that implements the strategy logic.

Parameters (1 required)
Required
idstring

The strategy ID to get code for

Lona Get Symbol

lona_get_symbol
Full Description

Use this when the user wants details about a specific market data symbol. Returns the symbol name, description, data type, exchange, asset class, and whether it is a global or user-uploaded dataset.

Parameters (1 required)
Required
idstring

The symbol ID to retrieve

Lona Get Symbol Data

lona_get_symbol_data
Full Description

Use this when the user wants to preview the actual price data for a symbol. Returns OHLCV (Open, High, Low, Close, Volume) time-series data. Useful for verifying data quality before running a backtest.

Parameters (1 required)
Required
idstring

The symbol ID to get data for

Lona List Reports

lona_list_reports
Full Description

Use this when the user wants to see their backtest reports or check on running backtests. Returns reports with status, performance metrics (return, Sharpe ratio, trades), and timestamps. Filter by strategy_id or status (PENDING, EXECUTING, PROCESSING, COMPLETED, FAILED).

Parameters (0 required, 4 optional)
Optional
limitnumber

Maximum number of reports to return (default: 20)

skipnumber

Number of reports to skip (for pagination)

statusstring

Filter reports by status

Options:PENDINGEXECUTINGPROCESSINGCOMPLETEDFAILED
strategy_idstring

Filter reports by strategy ID

Lona List Strategies

lona_list_strategies
Full Description

Use this when the user wants to see their trading strategies or find a specific strategy. Returns a list of strategies with names, IDs, descriptions, and version info. Supports pagination via skip/limit parameters.

Parameters (0 required, 2 optional)
Optional
limitnumber

Maximum number of strategies to return (default: 20)

skipnumber

Number of strategies to skip (for pagination)

Lona List Symbols

lona_list_symbols
Full Description

Use this when the user wants to see available market data for backtesting. Returns user-uploaded data files by default. Set isGlobal=true to see pre-loaded market data (US equities, crypto, forex). Each symbol has an ID used with lona_run_backtest.

Parameters (0 required, 3 optional)
Optional
isGlobalboolean

If true, returns pre-loaded global symbols. If false or omitted, returns user-uploaded symbols (default behavior).

limitnumber

Maximum number of symbols to return (default: 20)

skipnumber

Number of symbols to skip (for pagination)

Lona Register Agent

lona_register_agent
Full Description

Register this AI agent and provision a short-lived API token.

Use this before any other Lona tools if you do not already have an API token. Works automatically: uses registration secret if configured, otherwise requests an invite code from the gateway.

Parameters (1 required, 6 optional)
Required
agent_idstring

Unique agent identifier (becomes partner_id)

Optional
agent_namestring

Human-readable agent name

agent_user_idstring

User ID for Lona requests (defaults to agent_id)

expires_in_daysnumber

Optional token TTL override (days)

metadataobject

Optional metadata stored with the token

permissionsarray

Optional permission list

sourcestring

Registration source (e.g., moltbook)

Lona Run Backtest

lona_run_backtest
Full Description

Use this when the user wants to test a trading strategy on historical data. Requires a strategy_id (from lona_list_strategies) and data_ids (from lona_list_symbols or lona_download_market_data).

The backtest runs asynchronously. Returns a report_id to track progress via lona_get_report_status.

Configurable parameters:

  • initial_cash: Starting capital (default: 100000)
  • commission: Trading commission as decimal (default: 0.001 = 0.1%)
  • leverage: Maximum leverage allowed (default: 1)
  • parameters: Override strategy parameters (passed to the strategy's params tuple)
Parameters (4 required, 5 optional)
Required
data_idsarray

Array of symbol IDs to use as data sources

end_datestring

End date for backtest (ISO format: YYYY-MM-DD)

start_datestring

Start date for backtest (ISO format: YYYY-MM-DD)

strategy_idstring

The ID of the strategy to backtest

Optional
buy_on_closeboolean

Execute buy orders at close price (default: true)

commissionnumber

Commission rate as decimal (default: 0.001)

initial_cashnumber

Initial cash for simulation (default: 100000)

leveragenumber

Maximum leverage (default: 1)

parametersarray

Strategy parameters to override defaults

Lona Update Strategy

lona_update_strategy
Full Description

Use this when the user wants to modify an existing trading strategy. Requires the strategy ID. You can update the name, description, or code individually or all at once.

Parameters (1 required, 3 optional)
Required
idstring

The strategy ID to update

Optional
codestring

New Python Backtrader code

descriptionstring

New description for the strategy

namestring

New name for the strategy