Find labels of positions not executed through cbots

Created at 20 Aug 2018, 06:42
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!
RY

ryanoia@gmail.com

Joined 09.03.2018

Find labels of positions not executed through cbots
20 Aug 2018, 06:42


Let's say I want to find and modify or close a position which was created through the default buy or sell buttons of ctrader and not via bot, how do I find this position? I understand positions created this way do not have a label. 

This is the code I tried to no avail:

if ((Positions.Find(null, Symbol, TradeType.Buy) == null))

Also tried this, basically leaving the label blank but putting quotation marks:

if ((Positions.Find("", Symbol, TradeType.Buy) == null)

 


@ryanoia@gmail.com
Replies

PanagiotisCharalampous
20 Aug 2018, 10:21

Hi ryanoia@gmail.com,

Positions.Find("", Symbol, TradeType.Buy)

should work fine. What is the problem? Why do you expect it to be null?

Best Regards,

Panagiotis


@PanagiotisCharalampous

ryanoia@gmail.com
20 Aug 2018, 10:42

Yes that "" worked. I was testing it wrong so I thought it didn't work. 

Thanks for the response. 


@ryanoia@gmail.com