Keeping Track of Open Trades

Created at 08 Jun 2015, 17:21
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

Kaworu

Joined 10.11.2014

Keeping Track of Open Trades
08 Jun 2015, 17:21


I have a simple bot to create, is there a way for me to have my bot check each open positions? I understand that you can create an instance of a bot on a given open chart.


@Kaworu
Replies

Spotware
09 Jun 2015, 14:25

Dear Trader,

cAlgo.API provides the ability to access to all open positions. Please look at the following example:

            foreach (var position in Positions)
            {
                Print("Position Id: ", position.Id);
            }

The above code prints all position Ids to the Log tab. You can adjust it in your cBot.


@Spotware