Dukascopy
 
 
Wiki JStore Search Login

Strategy Closing a pending and Opened Order of another strategy
 Post subject: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Fri 22 Apr, 2016, 12:27 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Hi dear support. Sorry if my topic is repeating another same question. But here on the Vjf forum I can't find the answer on my question.

I have started 4 strategies on a DEMO account: Strategy "A",Strategy "D" ,Strategy "C" and Strategy "D". They trades one currency - EUR/USD.
The problem is that I have pending orders that have to be canceled or to be executed by one strategy, but they does cancel by my and another strategies. I need that my strategy named "A" to cancel a pending and executed orders created by strategy "A", not by strategies "B", "C" or "D".

Here is a logic how my orders creates and cancels by strategy:
Image
- This is example how I open BUY positions.
Image
- this is how does it cancel or close a created positions.

Please assist or provide a link for solution of my problem.

Best Regards
Illya Budayev.


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Fri 22 Apr, 2016, 13:21 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

In this case the simplest way to do that is to use the field 'Comment' (String) and idententify the orders/positions created by your strategy X then add an IF condition to check this comment before the close/cancel positions/order

Cheers


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Mon 25 Apr, 2016, 18:23 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Thanks, for reply and for advice. I'll try to figure it out.


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Tue 26 Apr, 2016, 15:40 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Hi Amine Chourou,
I followed to your advice and added a comment to each order and thats what I got:
Image
This is a logic to open a positions with comment and name of posn.

Image
This is the logic to close pending and opened positions.

But the problem is that's positions doesn't cancel and doesn't close.


 
The Best Answer  Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 1   Post Posted: Wed 27 Apr, 2016, 12:30 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi ,

As I'm unable to see the entire links of the strategy, I guess that the issue comes from the way your Position viewer blocks are linked, I expect the system to not be able to access the entire array of Market orders or Pending orders which is the main reason the cancel / close requests were not executed.

Please check the attached example which mainly made for "Real time" tests.

Cheers


Attachments:
Test_Comment.vfs [35.61 KiB]
Downloaded 161 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Wed 27 Apr, 2016, 13:56 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Thanks for your help Amine. You are very helpful. Everything works.

By the way, are there any chance to edit and order labels to know what the strategy opened an order. It's just to distinguish one from another.


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Wed 27 Apr, 2016, 16:40 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,
The variable "Label" is a read only variable so it not possible to change it. But you can use the position ID variable (if I well understood)


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Thu 28 Apr, 2016, 09:35 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Hi,

I mean this Image . Any possibilites to name it with my strategy name?


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Thu 28 Apr, 2016, 12:16 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Yeah, this is the label which cannot be modified or renamed.


 
 Post subject: Re: Strategy Closing a pending and Opened Order of another strategy Post rating: 0   Post Posted: Thu 28 Apr, 2016, 13:16 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 116
Location: Ukraine, Odessa
Unfortunately,
Anyway thank you for cooperation Amine!)


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com