Proposal: Improved Project Structure for cBots Development in cTrader

Created at 22 Aug 2024, 15:51
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KA

kaxalope

Joined 02.04.2024

Proposal: Improved Project Structure for cBots Development in cTrader
22 Aug 2024, 15:51


I've been actively using cTrader's code editor for developing cBots, and while it’s a decent tool, I’ve encountered challenges when managing a large number of bots. The current setup becomes quite cumbersome as the number of bots grows, especially when it comes to reusing functions or classes across multiple bots.

Challenges:

Code Management: As the number of cBots increases, managing the code becomes increasingly difficult. Navigating through large blocks of code without a clear project structure can be tedious and prone to errors.

Code Reusability: It’s challenging to reuse code, such as utility functions, risk management modules, or pattern detection algorithms, across different bots without a more modular project structure.

Version Control: Integrating with version control systems like Git is less efficient due to the lack of a centralized project structure where all bots and reusable libraries can coexist.

Compilation: Compiling and managing multiple bots individually is time-consuming. Having a way to compile all bots at once, while ensuring dependencies are properly managed, would streamline the development process.

Proposal:

I propose introducing a project-based structure for cBots development within cTrader. Here's how it could work:

Solution-Based Approach: Similar to other development environments, allow users to create a "Solution" that can contain multiple cBot projects. This solution would serve as a container for all bots and shared libraries.

Reusable Libraries: Within the solution, users could create shared libraries (e.g., Utils, RiskManagement, PatternDetection) that can be referenced across multiple cBot projects. This would greatly improve code reuse and maintainability.

Integrated Git Support: With a solution-based approach, integrating Git or other version control systems would be much more seamless, enabling better collaboration and version management.

Centralized Compilation: A centralized build system where all cBots and their dependencies can be compiled together would save time and reduce the likelihood of errors.

Benefits:

Improved Code Organization: A solution-based approach would significantly improve code organization, making it easier to manage large-scale bot development.

Increased Productivity: Reusing code through shared libraries would reduce redundancy, allowing developers to focus more on strategy development rather than boilerplate code.

Better Collaboration: Enhanced version control integration would facilitate collaboration between team members, ensuring that everyone is working with the latest code.

Streamlined Development Process: Centralized compilation and project management would make the development process more efficient, particularly for developers managing multiple bots.

I believe these changes would make cTrader an even more powerful platform for algorithmic trading. I look forward to hearing the community's thoughts on this proposal and hope that the cTrader team considers these enhancements.

Thank you for your time and consideration.

Regards


@kaxalope
Replies

PanagiotisCharalampous
23 Aug 2024, 06:36

Hi there,

Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.

Best regards,

Panagiotis


@PanagiotisCharalampous

kaxalope
23 Aug 2024, 07:01 ( Updated at: 23 Aug 2024, 13:17 )

RE: Proposal: Improved Project Structure for cBots Development in cTrader

PanagiotisCharalampous said: 

Hi there,

Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.

Best regards,

Panagiotis

I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.


@kaxalope

PanagiotisCharalampous
23 Aug 2024, 13:24

RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader

kaxalope said: 

PanagiotisCharalampous said: 

Hi there,

Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.

Best regards,

Panagiotis

I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.

No it is not possible, however you can reference shared projects across many solutions, if this is what you are looking for.

Best regards,


@PanagiotisCharalampous