Skip to content

cTrader Algo FAQ

Selling algorithms

Where can I sell my algorithm?

Publish your algorithm in cTrader Store to gain rich monetisation opportunities without any marketing effort. cTrader Store is a secure marketplace that allows you to reach millions of cTrader users worldwide.

If I am the author of an algorithm, can I charge other people for using it?

You can become a seller in cTrader Store and proceed to publish your algorithm, then your algo will become available for purchase to millions of potential buyers. Your intellectual property stays protected.

Can I create a trial version of my algorithm for cTrader Store?

Duplicate your main algorithm, add restrictions and publish a trial in cTrader Store.

How can I share the results of backtesting with other users?

Backtesting can be carried out only in cTrader Windows and Mac. However, when using cTrader Windows, you can choose to upload your backtesting report so that it can be shown on the algorithm page. Users will then see the report in all cTrader apps, including cTrader Mobile and Web.

How do I export and share my algorithm?

Export your algorithm as an .algo file in cTrader Windows or Mac. Users will be able to install the algorithm by opening the .algo file using cTrader Mobile, Windows or Mac.

Security and protection

Can any user see the source code of my algorithm?

No, buyers of your algorithm in cTrader Store cannot see its source code, unless you explicitly choose to reveal the code.

How does cTrader secure my algorithm and its intellectual property?

cTrader employs comprehensive security mechanisms within the .algo file to prevent your source code from being exposed at any stage, from local development to distribution.

What are access rights and why do they matter?

Access rights protect users by running algos in a sandboxed environment. Your cBot or indicator must declare its required access level via the AccessRights property.

Can my algorithm read and write files?

You can code your algo to work with files without elevated permissions by accessing the algo data folder.

My algorithm faces problems due to non-Latin characters in the file path. How do I fix this?

Apply a suitable non-Latin character fix for your operating system, then rebuild your algorithm.

Dependencies and integrations

Can I create a new algorithm in cTrader Web or Mobile?

cTrader Windows and Mac support all creation flows for cBots, indicators and plugins, while cTrader Web supports building web-based plugins.

Can I write algorithms in Python?

Yes, cTrader offers native Python support for creating cBots, indicators and plugins.

Can I use AI to generate a cBot?

Yes, you can create a cBot using AI such as ChatGPT, Claude, Gemini or any other model. For the best results, provide a detailed, specific prompt describing your strategy parameters, conditions and trading operations.

Can I use an external IDE to develop algorithms?

Yes, cTrader supports external IDEs, including Visual Studio, Visual Studio Code, Rider and others.

How do I reference third-party libraries in my C# algorithm?

Reference third-party .NET libraries via the Reference Manager in the cTrader UI or by installing NuGet packages.

Can I use third-party Python packages in my algo?

Yes, declare your dependencies in a requirements.txt file placed alongside your Python entry file. Third-party Python packages such as pandas and numpy are resolved automatically when you build your project.

How can my algorithm access the internet?

Use the Http interface for HTTP requests or the WebSocketClient class for real-time data transfer. Network access works with AccessRights.None and supports GET, POST and other HTTP methods as well as WebSocket connections.

How can my algorithm send email notifications?

Configure email notifications by enabling SMTP settings in cTrader, then call Notifications.SendEmail() in your code to send alerts based on any event such as position openings or indicator thresholds.

How do I use indicators inside my cBot?

Use built-in indicators in your cBot by declaring an indicator field, initialising it in OnStart() and reading its values to make trading decisions.

How do I use WebSockets in my algorithm?

Work with WebSockets via the WebSocketClient class to send and receive real-time data. WebSockets are more efficient than HTTP for live data feeds and support both string and raw byte data.

Can a cBot manage other cBots or indicators?

Yes, use the algorithm managing another algorithm functionality to add cBots and indicators to a chart programmatically. This allows dynamic adjustments, multi-strategy execution and automated risk controls.

How do I add custom buttons to the chart toolbar?

Add new buttons to the chart toolbar via a plugin. You can define a command and assign an action that executes when the button is clicked.

How can I draw custom visuals on a chart?

Use a canvas to create custom visuals including texts, shapes, images, arrows and annotations directly on trading charts. The Canvas class is available to all algorithm types.

What compiler should I use?

The .NET SDK compiler is recommended for large projects or algos that use third-party libraries. The embedded compiler is built in but has limited features. Switch between compilers in settings.

Parameters and performance

How do I add customisable parameters to my algorithm?

Declare parameters using the [Parameter] attribute in your cBot, indicator or plugin. Use parameters to let users customise behaviour such as stop-loss levels, indicator periods or data sources without modifying source code.

Can my algorithm continue running when it encounters an error?

Yes, fault tolerance ensures that algos continue running when facing exceptions. You can customise how your algo reacts to errors by overriding the OnException() method. cBot instances that crash are restarted automatically.

Are there rate limits for trading operations?

Demo accounts are subject to rate limits on operations such as placing, cancelling, amending and closing orders. Exceeding these limits temporarily blocks all trading operations, including manual trading.

Can I build a strategy that uses multiple timeframes?

Yes, you can code multi-timeframe strategies by defining parameters for different timeframes and accessing data from multiple bars objects within the same cBot.

How do I optimise my cBot parameters?

Use the built-in optimisation feature to find the best parameter values for your cBot. You can also write custom fitness functions by overriding the GetFitness() method to apply your own performance criteria.

Can I execute multiple orders at the same time?

Yes, cTrader supports both synchronous and parallel order execution. Use asynchronous methods to submit multiple orders simultaneously without waiting for each one to complete before sending the next.

Is Algo API thread-safe?

Only a few methods in the API are thread-safe. For everything else, use BeginInvokeOnMainThread() to execute code on the main thread. Each active algorithm runs in a separate process isolated from the main cTrader process.

Need cTrader support?

Reach out through our official channels to resolve any issues:

  • Ask questions and connect with traders, developers and other users in the cTrader Discord Community.
  • Contact the cTrader Support Team at support@ctrader.com for technical assistance.
  • Browse archived discussions on the cTrader Community Forum. While the forum is no longer open for new posts, it is full of helpful answers to common issues.