Dukascopy
 
 
Wiki JStore Search Login

How to compare positions?
 Post subject: How to compare positions? Post rating: 0   New post Posted: Wed 26 Apr, 2017, 09:47 

User rating: 0
Joined: Sun 15 Mar, 2015, 20:15
Posts: 77
Location: Czech RepublicCzech Republic
Dears,

please any chance how to solve this example:

- lets say there are 10 LONG positions on EURUSD, each opened at different price
- how to pick up the one of those 10, that has highest entering price and to be able to close this one position?

Many thanks,
Antony


 
 Post subject: Re: How to compare positions? Post rating: 1   New post Posted: Thu 27 Apr, 2017, 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 there,

Really sorry for the delay but your initial query is still ongoing (mails @ support / since 23 Mar 2017 8:38 AM).
I'll do my best to update you asap


 
 Post subject: Re: How to compare positions? Post rating: 0   New post Posted: Thu 27 Apr, 2017, 13:53 

User rating: 0
Joined: Sun 15 Mar, 2015, 20:15
Posts: 77
Location: Czech RepublicCzech Republic
Thanks Amine, glad to hear that, because I was trying for last 4 month to bypass this trouble, but no sufficient result.
Do we have any time estimation when this trouble will be solved? Good luck :)


 
 Post subject: Re: How to compare positions? Post rating: 0   New post Posted: Fri 28 Apr, 2017, 14:32 
Visual JForex expert at Dukascopy
User avatar

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

To implement your idea we've built an example that uses a function that was never tested and we discovered some inconsistencies that were fixed. We're now preparing a new release (back-end) and I'll let you know once published!


 
 Post subject: Re: How to compare positions? Post rating: 0   New post Posted: Wed 03 May, 2017, 15:37 
Visual JForex expert at Dukascopy
User avatar

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

Now it seems to be stable :)
Here is the example but it's made for testing purpose. If you have difficulties to insert this in your strategy let me know and please describe in detail your requirement (when exactly the strategy need to check the P&L of the open positions for example ? is there a specific time to launch this part ? specific conditions ?? )

Thanks


Attachments:
ClosePositionPerMaxProfit_HT.vfs [34.85 KiB]
Downloaded 159 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: How to compare positions? Post rating: 0   New post Posted: Wed 03 May, 2017, 15:47 

User rating: 0
Joined: Sun 15 Mar, 2015, 20:15
Posts: 77
Location: Czech RepublicCzech Republic
Super, let me check.

Many thanks,
A.


 
 Post subject: Re: How to compare positions? Post rating: 0   New post Posted: Thu 04 May, 2017, 12:34 

User rating: 0
Joined: Sun 15 Mar, 2015, 20:15
Posts: 77
Location: Czech RepublicCzech Republic
Hi Amine,

first of all: Many thanks for solving this case, now it works well :)!
Second: would it be pls possible to send me the same example, but closing based on "Check.position amount"?

If yes, appreciate, otherwise I will try to handle that :).

Be fine,
Ant.


 
 Post subject: Re: How to compare positions? Post rating: 1   New post Posted: Thu 04 May, 2017, 14:10 
Visual JForex expert at Dukascopy
User avatar

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

Actually it's pretty simple, I've just replaced P&L variable by "Position Amount"..check the attached example which is built to be tested on real time run.


Attachments:
ClosePositionPerMaxAmount_RT.vfs [34.91 KiB]
Downloaded 153 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: How to compare positions? Post rating: 0   New post Posted: Thu 04 May, 2017, 14:38 

User rating: 0
Joined: Sun 15 Mar, 2015, 20:15
Posts: 77
Location: Czech RepublicCzech Republic
... I would not expect that it is that simple, thank you for clarification :roll: .
One question if I may: is this solution sufficient for comparing Long versus Short positions on same instrument?


 
 Post subject: Re: How to compare positions? Post rating: 0   New post Posted: Thu 04 May, 2017, 15:18 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Not sure if I well understood:
there is no check related to the side of the positions at all. You have to implement it using the position "Check" --> "Position is long"
As for the instrument, this function works on any instrument


 

Jump to:  

cron
  © 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