Dukascopy
 
 
Wiki JStore Search Login

Close all long/short positions when cumulative profit is 50 pips
 Post subject: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 07:49 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Hello Guys, i need help

Iam trying to do averaging strategy that closes positons when they reach profit target of 50 pips.

I doesnt matter how many positiones are open they are all closed when total profit is 50 pips

This should be done separatedly for both long and short postions on both sides.

Help would be much appreciated, Iam trying to figure it out for long time !!


Thank You in advance


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 09:47 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Hello

Why "This should be done separatedly for both long and short postions on both sides. " ?


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 10:11 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Hello


because strategy aims to hedge positions at all the time ang get better price for long trades (by averaging) and also for short separaedly.

therefore i need pip profit to be calculated separatedly for both sides

Thank you, sorry to bug you but I have very little in programing and help would be much appreciated


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 10:36 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
I am just not sure of what you want.

You want to close ALL positions went your TOTAL PROFIT (from all positions, long and short) reaches 50 PIPS, right?


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 10:37 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
This is how you calculate the total profit of all open positions

Image


Attachments:
Capture.JPG [53.56 KiB]
Downloaded 680 times
Capture.JPG [46.69 KiB]
Downloaded 286 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: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 10:40 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
And this is how you close all open positions
Image


Attachments:
Capture.JPG [36.91 KiB]
Downloaded 675 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: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 12:18 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Thank you

Howevever i need to do that separately for long and short ones.

Example:
Buy trades in profit total 50 pips - close all buy positions
Sell trades in loss -70 pis - wait for total profit + 50 pips for sell positions

Please it has to be like this. Can I achieve that, using logic you have send me (screenshots) ?


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Wed 10 Sep, 2014, 17:19 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Ha OK, I get it now.

I will come back to you shortly.


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Thu 11 Sep, 2014, 08:09 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
thanks, looking forward :)


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Fri 12 Sep, 2014, 00:50 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Hey

Take a look at the attached strategy.

It opens a position in each direction every hour and then close all long positions when their total profit is superior or equal to 50 PIPS (same for short positions).


Attachments:
Close_50_PIPS.vfs [35.69 KiB]
Downloaded 182 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: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Fri 12 Sep, 2014, 08:09 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Thank you a lot :) !

Have a great weekend !


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 1   New post Posted: Fri 12 Sep, 2014, 10:00 
Visual JForex expert at Dukascopy
User avatar

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

Just a little detail: There should be a reset block in order to get a correct sum.
Check the attached sample.


Attachments:
T_Get_highestCandle.vfs [25.42 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: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Sat 13 Sep, 2014, 19:27 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Guys thank you

I have been testing this exit procedure with basic RSI entry (I enclose it)

However it seems to be closing trades on average profit of 50 pips not sum of them (I may be incorrect but this is how it looks from testing)

What it do Now : first short trade in profit, 40 pips, new one opens - now average profit is 20 pips and both trades remain open for another 60 pips (average profit 50 pips)

What I need: inf another trade opens when first one is in profit 40 pips, go another 5 pips and close all postions (sum of profit 50 pips)

Thanks guys, please have a look

Can you please have a look at attached system and tell me if Iam correct ?

Also Amine, unfortunatelly I was not able to figure out what your attachement do or how to connect it to my system :(


Attachments:
Close_50_PIPSrsi4.vfs [41.41 KiB]
Downloaded 137 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: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Mon 15 Sep, 2014, 07:34 
Site Administrator
User avatar

User rating:
Joined: Fri 21 Jun, 2013, 16:50
Posts: 197
Location: FranceFrance
Can you give the exact parameters of you testing please (date rang, pair, equity, leverage, etc.).


 
 Post subject: Re: Close all long/short positions when cumulative profit is 50 pips Post rating: 0   New post Posted: Mon 15 Sep, 2014, 07:50 
User avatar

User rating: 0
Joined: Fri 17 Feb, 2012, 09:21
Posts: 19
Location: Slovakia,
Sure

Eurusd, last year, starting balance 5000 usd, trade size one microlot

period : 4H,
default slippage : 5 pips

modelling: tick to open,

Default TP and SL : 0

Thanks !


 

Jump to:  

  © 1998-2024 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