Find labels of positions not executed through cbots
Created at 20 Aug 2018, 06:42
RY
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)
Replies
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
PanagiotisCharalampous
20 Aug 2018, 10:21
Hi ryanoia@gmail.com,
should work fine. What is the problem? Why do you expect it to be null?
Best Regards,
Panagiotis
@PanagiotisCharalampous