Dukascopy
 
 
Wiki JStore Search Login

Trailing pending orders
 Post subject: Trailing pending orders Post rating: 0   New post Posted: Tue 10 May, 2016, 16:49 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Hello,

I'm trying to trail pending order but I'm not sure about the way and I have some dubs....

1. Can you tell me if this is the best way to trail a pending order? (see add file)

Anyway it do not work well because I have not find a good solution to use a "Positions Ammount" related with a specific pending order.

Image

I need check the presence or not of every pending order.

For all pending order there is "positions amount"
Image


But in the single position list the "position amount" is not the number of pending order, is the quantity of inversion. :?:
Why this difference and how to detect nº of pending order selected?

Image


Attachments:
test_trailing_pending_1.vfs [36.05 KiB]
Downloaded 134 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: Trailing pending orders Post rating: 0   New post Posted: Wed 11 May, 2016, 13:25 
Visual JForex expert at Dukascopy
User avatar

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

I'll try to explain this step by step:
Positions variable is a way to identify a single position OR an group of positions created by the strategy or even manually.
So how to use that and in which cases?
Method 1: To create a position variable at the level of your market block (or pending order) : this allow you to identify the order or the position created by this specific block and to use this later. The constraint of working with this method it that the position variable is referring only to the last position/ order created. So if you need to work on the 100 open positions or orders, this is not possible. but if your strtaegy is dealing with one position at a time, then it is more than enough.
Method 2: To work with "position viewer" block and create an iteration which collects the data array of all open positions/ orders and save it in your new "Position" variable. You'll be then able to perform mass action in one operation like: change SL of 5 orders in one operation (actually 5 requests but sent in the same time)

So back to your example: If you need to identify all the pending orders, then drag a position viewer block, input "Pending Positions" variable as 1st input and create a new output. Yo can then work on all the pending positions of your strategy but also the ones created manually (if any).

cheers


 
 Post subject: Re: Trailing pending orders Post rating: 0   New post Posted: Sat 21 May, 2016, 19:53 
User avatar

User rating: 0
Joined: Mon 09 Mar, 2015, 19:40
Posts: 7
Location: Spain, Santa Cruz Tenerife
Hi, many thanks.

yes, I can set one or more trades (or order) to a "position variable" .... so I have more parameter that I can use in the strategy.

But I have not find how to use a specific function: How block can I use if I want only one trade fore every different trade?

Example:

If my strategy need only one trade for time I use this:

Image


But if I have more trades (with separate manage) how can I open only one for each trade?


Sorry ... I think it will be very easy but I have try several mode but I have no found it... please help! ;) Thanks!

Image


 
 Post subject: Re: Trailing pending orders Post rating: 1   New post Posted: Mon 23 May, 2016, 15:32 
Visual JForex expert at Dukascopy
User avatar

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

the "Position amount" is a dynamic variable that will retrieve the number of all the positions whatever the instruments is.
If you need to handle the position number individually, you should implement another way such as the following:


Image


For more than one position per command, you'll have to implement a counter that is incrementing every time a position is created (or an order is submitted)

Let me know if you need that

cheers


Attachments:
managing positions.JPG [102.66 KiB]
Downloaded 174 times
Managing Positions (2).JPG [237.53 KiB]
Downloaded 379 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.
 

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