Dukascopy
 
 
Wiki JStore Search Login

MAximum Spread
 Post subject: MAximum Spread Post rating: 0   New post Posted: Sun 29 May, 2016, 11:10 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 22:35
Posts: 21
Location: United KingdomUnited Kingdom
What blocks/input would I need to use to get the maximum spread and only trade if it is less than maximum input value? NOTE: I have multiple currency pairs in my strategy, each will need to check it's own maximum spread setting.


 
 Post subject: Re: MAximum Spread Post rating: 0   New post Posted: Mon 30 May, 2016, 15:40 
Visual JForex expert at Dukascopy
User avatar

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

How often will you need the spread calculation to be made ?
I'm asking this because there is no "standard" way to implement a spread calculation on more than a single instrument, but rather a workaround as the attached example. it basically updates the spread result every 3 ticks based on a counter. I agree it is not the simplest way but it helps.

Hope this helps.


Attachments:
MultiSpread.vfs [23.97 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: MAximum Spread Post rating: 0   New post Posted: Mon 30 May, 2016, 20:32 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 22:35
Posts: 21
Location: United KingdomUnited Kingdom
Thank you. The spread only needs to be calculated just before an order is placed. If the spread is less than set value then the trade will be placed, if it is higher than the set value then trade will not be placed. Perhaps for my solution I would only need to add the calculation block in your example before the trade is placed? I am not sure what the purpose of the "if - counter" blocks are and if they will be required in my scenario?

Please find attached a basic template I have done which shows how I "think" max spread would work - please advise if I am missing something. I would just use additional "MaxSpread" variables for other pairs, e.g. MaxSpreadEURUSD, etc.


Attachments:
MaxSpread.vfs [26.98 KiB]
Downloaded 163 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: MAximum Spread Post rating: 0   New post Posted: Tue 31 May, 2016, 08:42 
Visual JForex expert at Dukascopy
User avatar

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

I've included some comments in your file.
The counter is basically the purpose of the workaround: The reason of such implementation is due to the unavailability of simple method to use multiple instruments when working with ticks compared to the method when working with candles where we can use many "Get historical candles" blocks having each one dealing with an instrument.
So the counter is simply a way to perform a cycle of 3 ticks and switch the default instrument at every tick that comes.
We'll think about another method more user-friendly in the near future.

Cheers


Attachments:
MaxSpread_Commented.vfs [28.25 KiB]
Downloaded 169 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: MAximum Spread Post rating: 0   New post Posted: Wed 01 Jun, 2016, 22:03 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 22:35
Posts: 21
Location: United KingdomUnited Kingdom
Thank you. Seems as though this solution slows testing down to almost real time pace. Would be great if it could b faster but completely understand limitations at this time. Thanks again for your assistance.


 
 Post subject: Re: MAximum Spread Post rating: 0   New post Posted: Thu 02 Jun, 2016, 13:25 
Visual JForex expert at Dukascopy
User avatar

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

It is a heavy one indeed but I would suggest to implement a spread calculation per instrument in a dedicated file. You will have as much strategies as the number of instruments.
With this solution I assume that your trading idea is not implementing a cross-instrument logic (If condition A happens on instrument X then trade instrument Y) or any logic implementing 2 instruments and more.

cheers


 

Jump to:  

  © 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