Averaging Positions and Exiting in Full

Created at 05 Sep 2017, 15:04
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!
CT

ctid362975

Joined 31.08.2017

Averaging Positions and Exiting in Full
05 Sep 2017, 15:04


Guys,
I an trying to write code that does the following.

1.) Long 1 @ px with a TP1

2.) Market has gone down and I average my position and Buy 1 more @ px with TP2.
So now I am long 2 with a VWAP @ px2

I want to cancel the TP of entry #1 and replace it with TP2.

If TP2 is triggered I would like to close the trades for both #1 and # 2;

Can this be done?

Any code examples will be very appreciated.  
Thanks,


@ctid362975
Replies

Spotware
06 Sep 2017, 11:19

Dear Trader,

Thanks for posting this request in our forum. You can also consider posting this request as a Job or contact a professional cAlgo Consultant.

Best Regards,

cTrader Team


@Spotware

ctid362975
07 Sep 2017, 15:07

Hi,

I do not need someone to code this for me.  If you could tell me how your VWAP / Position manager is working I can create the correct code.  But at the moment I cannot see thses classes fully as they are obfusucated. 

Otherwise I will wirite my own Position manager class.  Is that what you are suggesting I need to write my own PM class?

Thanks,


@ctid362975

Spotware
07 Sep 2017, 15:58

Dear Trader,

You can find here all available classes and functions in cAlgo. Also, you can list what functions you need and we can advise if they are available or not.

Best Regards,

cTrader Team


@Spotware