Contents Menu Expand Light mode Dark mode Auto light/dark mode
Trading Strategy documentation
  • Documention home
  • Getting started
  • Overview
    • About Trading Strategy
    • Supported markets and venues
    • Accessing market data
    • Tooling
    • Oracles
    • Wrapped tokens
  • Developing strategies
    • Setting up development environment
      • Visual Studio Code Dev Container for Jupyter Notebooks
      • Docker development image
      • Binder development
      • Local Python installation
      • Google Colab
    • Code examples
      • Getting started coding tutorial
      • Drawing DEX prices using OHLCV candle charts
      • Interactive charts
      • Technical analysis
      • Exploring trading pairs
      • Finding low fee trading pairs
      • Preface
      • Liquidity analysis
      • Price impact estimation
      • Query pool liquidity on a decentralised exchange
      • Dataset download
      • Charts and diagrams (old)
      • Aave v3 candles
      • Loading exchange, pair, and candlestick data for Uniswap V3
      • Streaming JSONL data
    • Strategy examples
      • Running the strategy backtests and examples
      • EMA crossover strategy
      • EMA cross over strategy with stop loss
      • Exploring the Power of Detached Technical Indicators
      • Portfolio construction model trading strategy example
      • Portfolio construction model example 2 (Trader Joe)
      • TradingView’s PineScript strategy conversion example
      • Grid search example
      • Synthetic data backtesting example
      • Synthetic data w/stop loss backtesting example
      • Backtesting fee analysis
      • Examining live trading strategy using notebook
      • Debugging live strategy
      • Osmosis ATOM-OSMO mean reversion strategy
      • Backtest template
      • Momentum Crossover Strategy
      • Osmosis synthetic data backtesting example
      • Examine live strategy 2
      • Tags overview
        • advanced (4)
          • Grid search example
          • Momentum Crossover Strategy
          • Portfolio construction model trading strategy example
          • Portfolio construction model example 2 (Trader Joe)
        • alpha-model (2)
          • Portfolio construction model trading strategy example
          • Portfolio construction model example 2 (Trader Joe)
        • bollinger-bands (2)
          • TradingView’s PineScript strategy conversion example
          • Grid search example
        • dark-theme (1)
          • Osmosis ATOM-OSMO mean reversion strategy
        • debugging (1)
          • Debugging live strategy
        • ema (8)
          • Osmosis synthetic data backtesting example
          • Momentum Crossover Strategy
          • Osmosis ATOM-OSMO mean reversion strategy
          • Exploring the Power of Detached Technical Indicators
          • EMA cross over strategy with stop loss
          • EMA crossover strategy
          • Synthetic data w/stop loss backtesting example
          • Synthetic data backtesting example
        • fee-analysis (1)
          • Backtesting fee analysis
        • get-started (4)
          • TradingView’s PineScript strategy conversion example
          • Exploring the Power of Detached Technical Indicators
          • EMA cross over strategy with stop loss
          • EMA crossover strategy
        • grid-search (1)
          • Grid search example
        • live-strategy (3)
          • Debugging live strategy
          • Examining live trading strategy using notebook
          • Examine live strategy 2
        • mean-reversion (2)
          • TradingView’s PineScript strategy conversion example
          • Grid search example
        • momentum (2)
          • Momentum Crossover Strategy
          • Portfolio construction model trading strategy example
        • multipair (2)
          • Portfolio construction model trading strategy example
          • Portfolio construction model example 2 (Trader Joe)
        • old (1)
          • Backtest template
        • rsi (3)
          • TradingView’s PineScript strategy conversion example
          • Grid search example
          • Momentum Crossover Strategy
        • sma (1)
          • Portfolio construction model example 2 (Trader Joe)
        • stop-loss (7)
          • TradingView’s PineScript strategy conversion example
          • Grid search example
          • Momentum Crossover Strategy
          • Exploring the Power of Detached Technical Indicators
          • EMA cross over strategy with stop loss
          • Synthetic data w/stop loss backtesting example
          • Portfolio construction model example 2 (Trader Joe)
        • synthetic-data (5)
          • Backtesting fee analysis
          • Osmosis synthetic data backtesting example
          • Osmosis ATOM-OSMO mean reversion strategy
          • Synthetic data w/stop loss backtesting example
          • Synthetic data backtesting example
        • template (1)
          • Backtest template
        • trend-analysis (8)
          • Osmosis synthetic data backtesting example
          • Osmosis ATOM-OSMO mean reversion strategy
          • Exploring the Power of Detached Technical Indicators
          • EMA cross over strategy with stop loss
          • EMA crossover strategy
          • Synthetic data w/stop loss backtesting example
          • Synthetic data backtesting example
          • Portfolio construction model example 2 (Trader Joe)
    • API documentation
      • Market data client
        • client
          • BaseClient
          • Client
        • chain
          • ChainId
        • exchange
          • Exchange
          • ExchangeType
          • ExchangeUniverse
        • pair
          • DEXPair
          • LegacyPairUniverse
          • PandasPairUniverse
          • StablecoinFilteringMode
          • filter_for_exchanges
          • filter_for_quote_tokens
          • filter_for_stablecoins
          • generate_address_columns
          • resolve_pairs_based_on_ticker
        • candle
          • Candle
          • CandleResult
          • GroupedCandleUniverse
          • TradingPairDataAvailability
          • is_candle_green
          • is_candle_red
        • liquidity
          • GroupedLiquidityUniverse
          • LiquidityResult
          • ResampledLiquidityUniverse
          • XYLiquidity
        • timebucket
          • TimeBucket
        • token
          • Token
        • reader
          • read_parquet
        • priceimpact
          • HistoricalXYPriceImpactCalculator
          • LiquiditySampleMeasure
          • PriceImpact
          • estimate_xyk_price_impact
        • stablecoin
          • is_stablecoin_like
        • types
        • utils
          • columnar
            • iterate_columnar_dicts
          • format
            • format_duration_days_hours_mins
            • format_percent
            • format_percent_2_decimals
            • format_price
            • format_value
          • forward_fill
            • forward_fill
          • groupeduniverse
            • PairGroupedUniverse
            • filter_bad_wicks
            • filter_for_pairs
            • filter_for_single_pair
            • fix_bad_wicks
            • resample_candles
          • jupyter
            • JupyterOutputMode
            • display_with_styles
            • get_notebook_output_mode
            • is_pyodide
          • schema
            • append_to_columnar_work_buffer
            • create_columnar_work_buffer
            • create_pyarrow_schema_for_dataclass
            • map_field_to_arrpw
            • unmappable
          • time
            • assert_compatible_timestamp
            • is_compatible_timestamp
            • to_int_unix_timestamp
        • transport
          • base
            • BaseTransport
          • cache
            • CachedHTTPTransport
          • data_trigger
            • wait_for_data
          • jsonl
            • load_candles_jsonl
            • load_trading_strategy_like_jsonl_data
          • pyodide
        • charting
          • candle_chart
            • VolumeBarMode
            • create_label
            • make_candle_labels
            • validate_ohclv_dataframe
            • validate_plot_info
            • visualise_ohlcv
        • testing
          • mock_client
            • MockClient
          • uniswap_v2_mock_client
            • UniswapV2MockClient
        • direct_feed
          • candle_feed
            • CandleFeed
            • prepare_raw_candle_data
          • conversion
            • CurrencyConversion
            • convert_to_float
          • dash
          • direct_feed_pair
          • ohlcv_aggregate
            • OHLCVCandle
            • get_feed_for_pair
            • resample_trades_into_ohlcv
            • truncate_ohlcv
          • store
            • DirectFeedStore
          • synthetic_feed
            • SyntheticTradeFeed
          • timeframe
            • Timeframe
          • trade_feed
            • SaveHook
            • Trade
            • TradeDelta
            • TradeFeed
          • trade_store
            • ParquetFileStore
            • TradeFeedStore
          • uniswap_v2
            • SwapKind
            • UniswapV2TradeFeed
            • calculate_reserve_price_in_quote_token_decimal
            • decode_swap
            • decode_sync
          • warn
            • disable_pandas_warnings
      • Trade execution engine
        • state
          • balance_update
            • BalanceUpdate
            • BalanceUpdateCause
            • BalanceUpdatePositionType
          • blockhain_transaction
            • BlockchainTransaction
            • BlockchainTransactionType
            • JSONAssetDelta
            • solidity_arg_encoder
          • freeze
            • freeze_position_on_failed_trade
          • generic_position
            • GenericPosition
          • identifier
            • AssetIdentifier
            • TradingPairIdentifier
          • metadata
            • EnzymeSmartContracts
            • Metadata
            • OnChainData
          • pickle_over_json
            • decode_pickle_over_json
            • encode_pickle_over_json
          • portfolio
            • Portfolio
          • position
            • PositionType
            • TradingPosition
            • TriggerPriceUpdate
          • repair
            • RepairResult
            • find_trades_to_be_repaired
            • make_counter_trade
            • reconfirm_trade
            • repair_trade
            • repair_trades
            • unfreeze_position
          • reserve
            • ReservePosition
          • revaluation
            • RevalueEvent
          • state
            • BacktestData
            • State
          • statistics
            • FinalPositionStatistics
            • PortfolioStatistics
            • PositionStatistics
            • Statistics
            • calculate_naive_profitability
          • store
            • JSONFileStore
            • NoneStore
            • StateStore
            • StateStoreModel
          • sync
            • Accounting
            • BalanceEventRef
            • Deployment
            • Sync
            • Treasury
          • trade
            • TradeExecution
            • TradeStatus
            • TradeType
          • types
          • uptime
            • Uptime
          • validator
            • validate_nested_state_dict
            • validate_state_serialisation
            • validate_state_value
            • walk
          • visualisation
            • Plot
            • PlotKind
            • PlotShape
            • RecordingTime
            • Visualisation
        • strategy
          • account_correction
            • AccountingBalanceCheck
            • AccountingCorrectionCause
            • apply_accounting_correction
            • calculate_account_corrections
            • check_accounts
            • correct_accounts
            • transfer_away_assets_without_position
          • alpha_model
            • AlphaModel
            • TradingPairSignal
          • approval
            • ApprovalModel
            • ApprovalType
            • UncheckedApprovalModel
          • asset
            • get_relevant_assets
            • map_onchain_asset_to_position
          • bootstrap
            • bootstrap_strategy
            • import_strategy_file
            • make_factory_from_strategy_mod
          • cycle
            • CycleDuration
            • round_datetime_down
            • round_datetime_up
            • snap_to_next_tick
            • snap_to_previous_tick
          • default_routing_options
            • TradeRouting
          • description
            • StrategyExecutionDescription
          • dummy
            • DummyExecutionModel
          • execution_context
            • ExecutionContext
            • ExecutionMode
          • execution_model
            • AssetManagementMode
            • ExecutionModel
            • RoutingStateDetails
          • factory
            • StrategyFactory
          • output
            • format_position
            • format_trade
            • output_positions
            • output_trades
          • pandas_trader
            • decision_trigger
              • UpdatedUniverseResult
              • fetch_availability
              • fetch_data
              • update_universe
              • validate_latest_candles
              • wait_for_universe_data_availability_jsonl
            • position_manager
              • PositionManager
            • rebalance
              • get_existing_portfolio_weights
              • get_weight_diffs
              • rebalance_portfolio_old
            • runner
              • PandasTraderRunner
            • trade_decision
              • TradeDecider
          • pricing_model
            • PricingModel
          • qstrader
            • alpha_model
              • AlphaModel
            • order_sizer
              • CashBufferedOrderSizer
            • portfolio_construction_model
              • PortfolioConstructionModel
            • runner
              • QSTraderRunner
          • reserve_currency
            • ReserveCurrency
          • reverse_universe
            • DataRangeMode
            • reverse_trading_universe_from_state
          • routing
            • RoutingModel
            • RoutingState
          • run_state
            • ExceptionData
            • LatestStateVisualisation
            • RunState
          • runner
            • StrategyRunner
          • stop_loss
            • check_position_triggers
            • report_position_triggered
          • strategy_cycle_trigger
            • StrategyCycleTrigger
          • strategy_module
            • CreateTradingUniverseProtocol
            • DecideTradesProtocol
            • StrategyModuleInformation
            • parse_strategy_module
            • pregenerated_create_trading_universe
            • read_strategy_module
          • strategy_type
            • StrategyType
          • summary
            • KeyMetric
            • KeyMetricCalculationMethod
            • KeyMetricKind
            • KeyMetricSource
            • StrategySummary
            • StrategySummaryStatistics
          • sync_model
            • DummySyncModel
            • OnChainBalance
            • SyncModel
          • trade_pricing
            • TradePricing
            • format_fees_dollars
            • format_fees_percentage
          • trading_strategy_universe
            • Dataset
            • DefaultTradingStrategyUniverseModel
            • TradingStrategyUniverse
            • TradingStrategyUniverseModel
            • create_pair_universe_from_code
            • load_all_data
            • load_pair_data_for_single_exchange
            • load_partial_data
            • translate_token
            • translate_trading_pair
          • universe_model
            • StaticUniverseModel
            • StrategyExecutionUniverse
            • UniverseModel
            • UniverseOptions
          • valuation
            • ValuationModel
            • ValuationModelFactory
          • weighting
            • check_normalised_weights
            • clip_to_normalised
            • normalise_weights
            • weight_by_1_slash_n
            • weight_equal
            • weight_passthrouh
        • analysis
          • advanced_metrics
            • AdvancedMetricsMode
            • calculate_advanced_metrics
            • visualise_advanced_metrics
          • alpha_model_analyser
            • analyse_alpha_model_weights
            • construct_event_timeline
            • create_alpha_model_timeline_all_assets
            • create_pair_weight_analysis_summary_table
            • render_alpha_model_plotly_table
          • fee_analyser
            • analyse_trading_fees
            • create_pair_trading_fee_summary_table
          • grid_search
            • analyse_combination
            • analyse_grid_search_result
            • visualise_heatmap_2d
            • visualise_table
          • multipair
            • analyse_multipair
            • analyse_pair_trades
            • format_multipair_summary
            • make_clickable
          • position
            • display_positions
            • display_reserve_position_events
          • slippage
            • display_slippage
          • trade_analyser
            • TimelineRowStylingMode
            • TimelineStyler
            • TradeAnalysis
            • TradeSummary
            • avg
            • avg_timedelta
            • build_trade_analysis
            • expand_timeline
            • expand_timeline_raw
        • visual
          • benchmark
            • visualise_all_cash
            • visualise_benchmark
            • visualise_buy_and_hold
            • visualise_portfolio_equity_curve
          • custom_indicators
            • calculate_on_balance_volume
          • equity_curve
            • calculate_aggregate_returns
            • calculate_compounding_realised_trading_profitability
            • calculate_cumulative_return
            • calculate_daily_returns
            • calculate_deposit_adjusted_returns
            • calculate_equity_curve
            • calculate_investment_flow
            • calculate_realised_profitability
            • calculate_returns
            • calculate_size_relative_realised_trading_returns
            • visualise_equity_curve
            • visualise_returns_distribution
            • visualise_returns_over_time
          • image_output
            • open_plotly_figure_in_browser
            • render_plotly_figure_as_image_file
          • multiple_pairs
            • PairSubplotInfo
            • get_start_and_end_full
            • visualise_multiple_pairs
          • single_pair
            • get_position_hover_text
            • visualise_positions_with_duration_and_slippage
            • visualise_single_pair
            • visualise_single_pair_positions_with_duration_and_slippage
          • strategy_state
            • draw_multi_pair_strategy_state
            • draw_single_pair_strategy_state
            • visualise_single_pair_strategy_state
          • technical_indicator
            • export_plot_as_dataframe
            • overlay_all_technical_indicators
            • visualise_technical_indicator
          • utils
            • export_trade_for_dataframe
            • export_trades_as_dataframe
            • get_all_positions
            • get_all_text
            • get_num_detached_and_names
            • get_pair_base_quote_names
            • get_pair_name_from_first_trade
            • get_start_and_end
            • visualise_trades
          • web_chart
            • TimeWindow
            • WebChart
            • WebChartSource
            • WebChartType
            • export_time_series
            • render_web_chart
        • backtest
          • backtest_execution
            • BacktestExecutionModel
            • fix_sell_token_amount
          • backtest_pricing
            • BacktestSimplePricingModel
            • backtest_pricing_factory
          • backtest_routing
            • BacktestRoutingIgnoredModel
            • BacktestRoutingModel
            • BacktestRoutingState
          • backtest_runner
            • BacktestSetup
            • guess_data_delay_tolerance
            • run_backtest
            • run_backtest_inline
            • setup_backtest
            • setup_backtest_for_universe
          • backtest_sync
            • BacktestSyncModel
            • FundFlowEvent
          • backtest_valuation
            • BacktestValuationModel
            • backtest_valuation_factory
          • data_preload
            • preload_data
          • grid_search
            • GridCombination
            • GridParameter
            • GridSearchResult
            • GridSearchWorker
            • perform_grid_search
            • pick_best_grid_search_result
            • pick_grid_search_result
            • prepare_grid_combinations
            • run_grid_combination
            • run_grid_combination_multiprocess
            • run_grid_search_backtest
          • legacy_backtest_sync
            • BacktestSyncer
          • notebook
            • OutputMode
            • setup_charting_and_output
          • report
            • BacktestReporter
            • export_backtest_report
          • simulated_wallet
            • SimulatedWallet
        • ethereum
          • enzyme
            • asset
              • EnzymeAsset
              • EnzymeAssetType
              • load_enzyme_asset_list
            • tx
              • EnzymeTransactionBuilder
            • vault
              • EnzymeVaultSyncModel
          • eth_pricing_model
            • EthereumPricingModel
          • eth_valuation
            • EthereumPoolRevaluator
          • ethereumtrader
            • EthereumTrader
            • get_base_quote_contracts
            • get_mock_erc20_contract
          • execution
            • EthereumExecutionModel
            • approve_infinity
            • approve_tokens
            • broadcast
            • confirm_approvals
            • get_held_assets
            • get_swap_transactions
            • is_swap_function
            • prepare_swaps
            • report_failure
            • translate_to_naive_swap
            • update_confirmation_status
            • wait_trades_to_complete
          • hot_wallet_sync_model
            • HotWalletSyncModel
            • EthereumHotWalletReserveSyncer
          • onchain_balance
            • fetch_address_balances
          • revert
            • clean_revert_reason_message
          • routing_data
            • RoutingData
            • create_compatible_routing
            • create_uniswap_v2_compatible_routing
            • create_uniswap_v3_compatible_routing
            • get_backtest_routing_model
            • get_pancake_default_routing_parameters
            • get_quickswap_default_routing_parameters
            • get_routing_model
            • get_trader_joe_default_routing_parameters
            • get_uniswap_v2_compatible_routing_types
            • get_uniswap_v2_default_routing_parameters
            • get_uniswap_v3_compatible_routing_types_eth
            • get_uniswap_v3_compatible_routing_types_poly
            • get_uniswap_v3_ethereum_default_routing_parameters
            • get_uniswap_v3_polygon_default_routing_parameters
            • validate_reserve_currency
          • routing_model
            • EthereumRoutingModel
          • routing_state
            • EthereumRoutingState
            • get_base_quote
            • get_base_quote_intermediary
            • get_token_for_asset
            • route_tokens
          • token
            • fetch_token_as_asset
            • translate_token_details
          • tx
            • HotWalletTransactionBuilder
            • TransactionBuilder
          • uniswap_v2
            • uniswap_v2_execution
              • UniswapV2ExecutionModel
              • get_current_price
            • uniswap_v2_execution_v0
              • UniswapV2ExecutionModelVersion0
              • UniswapV2RoutingInstructions
              • broadcast_and_resolve
              • resolve_trades
            • uniswap_v2_live_pricing
              • UniswapV2LivePricing
              • uniswap_v2_live_pricing_factory
            • uniswap_v2_routing
              • UniswapV2RoutingState
              • UniswapV2SimpleRoutingModel
              • get_uniswap_for_pair
            • uniswap_v2_valuation
              • UniswapV2PoolRevaluator
              • uniswap_v2_sell_valuation_factory
            • uniswap_v2_valuation_v0
              • UniswapV2PoolValuationMethodV0
              • uniswap_v2_sell_valuation_factory
          • uniswap_v3
            • uniswap_v3_execution
              • UniswapV3ExecutionModel
              • get_current_price
            • uniswap_v3_live_pricing
              • UniswapV3LivePricing
              • uniswap_v3_live_pricing_factory
            • uniswap_v3_routing
              • UniswapV3RoutingState
              • UniswapV3SimpleRoutingModel
              • get_uniswap_for_pair
            • uniswap_v3_valuation
              • UniswapV3PoolRevaluator
              • uniswap_v3_sell_valuation_factory
          • universe
            • create_exchange_universe
            • create_pair_universe
          • wallet
            • ReserveUpdateEvent
            • sync_reserves
            • update_wallet_balances
          • web3config
            • Web3Config
        • cli
          • approval
            • CLIApprovalModel
          • bootstrap
            • create_approval_model
            • create_client
            • create_execution_and_sync_model
            • create_execution_model
            • create_metadata
            • create_state_store
            • create_sync_model
            • create_web3_config
            • monkey_patch
            • prepare_cache
            • prepare_executor_id
            • validate_executor_id
          • close_all
            • close_all
          • commands
            • app
            • backtest
              • backtest
            • check_accounts
              • check_accounts
            • check_universe
              • check_universe
            • check_wallet
              • check_wallet
            • close_all
              • close_all
            • console
              • console
              • launch_console
            • correct_accounts
              • correct_accounts
            • enzyme_asset_list
              • enzyme_asset_list
            • enzyme_deploy_vault
              • enzyme_deploy_vault
            • hello
              • hello
            • init
              • init
            • perform_test_trade
              • parse_pair_data
              • perform_test_trade
            • reinit
              • reinit
            • repair
              • repair
            • shared_options
            • show_positions
              • show_positions
            • start
              • start
            • version
              • version
          • discord
            • get_discord_logging_handler
            • post_logging_discord_image
          • env
            • EnvVarDescription
            • get_available_env_vars
          • latest_release
            • main
          • log
            • get_ring_buffer_handler
            • setup_custom_log_levels
            • setup_discord_logging
            • setup_file_logging
            • setup_in_memory_logging
            • setup_logging
            • setup_logstash_logging
            • setup_notebook_logging
            • setup_pytest_logging
          • loop
            • ExecutionLoop
            • ExecutionTestHook
          • main
          • result
            • display_backtesting_results
          • testtrade
            • make_test_trade
          • version_info
            • VersionInfo
          • watchdog
            • WatchdogMode
            • check_hung_workers
            • create_watchdog_registry
            • get_last_ping
            • get_timeout
            • get_watched_workers
            • mark_alive
            • register_worker
            • start_background_watchdog
            • stop_watchdog
            • suicide
        • utils
          • accuracy
            • setup_decimal_accuracy
            • sum_decimal
          • blockchain
            • get_latest_block_timestamp
          • crossover
            • contains_cross_over
            • contains_cross_under
          • dataclass
            • EthereumAddress
            • UTCFriendlyDataClassJsonMixin
          • format
            • calculate_percentage
          • fullname
            • get_object_full_name
          • price
            • is_legit_price_value
          • python_module_loader
            • extract_module_members
            • import_python_source_file
          • ring_buffer_logging_handler
            • ExportedRecord
            • RingBufferHandler
          • summarydataframe
            • Format
            • Value
            • as_bars
            • as_dollar
            • as_duration
            • as_integer
            • as_missing
            • as_percent
            • create_summary_table
            • format_value
            • format_values
          • timer
            • timed_task
          • timestamp
            • convert_and_validate_timestamp
            • convert_and_validate_timestamp_as_float
            • convert_and_validate_timestamp_as_int
            • json_decode_timedelta
            • json_encode_timedelta
          • typing
          • url
            • get_url_domain
            • redact_url_password
        • webhook
          • api
            • web_chart
            • web_file
            • web_home
            • web_logs
            • web_metadata
            • web_notify
            • web_ping
            • web_source
            • web_state
            • web_status
            • web_visulisation
          • app
            • Root
            • create_pyramid_app
            • forbidden_view
            • init_web_api
          • error
            • convert_to_api_error_response
            • error_tween_factory
            • exception_response
            • exception_view
          • events
            • add_cors_headers
          • server
            • WebhookServer
            • create_webhook_server
        • testing
          • backtest_trader
            • BacktestTrader
          • dummy_trader
            • DummyTestTrader
          • dummy_wallet
            • DummyWalletSyncer
            • apply_sync_events
          • ethereumtrader_uniswap_v2
            • UniswapV2TestTrader
          • ethereumtrader_uniswap_v3
            • UniswapV3TestTrader
          • pairuniversetrader
            • PairUniverseTestTrader
          • simulated_execution_loop
            • set_up_simulated_execution_loop_uniswap_v2
            • set_up_simulated_execution_loop_uniswap_v3
          • simulated_trader
            • SimulatedTestTrader
          • synthetic_ethereum_data
            • generate_random_ethereum_address
          • synthetic_exchange_data
            • generate_exchange
            • generate_simple_routing_model
          • synthetic_pair_data
            • generate_pair
          • synthetic_price_data
            • generate_fixed_price_candles
            • generate_ohlcv_candles
            • load_ohlcv_parquet_file
          • synthetic_universe_data
            • create_synthetic_single_pair_universe
        • monkeypatch
          • dataclasses_json
            • patch_dataclasses_json
          • web3
            • construct_sign_and_send_raw_middleware
      • Technical analysis
        • Statistics
          • entropy
          • kurtosis
          • mad
          • median
          • skew
          • stdev
          • tos_stdevall
          • variance
          • zscore
        • Overlap and moving averages
          • alma
          • dema
          • ema
          • fwma
          • hilo
          • hl2
          • hlc3
          • hma
          • hwma
          • ichimoku
          • jma
          • kama
          • linreg
          • ma
          • mcgd
          • midpoint
          • midprice
          • ohlc4
          • pwma
          • rma
          • sinwma
          • sma
          • ssf
          • supertrend
          • swma
          • t3
          • tema
          • trima
          • vidya
          • vwap
          • vwma
          • wcp
          • wma
          • zlma
        • Trend indicators
          • adx
          • amat
          • aroon
          • chop
          • cksp
          • decay
          • decreasing
          • dpo
          • increasing
          • long_run
          • psar
          • qstick
          • short_run
          • tsignals
          • ttm_trend
          • vhf
          • vortex
          • xsignals
        • Momentum indicators
          • ao
          • apo
          • bias
          • bop
          • brar
          • cci
          • cfo
          • cg
          • cmo
          • coppock
          • cti
          • dm
          • er
          • eri
          • fisher
          • inertia
          • kdj
          • kst
          • macd
          • mom
          • pgo
          • ppo
          • psl
          • pvo
          • qqe
          • roc
          • rsi
          • rsx
          • rvgi
          • slope
          • smi
          • squeeze
          • squeeze_pro
          • stc
          • stoch
          • stochrsi
          • td_seq
          • trix
          • tsi
          • uo
          • willr
        • Volatility indicators
          • aberration
          • accbands
          • atr
          • bbands
          • donchian
          • hwc
          • kc
          • massi
          • natr
          • pdist
          • rvi
          • thermo
          • true_range
          • ui
        • Volume based indicators
          • ad
          • adosc
          • aobv
          • cmf
          • efi
          • eom
          • kvo
          • mfi
          • nvi
          • obv
          • pvi
          • pvol
          • pvr
          • pvt
          • vp
        • Candle pattern indicators
          • cdl_doji
          • cdl_inside
          • cdl_pattern
          • cdl_z
          • ha
        • Market cycles
          • ebsw
        • Portfolio performance
          • drawdown
          • log_return
          • percent_return
      • Web3 Ethereum DeFi
    • Market data format details
      • Market data client
      • OHLCV Candle format
      • Tracked trading pairs and tokens
      • US dollar price conversion
      • Trading pair naming conventions
      • Internal ids
      • Token tax and deflationary tokens
      • Good trading pairs to start with
      • Profitability calculations
    • Troubleshooting
    • Internal development process
    • Old example strategies
      • Entropy Monkey (flip the coin)
      • Ape in (buy the latest token)
      • Double 7
      • Double 7 (advanced)
  • Architecture
    • Architecture overview
    • Command line application
    • Webhook server
    • Strategy types
    • Serialisation
    • Unit testing
  • Deploying live trading strategies
    • Trade-executor command
    • Live trading modes
    • Strategy metadata
    • Hot wallet deployment
    • Vault deployment
    • Website and monitoring
    • Managing Docker images
    • Turning backtest to an executable live trading strategy
    • Troubleshooting live trade execution deployments
    • Repairing frozen trading positions
  • Protocol
    • Overview
    • Comparison
  • Learn algorithmic trading
    • Conference presentations and videos
    • Books on algorithmic trading
    • Online courses on algorithmic trading
    • Tutorials on algorithmic trading
    • Papers about algorithmic trading
    • Python
    • Jupyter Notebook learning material
    • Algorithmic trading frameworks for Python
    • Communities around algorithmic trading
    • Develop tools and Jupyter Notebook environments
    • Charting solutions for Python
    • Additional algorithmic trading links
    • Developing portfolio construction trading strategies
  • Glossary
Back to top
Edit this page

exchange#

tradingstrategy.exchange Python module in Trading Strategy framework.

Module description#

Exchange information and analysis.

Exchanges are presented by

  • Exchange class

To download the pairs dataset see

  • tradingstrategy.client.Client.fetch_exchange_universe()

Classes#

Exchange

A decentralised exchange.

ExchangeType

What kind of an decentralised exchange, AMM or other the pair is trading on.

ExchangeUniverse

Exchange manager.

Next
Exchange
Previous
ChainId

Trading Strategy is in beta and still under development. Any documentation is preliminary and not final.

Contents
  • exchange
    • Module description
    • Classes