Creating and referencing .dll for cBot in Visual Studio 2019

Created at 03 May 2020, 01:27
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!
AM

Amaizing

Joined 26.05.2019

Creating and referencing .dll for cBot in Visual Studio 2019
03 May 2020, 01:27


Hello,

I am trying to create a .dll for my cBot but get stuck in reference errors and I am not really familiar with VS2019.

Does someone have a step by step instruction how to create this for cTrader in Visual Studio, together with some basic source codes of the robot and the code for the .dll?

Most information I can find on the web is outdated, not working or incomplete. I think this will be a great help for many who wants to implement this.

Thank you very much in advance.

Kind regards,

Stephan


@Amaizing
Replies

firemyst
17 Aug 2020, 12:21 ( Updated at: 21 Dec 2023, 09:22 )

HI Stephan:

I find this easiest to do is code up your reference DLL in the "documents \ calgo \ sources" folder.

When it compiles there:

Then in cTrader in "Automate", select the Indicator/bot you want, and from the 3 vertical dots, select the option to "Manage references":

Then you should find it under the "Libraries" side menu. If it's not there, click the "browse" button in the top right of the window and add it in.

Lastly, launch your visual studio project and viola, it'll be included.

 

I've had too many issues if I try and go the other way -- adding the reference from within VS without doing it through cTrader.

 

Hope this helps!


@firemyst