Dukascopy
 
 
Wiki JStore Search Login

Very Slow Testing & Buggy
 Post subject: Very Slow Testing & Buggy Post rating: 0   New post Posted: Fri 04 Mar, 2016, 01:30 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 22:35
Posts: 21
Location: United KingdomUnited Kingdom
My strategy is so slow to test in JForex historical tester and there is a bug, please advise.

BUG:
Default instrument must be manually changed in the Visual JForex blocks and the strategy built again for each pair,. If using global variable set to true for default instrument and choosing a different pair other than the default in the Visual JForex blocks, the strategy will produce random entries all over the place. Is this a bug? Using the default currency works fine.

SUPER SLOW HISTORICAL TESTER
Do I need to use "tick" method of testing for accurate entries/exits and spreads? My strategy can enter/exit during a candle. It is painfully slow testing with ticks, is that normal? Maybe it is because when I first run a test for the last year the data has to first be downloaded? I maxed up the Java Heatmap and even after running a non-visual/non-optimized backtest for a year to collect the data, it is still extremely slow. I have a high spec PC setup. Maybe there is some unnecessary calls in my code? Please take a look :-)


 
 Post subject: Re: Very Slow Testing & Buggy Post rating: 0   New post Posted: Fri 04 Mar, 2016, 17:23 
Visual JForex expert at Dukascopy
User avatar

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

Quote:
BUG:
Default instrument must be manually changed in the Visual JForex blocks and the strategy built again for each pair,. If using global variable set to true for default instrument and choosing a different pair other than the default in the Visual JForex blocks, the strategy will produce random entries all over the place. Is this a bug? Using the default currency works fine.


This is a normal behavior, VJF is designed to trade on a given default instrument by this is not stopping to trade on more than one instrument.
When using more than a single instrument, the best practice is to avoid the use of "Default instrument" and call "Get historical candle with the needed instrument pair (frequently used with shift 1 to get full completed OHLC data)

Quote:
SUPER SLOW HISTORICAL TESTER
Do I need to use "tick" method of testing for accurate entries/exits and spreads? My strategy can enter/exit during a candle. It is painfully slow testing with ticks, is that normal? Maybe it is because when I first run a test for the last year the data has to first be downloaded? I maxed up the Java Heatmap and even after running a non-visual/non-optimized back-test for a year to collect the data, it is still extremely slow. I have a high spec PC setup. Maybe there is some unnecessary calls in my code? Please take a look :-)


Super slow: true :) this is because you're using many indicator blocks with the same inputs which is quite demanding in terms of resources. The update frequency itself is too high: every 10 sec the indicator should retrieve its output data (on 5mn period basis) and this 4 times in parallel. THis will slow down the flash interface (VJF) and requires more resources from the browser, the flash plugin etc ...
I've started some modifications on your file to optimize the way the strategy is built but I did not test it as I don't have a detailed description of the specifications. Please have a look and let me know in case you did not understand a certain logic / trigger / block

Cheers


Attachments:
VerySlow_butfaster.vfs [67.94 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.
 
 Post subject: Re: Very Slow Testing & Buggy Post rating: 0   New post Posted: Sat 05 Mar, 2016, 02:14 
User avatar

User rating: 0
Joined: Wed 04 Feb, 2015, 22:35
Posts: 21
Location: United KingdomUnited Kingdom
Thank you for that, it helped for reference and in the meantime I came up with a similar solution through browsing the forums and some trial and error. I did as you shown in the template and removed duplicate calls of the indicator.

As I would like to run the strategy on separate instruments without coding them all into one strategy, I understand the ONLY way to do this is to rename the buy/sell variables, chose a different "default instrument" depending on the currency pair I will run it on and save the strategy as a different name, e.g. "My_Strategy_GBPUSD". Is this correct?

I read a reply you posted to someone who wanted to run their strategy on separate instruments and allow them to limit trades independently and you suggested by using "logical steps" as currently there is no feature to check open orders limit on a specific currency pair, as "open positions" takes into account all pairs. This would be a great feature to add in the future but for now I guess the "best" way is renaming the variables and saving a separate strategy for each instrument that I wish to trade.

Thank you for your.


 
 Post subject: Re: Very Slow Testing & Buggy Post rating: 0   New post Posted: Mon 07 Mar, 2016, 12:24 
Visual JForex expert at Dukascopy
User avatar

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

Quote:
As I would like to run the strategy on separate instruments without coding them all into one strategy, I understand the ONLY way to do this is to rename the buy/sell variables, chose a different "default instrument" depending on the currency pair I will run it on and save the strategy as a different name, e.g. "My_Strategy_GBPUSD". Is this correct?

Unfortunately this is not the case anymore: It was possible to work this way before but we recently enhanced the "position amount" variable (number of open positions) to be able to retrieve all the opened positions on any instrument. So even if you use many strategy files, the use of position number condition will interfere across the strategies .
So I recommend you to use the logical triggers instead till we release the new block that will handle this feature in a more user friendly way.

Thanks


 

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