Custom Strategies
Gunbot includes pre-built strategies, but you can also run your own JavaScript code with custom strategies. This is useful for developers seeking to customize algorithms while using Gunbot's exchange connectivity and market data.
Custom strategies let you define the bot's logic in JavaScript, from simple rule-based bots to more complex models. For a product-level overview, see custom strategy platform features.
Info
JavaScript is a versatile scripting language commonly used for web development. In Gunbot, it allows for detailed customization of trading logic.
tip
Prototyping new strategy code can be done in seconds with our specialized GPT: Gunbot Custom Strategy Guru
Key Features of Custom Strategies
Full JavaScript Control
Custom strategies let you write JavaScript to control bot behavior, from unique buy/sell conditions to tracking indicators or automating portfolio management. You can define the logic you need.
Exchange Connectivity
Gunbot provides built-in exchange connectivity. Custom strategies can use this to execute trades across supported exchanges without handling low-level API integrations.
Easy Trading Methods
Gunbot provides methods for common tasks like placing orders and requesting additional candle data. Collected market data is accessible so you can focus on strategy logic. If you are starting from scratch, review create a custom strategy first.
You can place orders, retrieve historical data, and manage open positions using predefined methods, which reduces low-level exchange work. You can also browse custom strategy code examples to speed up implementation.
No Artificial Constraints
Custom strategies run your JavaScript code without artificial constraints on execution time or other limitations. You can implement complex strategies and use external modules or libraries.
Want to implement a neural network, access external financial data, or run long-running calculations? Custom strategies support those approaches.
Visualization Options
Custom strategies can use visualization options to display additional data in the Gunbot interface.
You can visualize market conditions and strategy performance in real time. Add custom charts, trend lines, or statistics - for example, plot moving averages or Bollinger Bands and track custom KPIs.

Connect to Third Parties
Custom strategies can connect to third-party services. For example, you could call a weather API to incorporate weather data into your logic.
You might integrate sentiment analysis, economic indicators, or technical data from other platforms to inform decisions.