Skip to main content

Custom strategies

While Gunbot comes with pre-built strategies, it also provides the flexibility to run your own JavaScript code using custom strategies. This feature is particularly useful for developers who want to customize their trading algorithms and take advantage of Gunbot's exchange connectivity and market data collection features.

Custom strategies allow traders to fully customize how their trading bot operates, using JavaScript to define any logic needed. Whether you're creating a simple rule-based trading bot or implementing a complex machine learning model, Gunbot provides the environment to run your code effectively.

Key Features of Custom Strategies

1. Full JavaScript Control

Custom strategies in Gunbot allow users to write any JavaScript code to control the bot's behavior. Whether you want to implement unique buying/selling conditions, track specific market indicators, or automate portfolio management, you have the freedom to define every aspect. There's no limit to the logic you can apply, and this makes Gunbot an incredibly flexible tool for any kind of trading bot implementation.

2. Seamless Exchange Connectivity

One of the advantages of using Gunbot for custom strategies is its built-in exchange connectivity. Gunbot supports multiple major exchanges, and custom strategies can take advantage of this connectivity to execute trades across these platforms without needing to worry about low-level API integrations. This is a significant benefit for traders who want to focus on strategy development instead of managing exchange-specific code.

Easy Trading Methods

While writing your own code may seem intimidating, Gunbot provides easy-to-use methods for common tasks like placing orders and requesting additional candle data. Additionally, all the collected market data is easily accessible, so you can focus on implementing your trading strategy rather than worrying about collecting data from multiple exchanges.

You can quickly place buy or sell orders, retrieve historical market data, or manage open positions using predefined methods. This makes it easier to experiment with different trading algorithms without getting bogged down in low-level exchange communication.

No Artificial Constraints

Custom strategies in Gunbot allow you to run any JavaScript code that you write, without any artificial constraints on execution time or other limitations. This means that you have complete control over the logic of your trading algorithm and can implement even the most complex strategies. Furthermore, you can use any external modules or libraries, which significantly extends the functionality of your code.

Want to implement a neural network, access external financial data, or run long-running calculations? Gunbot’s custom strategy feature provides a wide-open playground for traders and developers to explore.

Visualization Options

Custom strategies have access to a range of visualization options that can help you make better trading decisions. These options allow you to display additional data in the Gunbot interface in various ways, depending on your specific needs and preferences.

Visualizing market conditions and strategy performance in real-time can be an essential part of developing and optimizing trading bots. Custom charts, trend lines, and statistics can be added directly to the Gunbot interface. For instance, you can plot strategy-specific metrics like moving averages or Bollinger Bands, and use custom statistics to monitor key performance indicators that are unique to your algorithm.

Example of the custom Quanta G-type strategyusing custom chart targets and custom stats in the sidebar on the right side of the screen.

Connect to Third Parties

Connecting to third-party services is also possible in a custom strategy. For example, you could connect to a weather API in order to incorporate weather data into your trading algorithm. The possibilities are endless, and custom strategies open up new avenues for traders to explore and experiment with their trading strategies.

Imagine using sentiment analysis from social media, integrating economic indicators, or even pulling in technical data from other platforms. By integrating third-party APIs into your custom Gunbot strategies, you can enhance your bot's decision-making process and increase the sophistication of your trading operations.