Check if pending order is present for a currency pair

Created at 25 Apr 2019, 00:12
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!
MR

MrMagu

Joined 21.02.2018

Check if pending order is present for a currency pair
25 Apr 2019, 00:12


I am trying to figure out how to check if a pending order is already present for a currency pair.  I am able to check for total pending orders but am having some difficutly figuring out how to do this on a per currency pair basis.


@MrMagu
Replies

PanagiotisCharalampous
25 Apr 2019, 09:48

Hi mariusgunnerud,

Try this

PendingOrders.Count(x => x.SymbolCode == Symbol.Name);

Best Regards,

Panagiotis


@PanagiotisCharalampous

MrMagu
25 Apr 2019, 22:36

RE:

Panagiotis Charalampous said:

Hi mariusgunnerud,

Try this

PendingOrders.Count(x => x.SymbolCode == Symbol.Name);

Best Regards,

Panagiotis

Hi,

I get an error with "Symbol.Name"  (Symbol does not contain a definition for "Name").  Any ideas on this?


@MrMagu

DonaldD
26 Apr 2019, 11:42

Hi mariusgunnerud,

What version of cTrader and broker do you use?


@DonaldD

MrMagu
26 Apr 2019, 13:59

RE:

DonaldD said:

Hi mariusgunnerud,

What version of cTrader and broker do you use?

The broker I use is FXpro, version of cTrader I am uncertain, but it is the latest update.  However, I do my editing in Visual Studio 2017


@MrMagu

DonaldD
26 Apr 2019, 22:32

Then you should try this

 PendingOrders.Count(x => x.SymbolCode == Symbol.Code);

 


@DonaldD

MrMagu
27 Apr 2019, 09:22

RE:

DonaldD said:

Then you should try this

 PendingOrders.Count(x => x.SymbolCode == Symbol.Code);

 

Thanks, that worked.


@MrMagu