Open positions collection not being updated after position closure

Created at 26 Aug 2014, 17:59
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!
SI

siciliada

Joined 26.08.2014

Open positions collection not being updated after position closure
26 Aug 2014, 17:59


Hi,

Firstly thanks for the great platforms cTrader and cAlgo and your continued good work in developing them further.

I have just started to experience this issue a couple of days ago. Essentially I have been testing a cBot strategy against a demo account and have found that after a position is closed, the open positions API collection fails to be updated.

Initially when the account has 2 open positions, the cBot reports the correct number when outputting the Positions.Count value. Subsequently when one of the positions is closed, the cBot still reports that there are 2 open positions as opposed to just the one. When I observe the Positions tab in cTrader it correctly displays the current number of open positions.

The only way currently to update the open positions API collection is to restart the cBot which then outputs the correct updated count. Are you able to confirm this as a platform issue or possibly a broker issue?

Many thanks.

 

 

 


@siciliada
Replies

Spotware
26 Aug 2014, 19:25

It is a known issue. It can be reproduced on several Demo environments only. It will be fixed as soon as possible.


@Spotware

kricka
27 Aug 2014, 04:32

RE:

Spotware said:

It is a known issue. It can be reproduced on several Demo environments only. It will be fixed as soon as possible.

I have not experienced this issue until the last update on cAlgo on the 26th. Ontick seems not to respond to the code properly after the update.

Please fix this quickly.


@kricka

Spotware
27 Aug 2014, 10:08

RE: RE:

kricka said:

Spotware said:

It is a known issue. It can be reproduced on several Demo environments only. It will be fixed as soon as possible.

I have not experienced this issue until the last update on cAlgo on the 26th. Ontick seems not to respond to the code properly after the update.

Please fix this quickly.

kricka, please provide more details about the problem.


@Spotware

kricka
27 Aug 2014, 17:47

Hi,

I have done some more testing today just to make sure it was not a one day thing. Still the same problem today. "siciliada" explained it right on spot. If you have 4 positions and sell off 2 it still shows 4 open positions. This is both on ChartObjects.DrawText and I also added Print just to make sure it did not print the correct value, no the same there it printed 4 position opened. after restarting the cBot it shows the right value for awhile and after some time running it the same problem occurs.

This problem is not specific on open positions it shows the wrong value on several coding snippets. As I said before everything has been working fine until the last update. What is the conclusion?  Maybe you changed the memory management on the last update or something similar to that. Please investigate what is causing this behavior. The broker I've been using have preformed flawlessly for 2 years so I don't think it's a broker issue.


@kricka

siciliada
27 Aug 2014, 21:04

I have manged to quickly test the open positions list not being updated issue after the latest cTrader and cAlgo releases. It seems to work now with the open positions API list being updated subsequent to a position being closed. I have not been able to test it for a longer period of time as yet.

I have since experienced another issue since today's release. This one relates to after running the cBot for a few minutes, the OnBar method of the cBot strategy fails to be called and executed on the creation of a new bar. I can see new bars being created in cTrader but not the cBot output related to the OnBar method. Could this issue be related to "kricka's" Ontick method problems which was raised in an earlier post?

Many thanks.


@siciliada

Spotware
28 Aug 2014, 11:04

Dear Traders,

Do you still observe the issue?


@Spotware

siciliada
28 Aug 2014, 16:40

RE:

Spotware said:

Dear Traders,

Do you still observe the issue?

Hi,

I have been running a cBot on a demo account for a few hours now after updating to the latest versions of cTrader and cAlgo (version 1.24.102). The open positions not being updated and OnBar method call failure issues I experienced earlier now appear to have been resolved. 

Thanks for getting on top of this.


@siciliada

kricka
29 Aug 2014, 19:32

Hi,

I have done extensive testing after the update yesterday. It seems like everything is working the way it should now. It shows how dedicated the Spotware Team are to bring us the best trading platform ever and to quickly solve issues coming up.

Thanks..


@kricka