Partial Close

Created at 23 Dec 2013, 15:25
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!
NI

nirin

Joined 09.12.2013

Partial Close
23 Dec 2013, 15:25


Hi,

Need a help, i try to do this:

        private void ClosePosition()
        {
            if (position != null)
            {
                Trade.Close(position, 10000);
                position = null;
            }
        }

And i receive an error!

I thought it works with the new API.

Thanks!


@nirin
Replies

Spotware
23 Dec 2013, 15:52

Trade.Close is a method of old trading API. If you want to close position partially please use ClosePosition method.

Example:

ClosePosition(position, 10000);

 


@Spotware

nirin
24 Dec 2013, 10:23

RE:

Spotware said:

Trade.Close is a method of old trading API. If you want to close position partially please use ClosePosition method.

Example:

ClosePosition(position, 10000);

 

Hi,

I try this but "ClosePosition doesn t take arguments 2"

foreach (var pos in Account.Positions)
                    {
                        ClosePosition(pos, 1000);
                    }

Is my cAlgo not updated?


@nirin

Spotware
24 Dec 2013, 14:05

We will contact you by email to troubleshoot this issue.


@Spotware