Proposal: Improved Project Structure for cBots Development in cTrader
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
Replies
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
serge.owonaokoa
03 Nov 2024, 13:32
( Updated at: 04 Nov 2024, 06:49 )
RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
@serge.owonaokoa
PanagiotisCharalampous
04 Nov 2024, 07:26
RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
serge.owonaokoa said:
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
@PanagiotisCharalampous
serge.owonaokoa
12 Nov 2024, 21:51
RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
@serge.owonaokoa
PanagiotisCharalampous
13 Nov 2024, 07:12
RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
serge.owonaokoa said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
Hi there,
It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit.
What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.
Best regards,
Panagiotis
@PanagiotisCharalampous
kaxalope
13 Nov 2024, 07:27
RE: RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
Hi there,
It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit.
What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.
Best regards,
Panagiotis
No, a cTrader bot/plugin/indicator is not a project but a solution. This is the reason for the topic.
@kaxalope
PanagiotisCharalampous
13 Nov 2024, 07:42
RE: RE: RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader
kaxalope said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
serge.owonaokoa said:
PanagiotisCharalampous said:
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,
I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.
I decide to follow you recommendation of using a Shared Project. I have a couple questions:
1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?
2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?
I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?
Thanks.
Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.
Hi there,
Unfortunately there is no correct answer to your questions as it all depends on your own requirements.
Best regards,
Panagiotis
Thank you for your very diplomatic reply, that doesn't really take us anywhere.
I think it's really deciving to point your users nowhere rather than helping with real problems.
If what cTrader recommend is to write duplicate code, then please be clear on that.
If you recommend shared project then please be clear and give a simple example of :
Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.
If that's not possible then please say so.
I really don't see what our own requirements could make a difference in this very specific question.
Hi there,
It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit.
What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.
Best regards,
Panagiotis
No, a cTrader bot/plugin/indicator is not a project but a solution. This is the reason for the topic.
I don't see the problem. In .Net, you can reference projects that are parts of solutions in other solutions. This is not a cTrader thing, is a .Net thing. So you can have an indicator as a standalone solution, as well as reference it in other solutions i.e cBots or plugins
@PanagiotisCharalampous
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