Dukascopy
 
 
Wiki JStore Search Login

How to set SL and TP as current candle close?
 Post subject: How to set SL and TP as current candle close? Post rating: 0   New post Posted: Mon 11 Nov, 2013, 21:33 
User avatar

User rating: 0
Joined: Mon 11 Mar, 2013, 00:00
Posts: 47
Location: Colombia, manizales
Hi Dukas community, I am trying to set stop loss and take profit as current candle close. In the strategy I open a buy position after a bullish candle and a sell position after a sell one. I tried to set SL and TP as position close price, but it does not work, I also tried to get historical candle close price (shift 0 and shift -1), but it did not work as well. Anyone could help me sort this out?.



Thanks a lot.


 
 Post subject: Re: How to set SL and TP as current candle close? Post rating: 0   New post Posted: Tue 12 Nov, 2013, 11:33 
Visual JForex expert at Dukascopy
User avatar

User rating: 27
Joined: Fri 03 May, 2013, 18:25
Posts: 366
Location: GermanyGermany
Greetings!

First of all: shift -1 does not exist!!! It would mean that you want to have a future candle which is not possible!

You have at least two possibilities to do that:

Please check the attachment.


Attachments:
Candle_Close.vfs [32.9 KiB]
Downloaded 185 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 set SL and TP as current candle close? Post rating: 0   New post Posted: Thu 14 Nov, 2013, 07:53 
User avatar

User rating: 0
Joined: Mon 11 Mar, 2013, 00:00
Posts: 47
Location: Colombia, manizales
Hi dirk_r1 and thanks for answering my question.

I have been trying to use your sample, but so far nothing seems to work. I will attach first my strategy, in which I want it to open a buy or sell position depending on candle (whether is bearish or bullish). After that, I want to set current candle close (the one in which I just opened the position as TP or SL (depending on if it is a bearish or bullish candle).

Here is an image so you can see what seems to be the problem:
Image


Attachments:
StrategySample.vfs [44.79 KiB]
Downloaded 166 times
Chart_EUR_USD_4 Hours_snapshot.png [39.18 KiB]
Downloaded 394 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 set SL and TP as current candle close? Post rating: 0   New post Posted: Thu 14 Nov, 2013, 07:55 
User avatar

User rating: 0
Joined: Mon 11 Mar, 2013, 00:00
Posts: 47
Location: Colombia, manizales
I tried also to use your both methods, in one I got this error message:
Image

Here is attached the strategy when trying to use one of your methods.

I will really really appreciate if you can help me with this, I do not expect this strategy to be profitable, I just want to keep learning to use VisualJforex. It is more like trying to solve the problem so I can continue experimenting.

Thanks
Juan David Arce
Colombia


Attachments:
Tryingtouseyouradvice.vfs [52.25 KiB]
Downloaded 158 times
error message.png [15.77 KiB]
Downloaded 458 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