|
Visual JForex vs Java source code |
Heruar
|
Post subject: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Wed 11 Dec, 2013, 17:26
|
|
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 ![Smile :)](./images/smilies/icon_e_smile.gif) 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 294 times
|
Heruar.java [18.98 KiB]
Downloaded 306 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.
|
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Tue 17 Dec, 2013, 16:30
|
|
User rating: 11
Joined: Tue 05 Feb, 2013, 10:39 Posts: 104 Location: Romania, Iasi
|
Nobody cares to answer this ? ...
|
|
|
|
![](images/spacer.gif) |
Visual Support
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Thu 19 Dec, 2013, 10:16
|
|
Visual JForex expert at Dukascopy | ![User avatar](./download/file.php?avatar=294_1366725361.png) |
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.
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Thu 19 Dec, 2013, 17:12
|
|
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 ![Smile :)](./images/smilies/icon_e_smile.gif) 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
|
|
|
|
![](images/spacer.gif) |
vadim_berezhnoj
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Mon 23 Dec, 2013, 15:05
|
|
Visual JForex expert at Dukascopy | ![User avatar](https://www.dukascopy.com/imageserver/img/873577ff108d2548ea46be1cf76852ff/60_3/image.jpg) |
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.
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Thu 26 Dec, 2013, 09:25
|
|
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 274 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.
|
|
|
|
|
![](images/spacer.gif) |
vadim_berezhnoj
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Mon 30 Dec, 2013, 17:04
|
|
Visual JForex expert at Dukascopy | ![User avatar](https://www.dukascopy.com/imageserver/img/873577ff108d2548ea46be1cf76852ff/60_3/image.jpg) |
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.
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Sat 04 Jan, 2014, 12:47
|
|
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](https://www.dukascopy.com/swiss/english/forex/jforex/forum/download/file.php?un=1&id=5380)
Attachments: |
TVS error.jpg [388.86 KiB]
Downloaded 537 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.
|
|
|
|
|
![](images/spacer.gif) |
vadim_berezhnoj
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Mon 06 Jan, 2014, 12:21
|
|
Visual JForex expert at Dukascopy | ![User avatar](https://www.dukascopy.com/imageserver/img/873577ff108d2548ea46be1cf76852ff/60_3/image.jpg) |
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.
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Sun 12 Jan, 2014, 10:52
|
|
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 ![Smile :)](./images/smilies/icon_e_smile.gif) 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.
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Mon 13 Jan, 2014, 17:13
|
|
User rating: 11
Joined: Tue 05 Feb, 2013, 10:39 Posts: 104 Location: Romania, Iasi
|
|
|
|
![](images/spacer.gif) |
Heruar
|
Post subject: Re: Visual JForex vs Java source code |
Post rating: 0
|
Posted: Thu 30 Jan, 2014, 06:12
|
|
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
|
|
|
|
![](images/spacer.gif) |
|
Pages: [
1
]
|
|
|
|
|