Positions.Count, doesnt work as supposed to on EURGBP

Created at 03 Aug 2016, 00:45
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!
TH

thomas.gardling

Joined 12.05.2016

Positions.Count, doesnt work as supposed to on EURGBP
03 Aug 2016, 00:45


Hi.

Im using this code to Count my open positions.

var Count = Positions.Count(p => p.SymbolCode == Symbol.Code);

And then

if (Count < 1)

The problem Im having now is that it works on all pairs I have tried (havent tried all pairs yet). But it doesnt work as supposed to on EURGBP.

On that pair it opens 2 orders, not after each other but after a while it opens a second order. The cbot doesnt take care of one of the orders either, even gives it a sl over current price if its a buy trade. Is that even possible? Its like the trade doesnt exist. The other order is workin as it should.

Here is a Picture of it. 2 buy orders. http://icmarkets.ctrader.com/images/screens/ct20n.png  the Blue Arrows on the left is the wrong trade with faulty sl, the Brown Arrows show the right one. As can be seen in the Picture, the current price is lower then the sl of the buy faulty order.

Anybody have any clue why?

 

Regards

Thomas


@thomas.gardling
Replies

thomas.gardling
03 Aug 2016, 00:59

Here is another Picture, high lighted the rouge buy trade. http://icmarkets.ctrader.com/images/screens/Fz20n.png 

Have had some issues with the platform too, been trown out a couple of times lately, dont really know why. Maybe its my broker that is having problems.

Thomas


@thomas.gardling

thomas.gardling
03 Aug 2016, 02:37

Have filed a report to icmarkets now, their chat couldnt help me with it. Didnt have any explanation for the trade not being closed on the firm stoploss that is stored on their server either. Im guessing that the problem isnt in the code, but on icmarkets side instead.

By the way, anybody else having these problems right now?

Thomas


@thomas.gardling

Spotware
04 Aug 2016, 14:19

Hello Thomas, 

We have just tested this method and it works fine on our side. It is hard to say where exactly the things went wrong, but this method on this pair should be fine 


@Spotware

thomas.gardling
04 Aug 2016, 19:30

Hi, thanks for looking at the code.

Im waiting for an answer from icmarkets support at the moment, to clear things up.

Seems like there was some problems with the platform. When I restarted the platform the rouge order that was open went away. Strangely the order was counting the pips and gain/loss as a normal order, but wasnt in their server just on my platform. Even had the info on the order as status Open on the platform, weird...

Have had some strange behaviors on the platform lately, been trown out a cople of times and had to type in my id again. That normaly is already there on startup. Maybe this is the problem behind everything.

Thomas


@thomas.gardling