Dukascopy
 
 
Wiki JStore Search Login

Visual JForex vs Java source code
 Post subject: Visual JForex vs Java source code Post rating: 0   New post Posted: Wed 11 Dec, 2013, 17:26 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Hello Support ,

I have a question about the code behind the Visual JForex.
In my strategy I noticed the following:

IBar bidBar = context.getHistory().getBar(defaultInstrument, Period.ONE_MIN, OfferSide.BID, 1);
IBar askBar = context.getHistory().getBar(defaultInstrument, Period.ONE_MIN, OfferSide.ASK, 1);
LastAskCandle = new Candle(askBar, Period.ONE_MIN, defaultInstrument, OfferSide.ASK);
LastBidCandle = new Candle(bidBar, Period.ONE_MIN, defaultInstrument, OfferSide.BID);

Although the strategy is built in Visual JForex and has no reference to ONE_MIN period, why is this used here ?
My understanding of Java code is limited to a beginner's course I took 9 months ago :)
Shouldn't it be TEN_MIN like I specified in the defaultPeriod ?
I attached the visual strategy along with the Java code behind it.
Maybe someone more experienced than me can shed some light.
Thank you.

Cheers


Attachments:
Heruar.vfs [31.14 KiB]
Downloaded 292 times
Heruar.java [18.98 KiB]
Downloaded 305 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: Visual JForex vs Java source code Post rating: 0   New post Posted: Tue 17 Dec, 2013, 16:30 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Nobody cares to answer this ?
...


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Thu 19 Dec, 2013, 10:16 
Visual JForex expert at Dukascopy
User avatar

User rating: 4
Joined: Fri 06 Feb, 2009, 16:34
Posts: 130
Hello

I dont see any problem, due that

IBar bidBar
IBar askBar
LastAskCandle
LastBidCandle


has One_Minute period in moment of strategy initialization, later they will be set to the defaultPeriod.
But, even in case of initial values, will be more nice to use defaultPeriod and it will be fixed in next version.


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Thu 19 Dec, 2013, 17:12 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Hello Support !

First off, THANK YOU for the reply on my birthday :)

Now, the reason I wrote to you is because my strategy doesn't work as intended. There are some very weird decisions it makes and those decisions don't reflect the code.
Could you please tell me what getPeriod() does ? I searched everywhere in the API library and couldn't find it.
I'm trying to figure out why my strategy doesn't respect the conditions set for opening positions.

Thank you


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Mon 23 Dec, 2013, 15:05 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Greetings.

According to reply of Visual Support problem is not in Java code.
Can you specify what strategy is intended to do, then we can identify where the problem comes from.

P.S. In the second TVS block Shift1 is set = 2, that can be a confusion.

Best regards, Support team.


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Thu 26 Dec, 2013, 09:25 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Hi Vadim ,

Thank you for the reply.
My strategy has a few simple conditions:

- 3 indicators that all work on 10 minute candles for 12 candle time periods: sma, ema and tvs
- there are 2 TVS (time segmented volume) variables, one for current candle and one for 2 candles back (hence the shift1 = 2, value)
- the conditions are: sma > ema, tvs1 (current candle) > tvs2 (2 candles back) and both tvs's > 0 --> Sell , and for buy is the exact opposite.

My problem is with the TVS indicators: the rules are not working right. I get orders without these conditions being met.
I attached the strategy to have a look again.
Thank you.

Cheers


Attachments:
Heruar.vfs [31.14 KiB]
Downloaded 273 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: Visual JForex vs Java source code Post rating: 0   New post Posted: Mon 30 Dec, 2013, 17:04 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Heruar wrote:
My problem is with the TVS indicators: the rules are not working right. I get orders without these conditions being met.


Pictures from VJ tester would be helpful to understand the situation.


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Sat 04 Jan, 2014, 12:47 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Hi Vadim ,

I attached a picture from my strategy contest account to showcase what I mean.
If you look at my previous post and check the conditions you'll see that the TVS2 is above 0 and TVS1 is below 0, in the picture.
Waiting for your input on the matter.

Cheers


Image


Attachments:
TVS error.jpg [388.86 KiB]
Downloaded 533 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: Visual JForex vs Java source code Post rating: 0   New post Posted: Mon 06 Jan, 2014, 12:21 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Your strategy recalculates TVS on every period candle close.
Just add IF block to filter only 10 min candle closes.


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Sun 12 Jan, 2014, 10:52 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Hi Vadim ,

Sorry for the late reply. I didn't have much time to play with my strategy lately.
Anyway, here's the result:
I added a filter for 10 minute candles and it does nothing. I get the same bad decisions.
I attached a screen from the historical tester to showcase the problem.
The red line is SMA(12) and the blue one is EMA(12). Check out the TVS on the bottom. It's not anywhere near to what it should do.
What is wrong with the strategy ? Or is it the TVS the problem ?
Awaiting your knowledgeable advice :)
Thank you.

PS: It seems I can't attach anything due to a server error. I'll get back later with the screenshot and the strategy file.


 
 Post subject: Re: Visual JForex vs Java source code Post rating: 0   New post Posted: Mon 13 Jan, 2014, 17:13 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Finally, server is working...


Image


Attachments:
Heruar.vfs [32.44 KiB]
Downloaded 240 times
TVS error 2.jpg [376.34 KiB]
Downloaded 507 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: Visual JForex vs Java source code Post rating: 0   New post Posted: Thu 30 Jan, 2014, 06:12 
User avatar

User rating: 11
Joined: Tue 05 Feb, 2013, 10:39
Posts: 104
Location: Romania, Iasi
Any news on this ?
Is it a bug, is it being fixed ?
Thanks.

Cheers


 

Jump to:  

  © 1998-2024 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