Dukascopy
 
 
Wiki JStore Search Login

Can't test strategy
 Post subject: Can't test strategy Post rating: 0   New post Posted: Wed 06 Apr, 2016, 11:28 
User avatar

User rating: 0
Joined: Tue 08 Mar, 2016, 18:41
Posts: 9
Location: ItalyItaly
Hi,
I just put together a dummy strategy to test if some calculations work, but when I try to run it, it jumps straight away to the end without opening any position (and thus not letting me see the results of my calculated variables).
If I try to run it through the historical tester in jforex live platform, though, it works and regularly opens continuos positions... but doing so I can't see the variables either.
Can you help me?

Here's the file:
https://dl.dropboxusercontent.com/u/69442751/CalculationsTest.vfs

could you also describe (with an example maybe) how to implement and use the "print" function directly into the generated code to display the variables in the live platform?

Thanks!!


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Wed 06 Apr, 2016, 15:24 
Visual JForex expert at Dukascopy
User avatar

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

Unfortunately I cannot access your file as your link seems to be corrupted.
As of the print function, you have to insert it manually in the code for the variables that you want their values to be displayed..
The function is :

console.getOut().println(Your_variable_name)


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Wed 06 Apr, 2016, 16:55 
User avatar

User rating: 0
Joined: Tue 08 Mar, 2016, 18:41
Posts: 9
Location: ItalyItaly
Thank you for the code :)

the link should work if you right-click on it and choose "save as", however here's another, just to be sure:
https://s000.tinyupload.com/index.php?fi ... 4784952926

(unfortunately I can't attach the file directly to the forum, I don't know why, maybe it's my browser)


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Thu 07 Apr, 2016, 08:44 
Visual JForex expert at Dukascopy
User avatar

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

Thanks, the link works perfectly when right-clicking.
You need to set a start value to all your variables having the type "Double" to avoid any calculation issue (errors are happening at the very first loop where these variables get their first result generally)
Besides, are you sure about your calculation "power((A1-A2-A3), 2)+A4" as your result A4 is used both as a result and inside the operation (it will keep on growing endlessly)

As regarding the attachments, this is not dur to your browser but caused by an issue at our level. It will be fixed shortly.

Thanks


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Thu 07 Apr, 2016, 12:08 
User avatar

User rating: 0
Joined: Tue 08 Mar, 2016, 18:41
Posts: 9
Location: ItalyItaly
Yes, the ever-growing number is indeed an error, I think I fixed that using a couple of "assign" blocks resetting the variables before the "loop viewers". Thanks!

I tried to set a start value of 0 to all the "double" variables, but still when I build and run the strategy from within visual jforex, it jumps straight away to conclusion without opening any position at all... it doesn't even show the blue loading bar over the pink bar at the bottom of the window (the one that usually shows while the strategy is running after loading historical data)


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Thu 07 Apr, 2016, 14:39 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
What are your run-time parameters for testing ?
Are you testing on intraday basis ? Do you have the same result when slecting last week for instance ?
I'm saying this because you're using 'Day' period so testing on intrady for instance doesn't make sense and will led a sudden stop with errors generated (back-end: in the Java console if you have it activated)

PS: feel free to attach your latest work so that I can double check
Cheers


 
 Post subject: Re: Can't test strategy Post rating: 0   New post Posted: Thu 07 Apr, 2016, 15:05 
User avatar

User rating: 0
Joined: Tue 08 Mar, 2016, 18:41
Posts: 9
Location: ItalyItaly
I select last month or last three months, here's a screenshot of the parameters
Image

and this is what I get immediately after:
Image

here's also the updated version of the calculations

Thanks!


Attachments:
Schermata 2016-04-07 alle 15.52.40.jpg [37.03 KiB]
Downloaded 331 times
Schermata 2016-04-07 alle 15.59.28.jpg [91.12 KiB]
Downloaded 311 times
CalculationsTest2.vfs [36.44 KiB]
Downloaded 170 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:  

  © 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