Partially Closing Positions

Created at 13 Nov 2012, 10:20
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!
HU

hussain

Joined 06.11.2012

Partially Closing Positions
13 Nov 2012, 10:20


Hello,

I am facing an issue regarding the Partial Close of positions programatically. I can partially close positions using The Modify Position option in the cTrader UI. But when it comes to partially closing a position in cAlgo (programtaically) i can not find any suitable method for it. Is there any way to partially close positions programtaically?

Hoping to hear from the community soon.


Best Regards,

Hussain


@hussain
Replies

admin
13 Nov 2012, 12:25

Hello,

 

Currently it is not possible to do a partial close in cAlgo but we will implement this in the future.

 

 

 


@admin

hussain
14 Nov 2012, 13:43

Hi

Thanks for your prompt reply.

But i have to implement this functionality very soon.

Is there any other way to do this?

or

Can we oveload the Trade.ModifyPosition()? Currently it's taking 3 parameters which are Position, TakerPofit and StopLoss without any overloads and as it is an API built in method so we can't override it as well.

Please help me out.

Best Regards

Hussain

 


@hussain

admin
14 Nov 2012, 16:06

There will be an implementation for it very soon.

 

 


@admin

jallopy
08 Aug 2013, 19:05

RE:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 

 

 

 


@jallopy

cAlgo_Fanatic
09 Aug 2013, 15:37

RE: RE:

jallopy said:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 This feature has not been implemented yet.


@cAlgo_Fanatic

jallopy
06 Dec 2013, 12:36

RE: RE: RE:

Has it yet?

 

 

 

cAlgo_Fanatic said:

jallopy said:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 This feature has not been implemented yet.

 


@jallopy

Cerunnos
06 Dec 2013, 12:55

RE: RE: RE: RE:

jallopy said:

Has it yet?

 

 

 

cAlgo_Fanatic said:

jallopy said:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 This feature has not been implemented yet.

 

/api/robot/closeposition-7cec


@Cerunnos

jallopy
06 Dec 2013, 18:11

RE: RE: RE: RE: RE:

Total Awesome Dude.

 

Cerunnos said:

jallopy said:

Has it yet?

 

 

 

cAlgo_Fanatic said:

jallopy said:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 This feature has not been implemented yet.

 

/api/robot/closeposition-7cec

 


@jallopy

jallopy
09 Dec 2013, 11:25

RE: RE: RE: RE: RE: RE:

A question for support, I don't want to re-invent the wheel.

If I wanted to close 25% of a position, 4 times, the first iteration, is explanatory, however the 2nd 25% would be calculated on the new size, not on the original order size, same for the 3rd and 4th, ever dimension amounts.

Is there a way to reference the original order size, to avoid this? Is this a case for getting the original volume and storing it in a positions label/property, to reference later?. So if the bot is stopped and started it can reference the original order size? Or a label to state stage 2/4 or 3 of 4, so the bot knows where it is in the process. 

 

 

 

jallopy said:

Total Awesome Dude.

 

Cerunnos said:

jallopy said:

Has it yet?

 

 

 

cAlgo_Fanatic said:

jallopy said:

Hi Admin,

Is this implemented yet, could you give and example code for closing , for example , 25% of an open position?

Thank-you

admin said:

There will be an implementation for it very soon.

 This feature has not been implemented yet.

 

/api/robot/closeposition-7cec

 

 


@jallopy

Spotware
09 Dec 2013, 14:50

There are two ways you can accomplish this.

One, you may store the initial volume in an input parameter that you always have access to even after the robot is restarted.
Two, you may enter the volume in the comments field. So, the robot will have access to it, if the position is opened manually as well as via the robot(s).


@Spotware