Output Variable Data while debugging cBot

Created at 15 Apr 2016, 00:31
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!
Mikro's avatar

Mikro

Joined 20.06.2015

Output Variable Data while debugging cBot
15 Apr 2016, 00:31


Hi all,

I am currently encountering some issues with calculations in my cBot and whant to debug and optimize them.

Visual Studio is in use as IDE and what I would like to do is output selected variables to a chart, to be able to analyse them. Visual Studio seems to provide tools for that, like Intellitrace but I am not familiar with them. Alternatively exporting Variable Values to an Excel Sheet would help a lot too.

How do you export Data from you cBot for debugging purposes?

I read in a post the cAlgo itself can export a debugging history?

 

Can anyboy assist?

THX!

 


@Mikro
Replies

croucrou
16 Apr 2016, 17:03

You can print the values to the log:

Print(variable);

 


@croucrou

firemyst
17 Aug 2023, 13:02

Also, in addition to printing to the log, if you want a text file, you can use C#'s ability to write to text files, csv files (so you can later import into Excel if you want), or even json or xml formatted files.

 

 

 


@firemyst