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.

Typical stepgridscalp trades

Custom strategy code example. This one is generated by Gunbot AI

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.

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.

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.

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

One of the most popular visualization options is drawing lines on the chart. This can be particularly useful for identifying trends or support and resistance levels. You can also change the color, label and style of the lines to suit your needs. Another option for displaying data is sending notifications to the Gunbot interface, for example to inform about a particular strategy event. If you prefer to keep track of time-based events, you can use markers on the time axis. These markers can be placed at specific points in time,

Finally, if you have specific statistics you want to monitor, you can create your own custom statistics that will show in a sidebar of the chart. This can be particularly useful if you have unique trading strategies or if you want to track specific metrics that aren't available by default in Gunbot

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.