Dukascopy
 
 
Wiki JStore Search Login

Idea of a multi-entry strategy
 Post subject: Re: Idea of a multi-entry strategy Post rating: 0   New post Posted: Thu 31 Aug, 2017, 10:46 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello Amine,


while waiting patiently for your answer, I tried a lot and the following could be achived: The trailer doesn't move the wrong direction any more - the reason was a wrong use of "+" and "-" in the formula. After this problem was solved, a new one occured: Sometimes the trailer skips over a step. The reason for that is the way the blocks are linked. I could find a workaround on the first step of the trailer, but this is no suitable solution, because the remaining steps of the trailer can't be linked anymore. At least I do not know how to link them. That's why I ask you once again to check the trailer. You can test it for example in EURUSD, 2017-08-11, 2:26GMT. I added two notes in the attached strategy.
Furthermore I still get an error message (please see attached screenshot). What does it mean?


Thank you in advance for your answer!

Yours sincerely
Lunas


Attachments:
error_message.pdf [153.34 KiB]
Downloaded 109 times
trailer_difficulty.vfs [105.62 KiB]
Downloaded 189 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: Idea of a multi-entry strategy Post rating: 1   New post Posted: Fri 01 Sep, 2017, 12:08 
Visual JForex expert at Dukascopy
User avatar

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

I had a quick look and made a little modification of the used P&L: intead of using the PnL as Double type and assigned it to an integerso that we get rid of the cases where 2.1pips is not equal to 2 pips you see ?
I'm not 100% sure but it's worth to try.

As for the "null" error, I dono yet ... probably the strategy is comparing some variables that doesn't get a value yet ? (logic issue with OnTick method / Candle method ?)


Attachments:
trailer_difficulty_V2.vfs [107.89 KiB]
Downloaded 172 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Fri 22 Sep, 2017, 11:13 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello Amine,


thanks to your sophisticated workaround (integer, double) the problems we were confronted with seem to be solved. The trailer now moves where it didn't move at all and it doesn't skip steps anymore. But now we have a new little problem: Once the third step of the trailer is reached, the trailer jumps back to the second step as soon as the price comes closer to the third trailer step. I tried to solve this by adding a few assign blocks - according to our earlier version of the trailer. In a certain way it seems to work: In backtests positions now are closed on the third step of the trailer. But on the screen the trailer always jumps between third and second step. I remember a similar problem months ago. At that time the problem could be solved with some assign blocks. This time it helped only a little.
That's why I ask you again to check the trailer. With my limited VJF-knowledge I think NOW IT SHOULD BE REALLY ONLY A LITTLE THING.

Thank you in advance for your help!


Yours sincerely
Lunas


Attachments:
trailer_difficulty_V3.vfs [122.43 KiB]
Downloaded 175 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Fri 22 Sep, 2017, 11:46 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Forgot to mention a good opportunity to test the trailer:
2017-08-11
02:35 GMT

Cheers


 
The Best Answer  Post subject: Re: Idea of a multi-entry strategy Post rating: 1   New post Posted: Tue 17 Oct, 2017, 10:37 
Visual JForex expert at Dukascopy
User avatar

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

Sorry again for the late reply/.
I actually worked out your previous version while ago but somehow forgot to post a reply :o Too bad !
Alright, attached is the version in question so please test it and let me know. I did not had enough time to test it thoroughly but we'll get to the final point soon !


Attachments:
trailer_difficulty_V3.vfs [117.36 KiB]
Downloaded 175 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Thu 19 Oct, 2017, 17:20 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello Amine,


thank you for helping me again! After several backtests the following turned out:

The long side:
The trailer works almost properly now, but I found one mistake nevertheless: The trailer skips one step at 2017-05-19, 8:20 GMT, EURUSD

The short side:
The trailer doesn't work properly. Mostly the trailer doesn't start at all. It remains all the time at its initial level - for example here: 2017-10-13, 14:24 GMT, EURUSD

While trying to understand the logic of the trailer you built, I found a slight difference between long and short (please see attached file): There's one more "if-block" on the short side. I did backtests with this "if-block" and without it - there was no difference in the results. By the way: I didn't understand the values in two of the "assign-blocks" (please see attached file).
To me the logic seems to be the same on both long and short (at least if the aforementioned "if-block" is removed), but the trailer behaves different on long and short. To me it is unclear, why. For testing purposes I also changed the value of one of the aforementioned "assign-blocks" and again: The trailer behaves different on long and short nevertheless.
I guess you have an idea regarding the probable reason and a possible solution. As you said:
Quote:
we'll get to the final point soon !



Thank you in advance for your answer!

Yours sincerely
Lunas


Attachments:
assign_and_trailer.pdf [102.56 KiB]
Downloaded 85 times
trailer_difficulty_V5.vfs [117.4 KiB]
Downloaded 145 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Thu 16 Nov, 2017, 19:10 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello,


in the meantime I did some more tests regarding the trailer. I think our problem, that the trailer sometimes skips a step of the trailing logic, is still attributable to the use of "integer" or "double". In the strategy, that I attached in my last post, I changed the value of the variable "ProfitLoss in Pips" for testing purposes. It turned out, that the trailer didn't skip a step anymore. Therefore we can assume, the the logic itsself is free of bugs - we just need to get rid of this "integer/double-problem". But I have no idea how to solve this. Nothing I tried was successful.
That's why I'm asking you to revise the trailer a little. A good possibility to test: 2017-10-13, 12:33 GMT and 14:24 GMT. Changing the first step of the trailer (please see attached file) leads to different results for both of the two mentioned times.

Thank you in advance for your answer!


Yours sincerely
Lunas


Attachments:
question_regarding_trailer.pdf [105.04 KiB]
Downloaded 83 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: Idea of a multi-entry strategy Post rating: 1   New post Posted: Thu 30 Nov, 2017, 14:01 
Visual JForex expert at Dukascopy
User avatar

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

Did you had a chance to improve your strategy ?
I'm not sure what I'm supposed to look at...


 
 Post subject: Re: Idea of a multi-entry strategy Post rating: 0   New post Posted: Tue 05 Dec, 2017, 19:15 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello Amine,



nice of you to ask and sorry for my late answer!

Well.....the trailer still skips over a step occasionally. Changing the value of the threshold (trigger) sometimes helps, but it helps only in this particular situation and it doesn't solve the problem whatever it is. Here's an example: Let's assume the strategy opened a long position and this position is 2 pips in profit. Now the trailer should move from the initial SL to the entry price +1pip. But it doesn't. The SL stays at its initial level. But as soon as the second step of the trailing logic should be triggered (for example: the position is now 10 pips in profit), the trailer finally moves. At that point, the trailer is supposed to move already for the second time, but - in fact - it moves just for the first time. Remembering this finding, let's now assume, we changed the value of the trailer slightly. Now the position needs to be 3 pips in profit (instead of 2 pips as before), before the trailer moves from the initial SL to entry price +1pip. And now the trailer moves indeed! In the same situation as before! Strange......
I tried some things to solve this issue: Changing the logic here and there, replacing "double" by "integer" and vice versa, adding "assign" blocks.......all unsuccessful. Now why does this happen? I'm just a VJF amateur, but I think it could be still a "double/integer" issue (as you already supposed earlier) or a "pips/price" issue. I never payed attention to the fact, that our "open@market" blocks worked with "pips" (settings of the block) whereas the block "Set Stop Loss" worked with "price".
In the meantime I changed the settings of "open@market", so that both the initial SL and TP are now in "price format" instead of "pips format". I did this especially because of the possibility to have decimals in SL (for example SL=1.5), but perhaps it can help in our current issue as well?
However, the change from "pips" to "price" requires additional modifications in the trailing logic (please see attached strategy with comments/questions). I tried to do them on my own, but there are questions, I couldn't find a solution for:

1.)
The change in the settings of "open@market" (from "pips" to "price") required the additional use of the blocks "Set Stop Loss" and "Set Take Profit". But we already use "Set Stop Loss" in the trailer.....How to avoid a confusion of both by the strategy?

2.)
I'm still intending to run the strategy on several instruments (entries), but with only one global exit strategy - the trailer we are working on currently. Not sure, whether my idea of a possible set-up of this modificated global trailer is feasible (please see attached strategy).


Now after my long introduction:

A)
We need to find a way to prevent the trailer from skipping over a step occasionally.

B)
The trailing logic needs some modifications due to the change from "pips" to "price" and to be prepared for multi entry running. But I guess these modifications are nothing complicated for you and neither cause new problems nor prevent solving the current problem of skipping over a step of the trailing logic.


By the way: When reading the information regarding the use of the "assign" block I saw the advice, that one shouldn't use different types of variables. Currently we are using "assign" containing "double" and "integer" simultaneously. Can this be a problem? I don't know, it's just a thought though.



I hope I mentioned all necessary information. If you have any questions nevertheless, please do not hesitate to ask.
Thank you in advance for your help.

Yours sincerely
Lunas


Attachments:
trailer_difficulty_V6.vfs [111.27 KiB]
Downloaded 157 times
common_or_individual_variable.pdf [184.65 KiB]
Downloaded 81 times
use_of_assign_block.pdf [289.69 KiB]
Downloaded 84 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Fri 15 Dec, 2017, 12:11 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello Amine,


to simplify my previous post:
The trailer is supposed to move in several steps: If the long position is x pips in profit -> move to entry price +y pips. If a short position is x pips in profit -> move to entry price -y pips. But the trailer still skips over a step occasionally. At the moment it doesn't work at all due to a modification in the entry logic: The strategy doensn't run with default SL / TP anymore. Now both SL and TP are calculated in price format instead of pips format.

Just a thought: The information regarding the use of the "assign" block contain the advice, that an "assign" block should use just one type of variables - currently we are using double and integer simultaneously. Can this be a problem?
A good possibility to test the trailer: 2017-12-13, 23:36 GMT and 2017-12-14, 1:43 GMT

Therefore I ask you to investigate the trailer. At the moment it doesn't work at all (due to my obviously incomplete modification) and even without this modification it sometimes skips a step. Please take into consideration, that the block "Set Stop Loss" is now used not only in the trailer, but also in the entry part!


Thank you in advance for your continuous and patient help!

Yours sincerely
Lunas


Attachments:
trailer_difficulty_V7.vfs [74.52 KiB]
Downloaded 150 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Mon 18 Dec, 2017, 07:39 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Hello Lunas,

I understand that you have opened this thread to have a one-on-one discussion with Mr.Chourou about your strategy, which apparently since your initial post has evolved in to something along the lines of Captain Kirk's "boldly go where no man has gone before". :mrgreen:

Though, I will point out a few things to you that should be a satisfactory explanation as to why on earth is your strategy stealing your +1 pip. :evil:

However, I do have a question to ask first that why are your blocks placed so far apart from one another ? If the workspace of Visual JForex Flash Editor be a world map, then really to fly from Switzerland to China you are going over the American continent and then taking the same route to get back. Frankly, I had to spend more time navigating through your strategy's workspace than it took to read the component blocks and comprehend the logic of your strategy. Now I really feel sorry for Mr.Chourou, as to how many trips he had to take. :P Okay, pardon my pun and now let me get serious and provide you with some insightful advice. :geek:

First off, please understand that backtesting of a strategy never reflects the same results that are obtained from actual live price movement. Also, many of the indicators will re-adjust themselves long after in their duration of price movements. Third point to consider is the speed at which the backtesting is occurring, thus the possibility of slippage along the way. Above all and more importantly, I am 100% sure that you are backtesting on the inbuilt Strategy Processor of the Visual JForex Flash editor, which was added decades ago off of some third world country when Dukascopy did not had the technology to make avail such a feature on their own JForex platform. Know this, there is a huge difference between backtesting on the JForex platform and on that built-in Strategy Processor of Visual JForex Flash editor. To name one of the dissimilarities is the spread and in the case of the EUR/USD pair if I am not mistaken, it is somewhere around 1.2 up to 3 pips during normal trading sessions when compared to the 0.1 - 0.4 pip of spread available to us from Dukascopy. I can go on about many other differences because I have wasted many months using that Strategy Processor. Try to only use that Strategy Processor when you want to do just a quick check of whether your strategy works or not and for a thorough test; export your strategy in .JAVA format and import it to the JForex Platform. Once you follow my suggestion you will get to see all the errors after errors that are being generated by your strategy in the comment section of JForex platform's Historical Tester tab and it may possibly help you correct your strategy accordingly and save all those +1 pips that you are currently losing.

PS: Fiddle around with the available "Custom Trailing Stop" component, perhaps! :idea:


 
 Post subject: Re: Idea of a multi-entry strategy Post rating: 0   New post Posted: Mon 18 Dec, 2017, 17:58 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello FXRabbit,


1.)
Quote:
why on earth is your strategy stealing your +1 pip. :evil:

My Strategy doesn't "steal" pips as you call it - it is just not working properly. My strategy is based on a good risk/return ratio. One pip more or less may seem to be a minor detail, but it is an important contribution to the aforementioned risk/return ratio. One pip more or less....there is a huge influence on the annual risk/return ratio.

2.)
Quote:
why are your blocks placed so far apart from one another ?

The subject of my thread is "Idea of a multi-entry strategy". This means I'm planning to add further entries. These entries also need a little space on the screen. Furthermore: I consider it to be useful if the strategy is clearly structured. It can be time-consuming to find a possible bug in a strategy which is structured unclear. Having only little space between the blocks means: you possibly do not have enough space to expand a group of blocks. The result of that: Some blocks are covered with other blocks.

3.)
Quote:
if I am not mistaken, it is somewhere around 1.2 up to 3 pips during normal trading sessions when compared to the 0.1 - 0.4 pip of spread available to us from Dukascopy.

My strategy is running with a slippage of 5 pips - that should be sufficient "during normal trading sessions" even in the face of a spread of up to 3 pips. Moreover: I do not only have experiences in backtests. A previous version of the trailer already ran in realtime demo and realtime live!!! The Trailer skiped over a step even then. And that happened after a successful compilation with no error messages in the comment section of the JForex platform.

4.)
Quote:
Fiddle around with the available "Custom Trailing Stop" component, perhaps!

As far as I know, the "Custom Trailing Stop" always moves after a certain number of pips:
Position A is 10 pips in profit -> Trailer moves first (for example 5 pips)
Position A is now 20 pips in profit -> Trailer moves again (for example another 5 pips)
Position A is now 30 pips in profit -> Trailer moves again (for example another 5 pips)......
That's not the solution I'm looking for. The trailer is supposed to move in small intervals at first and in bigger intervals later.


Yours sincerely
Lunas


 
 Post subject: Re: Idea of a multi-entry strategy Post rating: 0   New post Posted: Mon 18 Dec, 2017, 20:44 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Greetings,

I am glad for that you know how to backtest your strategy on the JForex platform and I will strongly suggest to you to take that route instead of using the Strategy Processor of the Visual JForex Flash editor because the comment section of the Historical Tester in the JForex platform will give you live feedback for every error that occurs during the backtesting. Most of the printed comments are easy to understand and those errors can be fixed right away. Needless to say that the indicators will also reflect accurate calculations as desired and the spread difference will not be an issue either. However, should you not be able to understand any of the error messages arising from your strategy, then please post a screenshot of them on your thread here. Though, I have already backtest your current version of the strategy and I know what error messages you will witness and be assured that there is very simple solution for them but it will be better if you take the first go at resolving it. :ugeek:



Good Luck!


 
 Post subject: Re: Idea of a multi-entry strategy Post rating: 0   New post Posted: Fri 22 Dec, 2017, 11:42 
User avatar

User rating: 2
Joined: Mon 02 Apr, 2012, 18:00
Posts: 61
Hello FXRabbit,


thank you for your answer.
I tried to follow your advice: I did some backtests and realtime tests (in the JForex platform and not in the VJF environment!!!!). As you can see from the attached pdf-file, I just got an error message leading me to the block "Set Stop Loss" in the trailing part. I found a mistake in the output variables - the one used in the block "Open@Market" was a different one than in the trailing part (block "Set Stop Loss"). After correcting this I did some more tests, but the result was the same: The trailer still doesn't move occasionally.
How did you manage to get a comprehensible error message?

Thank you in advance for your answer!


Yours sincerely
Lunas


Attachments:
tests_in_platform.pdf [434.67 KiB]
Downloaded 94 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: Idea of a multi-entry strategy Post rating: 0   New post Posted: Fri 22 Dec, 2017, 20:46 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Greetings again Lunas,

Please upload your screenshots in .PNG or .JPEG format as I do not have the liberty to open .PDF files.

Now, as far as the description pertaining to the error messages is a concern; most of them are self-explanatory but few can be difficult to recognize. In my case, I have been able to learn about a majority of them from the trail and error during the backtest of my strategies. However, I am confident that either there must be a library for such information with detailed summary of each error message on the Dukascopy's wiki or the next best place to look for them is in the sub-forum of Automated Trading. You may also open a topic in the Automated Trading sub-forum to inquire about any specific error message.


 
 Post subject: Re: Idea of a multi-entry strategy Post rating: 1   New post Posted: Tue 26 Dec, 2017, 14:42 
Visual JForex expert at Dukascopy
User avatar

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

I noticed the following:
--> Out of your OnTick method, the IF block managing "No value" variables is plugged the wrong way, corrected.
Also, there is no problem with the assign block at all/ this doesn't affect the issue that we're facing ... can you test the attached and let me know ?

thx


Attachments:
trailer_difficulty_V11.vfs [82.74 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.
 

Jump to:  

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