Dukascopy
 
 
Wiki JStore Search Login

Stop strategy if target TP reached
 Post subject: Stop strategy if target TP reached Post rating: 0   New post Posted: Wed 24 Feb, 2016, 16:32 
User avatar

User rating: 0
Joined: Mon 07 May, 2012, 07:24
Posts: 69
Location: CroatiaCroatia
Is it possible?
Was try different approaches but strategy never stopped. I suppose because of slippage (never close on exact price).
Can You give me some example?

Regards


 
 Post subject: Re: Stop strategy if target TP reached Post rating: 0   New post Posted: Wed 24 Feb, 2016, 16:50 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Indeed it is possible!
can you attach what you did so far so that I can understand ?


 
 Post subject: Re: Stop strategy if target TP reached Post rating: 0   New post Posted: Wed 02 Mar, 2016, 11:04 
User avatar

User rating: 0
Joined: Mon 07 May, 2012, 07:24
Posts: 69
Location: CroatiaCroatia
Hello and sorry for late reply!

One of variations for trying stop strategy after TP reached is in attachment.
Thought best results will be if connect stop strategy procedures with on TradeEvent block, but don't know how....

Regards


Attachments:
RCS_test2.vfs [51.29 KiB]
Downloaded 164 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: Stop strategy if target TP reached Post rating: 0   New post Posted: Wed 02 Mar, 2016, 17:38 
Visual JForex expert at Dukascopy
User avatar

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

Well ... thanks a lot for the attached file but it makes the situation worse as I don't get what are you trying to achieve with that :D
I made a quick test and I noticed that the strategy is not stopped because of the TP condition but due to the second condition that you implemented (RSI<=31 or RSI >=69)
So if you need to implemented a condition related to TP reached you have to think this way:
A position is closed with profit in this example is a position that has a status FILLED then CLOSED with positive P&L, whatever the P&L is as long as it is positive. If the exact level of 500pips of profit is essential for you then you should use the variable "ProfitLoss in pips" instead of "Default Take profit" (you can find it in rcs_test1 main position variable : P&L in pips) and I wouldn't use the P&L in pips to be exactly = to your target because in some cases there might be positive slippage. ">=" would do a better job ..


 
 Post subject: Re: Stop strategy if target TP reached Post rating: 0   New post Posted: Thu 03 Mar, 2016, 09:59 
User avatar

User rating: 0
Joined: Mon 07 May, 2012, 07:24
Posts: 69
Location: CroatiaCroatia
amine_chourou wrote:
Hi,

Well ... thanks a lot for the attached file but it makes the situation worse as I don't get what are you trying to achieve with that :D

Somehow knew I'll complicate things... :mrgreen:
Try to explain little bit more:
amine_chourou wrote:
I made a quick test and I noticed that the strategy is not stopped because of the TP condition but due to the second condition that you implemented (RSI<=31 or RSI >=69)

Idea is to have two conditions for stop:
1. stop if RSI value is 31/69 -for taking profit & avoiding opening another positions which will be in loss in most cases because trend reversal
2. stop if TP reached - for same reasons as above
Now "tricky" part... :D
amine_chourou wrote:
So if you need to implemented a condition related to TP reached you have to think this way:
A position is closed with profit in this example is a position that has a status FILLED then CLOSED with positive P&L, whatever the P&L is as long as it is positive.

Noticed some disadvantage in "TP stop" blocks because these blocks are connected with "onCandle" main block through "defaultPeriod" variable (1 Day). In reality, TP could be reached in middle of the day and because "onCandle" block, stop strategy block would not be reached!? Because of that, think connect these blocks with "TradeEvent" will be much better solution. But, don't know how to do it. So Your knowledge will be much appreciate to me. :)
amine_chourou wrote:
If the exact level of 500pips of profit is essential for you then you should use the variable "ProfitLoss in pips" instead of "Default Take profit" (you can find it in rcs_test1 main position variable : P&L in pips) and I wouldn't use the P&L in pips to be exactly = to your target because in some cases there might be positive slippage. ">=" would do a better job ..

Didn't understood well (maybe because of my English), in IFs blocks already have "rcs_test1.ProfitLoss In Pips" variable so I need little more explanations of that?
Sorry for big post, but I think that could be interesting for other VJF users to improve their strategies also.

Regards


 
 Post subject: Re: Stop strategy if target TP reached Post rating: 1   New post Posted: Thu 03 Mar, 2016, 10:53 
Visual JForex expert at Dukascopy
User avatar

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

Quote:
Noticed some disadvantage in "TP stop" blocks because these blocks are connected with "onCandle" main block through "defaultPeriod" variable (1 Day). In reality, TP could be reached in middle of the day and because "onCandle" block, stop strategy block would not be reached!? Because of that, think connect these blocks with "TradeEvent" will be much better solution. But, don't know how to do it. So Your knowledge will be much appreciate to me. :)


You almost found the solution with your above analysis: Yes the daily period will not help you to monitor the TP level or the rest of the conditions once reached. So the solution is to plug this part to 'more sensitive' period and you can simply do it from the first period filter out of the "not equal" exit as shown in the attached file. This will make the checks to be performed at any period different from the daily one which means 10sec, 1mn, 5mn, etc.. and if you dig into this logic, the 10sec checks will cover all the other periods. This is then a 10sec monitoring :)


Quote:
Didn't understood well (maybe because of my English), in IFs blocks already have "rcs_test1.ProfitLoss In Pips" variable so I need little more explanations of that?
Sorry for big post, but I think that could be interesting for other VJF users to improve their strategies also.

Forget about my comment, you're right as you're using the correct variable.
Your post is far from being a long one :) no need to be sorry..
check this out (very interesting ideas and implementation):
https://www.dukascopy.com/swiss/english ... 302#p87302

Cheers


Attachments:
RCS_test2.vfs [51.98 KiB]
Downloaded 179 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:  

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