Dukascopy
 
 
Wiki JStore Search Login

How to run a strategy in several instruments
 Post subject: How to run a strategy in several instruments Post rating: 0   New post Posted: Wed 06 Jul, 2016, 00:22 
User avatar

User rating: 0
Joined: Mon 11 Mar, 2013, 00:00
Posts: 47
Location: Colombia, manizales
Hello Dukascopy Community,

I am trying to figure out how to build a strategy and then run the same strategy in more than one instrument using visualjforex.

The strategy sample is called "MultipleInstruments1", which you can download. The logic is simple: the strategy opens a buy position when SMA short crossover SMA long from below and viceversa.

Now I want this strategy to run in more than one instrument, lets say two, so I create a new strategy called "MultipleInstruments2" and add "MultipleInstuments1" as a strategy block as mentioned here: https://www.dukascopy.com/vfhelper/arti ... _locale=EN

the problem is that if I try to change any variable, for example the SMA long time period (I want to change it from 50 periods to 100 periods)

Image

I always get a server error message when building it:

Image

How can I do this? I build a strategy for a client, which took me weeks, and is way way more complex than this one, and there is only one thing left to do, duplicate the strategy so it can be run in several instruments. How can you do that with strategy blocks? and if is not possible, what is the use of strategy blocks?

Thanks, I reallly appreciate your help on this.


Attachments:
3.PNG [178.46 KiB]
Downloaded 630 times
MultipleInstruments1.vfs [28.62 KiB]
Downloaded 137 times
MultipleInstruments2.vfs [14.08 KiB]
Downloaded 143 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 run a strategy in several instruments Post rating: 0   New post Posted: Wed 06 Jul, 2016, 21:04 
Visual JForex expert at Dukascopy
User avatar

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

There is an easier way to run your strategy on many instruments:
- Get your strategy on a single instrument (full strategy in blocks not the embedded one as a single block)
- Save it and create as more copies as you want on other instruments then run different strategies on your instruments separately.

If you have any condition related to position limitation, let me know as there is some adjustments to be done.


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 27 Oct, 2016, 01:23 
User avatar

User rating: 1
Joined: Tue 12 May, 2015, 18:13
Posts: 34
Location: United Kingdom, Headington
amine_chourou wrote:
Hi,

There is an easier way to run your strategy on many instruments:
- Get your strategy on a single instrument (full strategy in blocks not the embedded one as a single block)
- Save it and create as more copies as you want on other instruments then run different strategies on your instruments separately.

If you have any condition related to position limitation, let me know as there is some adjustments to be done.



hey amine can you show this?

basically I made entry strategy for 1 instrument, that I want to set up on all the instruments i want to buy/sell that day. I ran multiple copies, but i want position to stay at 1 for each instrument.

So , what I want is when i get a signal on EURUSD, it sells 1 position and only 1, but if USDCAD gets signal it would open there too. TY


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 27 Oct, 2016, 10:41 
Visual JForex expert at Dukascopy
User avatar

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

The idea is to avoid the use of any condition with "Position Amount" as this variable looks for any open position regardless of the traded instrument.
The example attached above "MultipleInstruments1" shows the way the number of open positions are handled with the Boolean variable "Opened_Positions" and the way it switches to true/False. You should implement the same logic and then run your strategies on the needed instruments.
How many instruments are you planning to use ?

Thanks


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 1   New post Posted: Thu 27 Oct, 2016, 10:43 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Here is the same example slightly modified...


Attachments:
MultipleInstruments1_V2.vfs [30.64 KiB]
Downloaded 195 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 run a strategy in several instruments Post rating: 0   New post Posted: Thu 27 Oct, 2016, 11:38 
User avatar

User rating: 1
Joined: Tue 12 May, 2015, 18:13
Posts: 34
Location: United Kingdom, Headington
amine_chourou wrote:
Hi there !

The idea is to avoid the use of any condition with "Position Amount" as this variable looks for any open position regardless of the traded instrument.
The example attached above "MultipleInstruments1" shows the way the number of open positions are handled with the Boolean variable "Opened_Positions" and the way it switches to true/False. You should implement the same logic and then run your strategies on the needed instruments.
How many instruments are you planning to use ?

Thanks



20 ish in total , probably 3-7 instances of the strategy running a day


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 27 Oct, 2016, 11:53 
User avatar

User rating: 1
Joined: Tue 12 May, 2015, 18:13
Posts: 34
Location: United Kingdom, Headington
amine_chourou wrote:
Here is the same example slightly modified...


ill give it a whirl , ty amine


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 10 Nov, 2016, 21:07 

User rating: 1
Joined: Tue 12 Jul, 2016, 06:14
Posts: 8
amine_chourou wrote:
Hi,

There is an easier way to run your strategy on many instruments:
- Get your strategy on a single instrument (full strategy in blocks not the embedded one as a single block)
- Save it and create as more copies as you want on other instruments then run different strategies on your instruments separately.

If you have any condition related to position limitation, let me know as there is some adjustments to be done.



Hi Amine!

Jumping on the bandwagon, I've got multiple strategies, and multiple positions in each strategy, but I can't make it work! I've used the "position amount" block for all my strategies until now. But I as you said, it counts all positions.

I've tried to make a count using the trade event messages, but that didn't work. I also read about using the brown comments blocks, but I never used them...

Any advice?

Thanks in advance,

Koen


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Fri 11 Nov, 2016, 09:15 
User avatar

User rating: 0
Joined: Fri 19 Sep, 2014, 12:05
Posts: 61
Location: Italy, montopoli di sabina
Hello great,

but for example spread strategies between two pairs it could be utilized the visual VJF ?
Suppose you have two correlated pairs P1 and P2 and you can assume that both are correlated with a commodity.
When the commodity is bullish the tendency is that both the pair are bullish. Suppose that one (P2) have a lower gain in comparison
to the other (P1).
And suppose that you want to try to make profit from this, buying P1 and selling P2.
The strategy should calculate P1 and P2 in the same procedure to suggest an entry.

Is that in VJF possible ?


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Fri 11 Nov, 2016, 15:00 
Visual JForex expert at Dukascopy
User avatar

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

@kawjansen

This is feasible using customized variable that acts as logical trigger for each currency pair. can you attach your strategy so that I can have a look ?
If you wish to keep it private, you can send to support @dukascopy.com and address your email to me.

@foreignexchange

Quote:
But for example spread strategies between two pairs it could be utilized the visual VJF ?


Yes it is. Check the attached example.

Cheers


Attachments:
Example_multi.vfs [32.47 KiB]
Downloaded 151 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 run a strategy in several instruments Post rating: 0   New post Posted: Fri 11 Nov, 2016, 15:25 
User avatar

User rating: 0
Joined: Fri 19 Sep, 2014, 12:05
Posts: 61
Location: Italy, montopoli di sabina
:D ;)


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Fri 11 Nov, 2016, 17:53 

User rating: 1
Joined: Tue 12 Jul, 2016, 06:14
Posts: 8
amine_chourou wrote:
Hi !

@kawjansen

This is feasible using customized variable that acts as logical trigger for each currency pair. can you attach your strategy so that I can have a look ?
If you wish to keep it private, you can send to support @dukascopy.com and address your email to me.

@foreignexchange

Quote:
But for example spread strategies between two pairs it could be utilized the visual VJF ?


Yes it is. Check the attached example.

Cheers



For sake of simplicity (also to other people seeking support) can you please use the SMA example used above?

Kind regards,

Koen


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Wed 16 Nov, 2016, 12:48 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Here it is ...


Attachments:
MultipleInstruments1_V3.vfs [41.58 KiB]
Downloaded 200 times
MultipleInstruments1_V3.vfs [41.07 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: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 17 Nov, 2016, 13:09 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 115
Location: Ukraine, Odessa
Greetings Amine!
I have a question that relates to this topic.
How to get a signals from another instruments, but to trade only one? Cross logic system.

File sent you via email.


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 1   New post Posted: Thu 17 Nov, 2016, 18:38 

User rating: 1
Joined: Tue 12 Jul, 2016, 06:14
Posts: 8
First of all, thank you Amine. It's really good to have some support around in case when you need it.

As for Illya, if you need signals from other currency pairs, I'd use the "get historical candle(s)" blocks and the the instrument to a fixed one (or create a variable to keep consistency). And use the new candle to compute signals. For indicators you can do the same.


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 17 Nov, 2016, 18:39 

User rating: 1
Joined: Tue 12 Jul, 2016, 06:14
Posts: 8
kawjansen wrote:
First of all, thank you Amine. It's really good to have some support around in case when you need it.

As for Illya, if you need signals from other currency pairs, I'd use the "get historical candle(s)" blocks and the the instrument to a fixed one (or create a variable to keep consistency). And use the new candle to compute signals. For indicators you can do the same.


He also shows it in the Multiple instruments V3


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Thu 17 Nov, 2016, 19:11 
User avatar

User rating: 6
Joined: Wed 05 Mar, 2014, 12:00
Posts: 115
Location: Ukraine, Odessa
Ďakujem za Vašu odpoveď, Kawjansen. Budem sledovať na vašu radu!
You get straight to the point.


 
 Post subject: Re: How to run a strategy in several instruments Post rating: 0   New post Posted: Tue 06 Mar, 2018, 20:38 

User rating: 1
Joined: Tue 12 Jul, 2016, 06:14
Posts: 8
amine_chourou wrote:
Here is the same example slightly modified...



Exactly what I was looking for!

Thanks!


 

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