Dukascopy
 
 
Wiki JStore Search Login

Historical Test - Get Historical Candle Block Problem
 Post subject: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Thu 28 Jul, 2016, 12:28 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Hello,

When i try to test my complex strategy with vjf i see my strategy not working correctly. After a little bit work i decide to write simple strategy that has two If (only control candle intrument and period), three GetHistoricalCandle (Shift properties 0, 1 and 2) and one SoundAlert block for simulate problem.

Try to test my simple strategy on historical data but before run it i put a breakpoint to SoundAlert block. So when strategy tester hit my breakpoint i'll see last 3 candle's open, high, low and close values. After check all values i see third(shift=2) and second(shift=1) candle's values correct but first(shift=0) candle's values wrong, actually all values same as with candle's open value.

I'm experience software developer and use many strategy platforms and write many indicators and strategies for them but i'm beginner about vjf and finally i'm only human, and maybe misunderstand vjf some concepts. My opinion this can not be bug because of it can not be escape reviews your developers and vjf current users.

Which is the right? Is there any bug or i'm misunderstand?

Best Regards,
Aytac
Image


Attachments:
VJF Test Strategy.png [279.75 KiB]
Downloaded 332 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: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Thu 28 Jul, 2016, 13:05 
Visual JForex expert at Dukascopy
User avatar

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

Thanks for the detailed description. Actually this is not a bug but a normal behavior:
- Shift 0 refer to the current candle under construction and still fluctuating till it reaches the expiry with regards to its period. So the only "certain" variable known for a candle not yet finished is the open price, this is reason why the other variables are displayed identically (not always the case btw) and will get their appropriate values once the candle is over.


 
 Post subject: Re: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Thu 28 Jul, 2016, 21:39 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Hi,

Thanks for your quick response and explanations. Sorry about when i post my first report i forget to post my screenshot. Now i edit my first post and added screenshot, also again i added same screenshot with some notes in this post too. For clarify; actually on other trading platforms logic similar like your said if you request shift=0 candle means current and last and not finished yet candle, so if you request it after first tick all values (open, high, low and close) must be same (with open value), after a few ticks later can be different depending price changes. Shift=1 candle means immediately prior last candle which is finished already and so on for shift 2,3,4,5 candles. Actually your explanations are compatible with my explanation/experience from other trading platforms. If you look at my screenshot left side/chart side showing this concept with shift numbers.

Now i expect vjf will work like that but not. If you look at my screenshot's right side/vjf side you'll see;
1- Left side and right side shift numbers not compatible (block shift parameter and screenshot numbers),
2- Left side shift=1 candle which is already completed bar's values is not correct (all values showing open value)

After debug my sample strategy and your explanations i understand that, vjf trigger new candle event after came first tick shift=0 candle so we can use GetHistoricalCandle block with shift=1 parameter for request prior candle but last candle fully formed. But i don't understand why in my test strategy not working like that.

I hope this time my problem so clear. Actually I'm only want to access shift=1 candle (regarding my screenshot) values correctly.

Image


Attachments:
VJF Test Strategy.png [275.5 KiB]
Downloaded 329 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: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Sat 30 Jul, 2016, 01:51 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Hi,

Lets look at another so simple example. In this strategy i'm only checking bid candle instrument and period. If bid candle instrument is default instrument and period is default period then i give a sound alert. If i check candle data values via put break point on sound alert component i see values not compatible any candle on chart! I'm so confused about VJF:( If you look at attachment i put detailed explanations.

1. My shift numbers is right according to VJF design?
2. If so why data values not compatible last completed candle (which is last completed/filled with data values) data values?
3. Why VJF bid candle data values not right for any candle of chart?
4. Where can i find any help/documentation about VJF logic? Not about block/component parts...

Best Regards

Image


Attachments:
VCF Test Strategy1.png [266.5 KiB]
Downloaded 323 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: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Tue 02 Aug, 2016, 15:56 
Visual JForex expert at Dukascopy
User avatar

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

There is some essential logic related to VJF platform that is unfortunately not documented anywhere which is the main reason why I'm trying to help as much as I can in this forum.

- OHLC values are correct and there is no bug at all. It is a matter of candle data filtration : If you use a block to filter out the candle period, the system will read the OHLC of the current candle only when this given candle is closed and a new candle starts. This means that the current candle's OHLC (named "last candle" in VJF) is only "read" at its very beginning. So it is 100% normal to see differences when you compare historical tester with the debugged values.

- Last candle OHLC are prices related to the candle currently under construction, such candle is updated tick by tick till it expires. If you need a high frequency updates of your candle prices you can select lower candle periods instead of 10mn or use simply tick prices.

- In some cases where the data load is consequent, I've seen some data lag in terms of updates and this is due to the fact suing flash-player memory buffering to load and display the data properly. If you associate this to the browser's capacity / memory + the computer resources you may see some issues related to the update frequencies.

Cheers


 
 Post subject: Re: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Sat 06 Aug, 2016, 02:50 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Hi,

I sent 3 post about my issue and all posts have their screenshots. I don't understand why you are not talking on my screenshots for fast solve my issue. I am spending a lot of time for writing posts and marking screenshots. Please respect that. Also i'm asking questions with it's numbers, could you please answer this questions with same numbers.

After your explanations, i'm continue strangling about develop strategy with VJF. My first and second posts issues continue. Because of that i developed simple strategy and exported from VJF and attached to this post. Please help about it. I think this will be better from sharing screenshots. Strategy logic so simple; BUY when close price cross lower band. SELL when close price cross upper band. If already there is same direction position don't open position. If there is opposite direction position close it before open new position. If there is, what is my fault?

I'm sorry about my third post which is illogical. Why it's illogical? As i understand, onCandle only trigger when a bar closed (actually last bar's first tick). There is Last Ask/Bid Candle variables which they are purpose of buffering price values when a candle is closed, but for any period. In my third post's screenshot there is no any if block that filter candle period so Last Ask/Bid Candle values can be from 10 seconds to monthly period candle's close. I mean on screenshot price values maybe come from 10 seconds or 1 minute candle's values, we don't know which is. So if we want to see 10 minute EURUSD candle values (which are historical test default parameters) we have to filter onCandle event with 2 if block one is for instrument and other for period. Am i understand correctly? if not please inform me.

Also want to say that if we create strategy with VJF that run multiple instruments (for example look at 5 min EURUSD and GBPUSD and buy/sel one of them with any logic) we can not do historical tests on VJF environment because it's testing on chart only for default instrument parameter (filter instrument with if block or not, it does not matter) but we can test on JForex platform. I test it with very simple strategy that contain 2 if and 2 assign block. Something like that if instrument is EURUSD than assign user parameter of currentInstrrument "EURO" else if instrument is GBPUSD than assign user parameter of currentInstrrument "POUND". When i test on VJF with default instrument EURUSD parameter i see currentInstrrument user variable always to be "EURO". But if i test same strategy with JForex (copy-paste code from VJF to JForex strategy and add code that write currentInstrrument variable value to JForex's console) i see currentInstrrument changing between "EURO" and "POUND". Am i right about this? if not please inform me.

Lastly, if we come to your last post;

"There is some essential logic related to VJF platform that is unfortunately not documented anywhere which is the main reason why I'm trying to help as much as I can in this forum."
>>> I'm so sorry for that there is no document about essential logic of VJF. Because it's causing that VJF could not see the real value that it deserves. I'm professional software developer since 1995. Believe me without detailed documentation software project can not be count finished. I recommend as soon as possible work on it. With you or without you forum can not be count like documentation.

"OHLC values are correct and there is no bug at all. It is a matter of candle data filtration : If you use a block to filter out the candle period, the system will read the OHLC of the current candle only when this given candle is closed and a new candle starts. This means that the current candle's OHLC (named "last candle" in VJF) is only "read" at its very beginning. So it is 100% normal to see differences when you compare historical tester with the debugged values."
>>> Above i wrote about my third post, i think you are telling similar things with different way.

"Last candle OHLC are prices related to the candle currently under construction, such candle is updated tick by tick till it expires. If you need a high frequency updates of your candle prices you can select lower candle periods instead of 10mn or use simply tick prices."
>>> I know that and i'm completely agree with you, but don't understand what is relation with my issue.

"In some cases where the data load is consequent, I've seen some data lag in terms of updates and this is due to the fact suing flash-player memory buffering to load and display the data properly. If you associate this to the browser's capacity / memory + the computer resources you may see some issues related to the update frequencies."
>>> I'm trying to understand... I think you are talking about when debug strategy we can see some difference with VJF values and chart values. Okay but i'm debugging because of strategy not working as i expect.

Best Regards


Attachments:
BollingerBandStrategyV1.vfs [46.45 KiB]
Downloaded 161 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: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Sun 07 Aug, 2016, 14:59 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Hi,

At the last, i solved my problem. I have to say that now my strategies working as i wanted but i found it very strange.

JForex platform working same as other familiar platforms except for one difference that it's sending virtual tick (volume=0 and price=latest tick) for create new candle when time expire for previous candle. At least when doing historical tests, i'll test it for real time charts when markets open. Also like other platforms current bar shift index being 0, previous 1 and continues in a similar manner. So if we want to create buy/sell signal in current bar, we check previous historical candle with shift = 1 param (because of latest completely finished candle shift=1 candle).

What about Visual JForex? As expected, logic is the same as but with small difference; in debug mode JForex showing variables correctly but Visual JForex lagging one candle. For example if you want to check shift = 1 candle values you'll see shift = 2 candle values(likewise, Bid Candle values too). But if you check chart when continue testing and results after finished the test, you'll see visual JForex tests working correctly (and here is, this is strange part for me).

After do historical tests both JF and VJF (with same strategy, instrument, period, time frame, deposit, etc.), i see strategy test results a little bit different which don't know why. Maybe commission difference or account parameters or something like that. But this is topic of other post, i'll test it later.

Despite everything; Yes I'm beginning to learn process of JF & VJF, my thought at that moment about your platforms shortly;
I have a lot experience since 2008 about trading platforms (some of them Ninja Trader, Trade Station, Meta Trader, Trader Workstation, etc. writing indicators & strategies for them). JForex & Visual JForex one step ahead from them because of their user friendly interface and structure that support multiple time frame & instrument strategies. Thanks DUKASCOPY.

Thanks for your help & patience.

Best Regards,
Aytaç Aşan


 
 Post subject: Re: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Mon 08 Aug, 2016, 16:45 
Visual JForex expert at Dukascopy
User avatar

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

First of all, I would like to thank you for the detailed explanation that reflects your level of knowledge in terms of trading and software development. My previous reply was short indeed but my intention was to provide a global answer to your questions taking into consideration your seniority in the field of trading hence my intention to not reply on your points one by one. This does not mean that my answers were crystal clear. This made me realizing that, obviously, there are some lacking elements regarding the way VJF works.
Visual Jforex is developed on Jforex API therefore all the method variable classes are 100% retrieved from Jforex API. If you are familiar with Java you can have a look at our java library in the public repository following this link: https://www.dukascopy.com/client/jforex ... icrepo/You are totally right about the missing documentation which is critically needed at this level of development for Visual Jforex platform. As said, we are planning to do that in the near future.
I was unable to attach a screenshot that I've made for you in my previous post. It is related to shift values displayed in both VJF interface and Historical tested. When I made the test to double check your findings, I found that HOLC values are correct as you can see, that’s why I’ve added my last point regarding the possibility of having data lag when debugging values in VJF. It is also a matter of Java memory heap size which can be increased to maximize chance of data accuracy. The method to do that is as following:
Edit the jnlp file that you download when launching the strategy processor and locate the line “<j2se version="1.6+" initial-heap-size="128m" max-heap-size="512m"/> then increase the max-heap size to 1024 for instance, save the file as is and launch it.

Let me now go through your questions and observations:
Quote:
1. My shift numbers is right according to VJF design?

Yes your shift numbers are right: 0 stands for the current candle (still under construction) , 1 for the one before and so forth.
Quote:
2. If so why data values not compatible last completed candle (which is last completed/filled with data values) data values?

How did you verified that ? Looking at your screenshot, I see that candle shift 2 shows in the chart a low price between 1.0985 and 1.0984 which is confirmed by VJF in the same screenshot that displays 1.09844. You need to put the mouse on the relevant candle in the historical tester to see the OHLC widget showing the right data and compare it with the one shown in VJF. Attached fyi.

Quote:
3. Why VJF bid candle data values not right for any candle of chart?
Last candle data (shift 0) stands for current as previously explained, we are thinking about change the naming of this including some other items that resulted in confusion. The last candle OHLC are retrieved in your example at the first price (i.e open price) of a 10mn candle that’s the reason why OHLC are displayed all as the same. Try to plug the same Get historical candle with shift 0 and test it in real time: you should be able so see the real time values of your current candle 10mn.
Quote:
4. Where can i find any help/documentation about VJF logic? Not about block/component parts...

Your patience is highly appreciated in this matter 

Later in your posts :


Quote:
“>>> I'm so sorry for that there is no document about essential logic of VJF. Because it's causing that VJF could not see the real value that it deserves. I'm professional software developer since 1995. Believe me without detailed documentation software project can not be count finished. I recommend as soon as possible work on it. With you or without you forum can not be count like documentation.”

Agreed

Quote:
“Last candle OHLC are prices related to the candle currently under construction, such candle is updated tick by tick till it expires. If you need a high frequency updates of your candle prices you can select lower candle periods instead of 10mn or use simply tick prices."
>>> I know that and i'm completely agree with you, but don't understand what is relation with my issue.”

Hope this now clearer with the answer of your point 3 above. If not please let me know.

Quote:
“>>> I'm trying to understand... I think you are talking about when debug strategy we can see some difference with VJF values and chart values. Okay but i'm debugging because of strategy not working as i expect.”

Hope this also clear with the first paragraph of the current post.

Quote:
“What about Visual JForex? As expected, logic is the same as but with small difference; in debug mode JForex showing variables correctly but Visual JForex lagging one candle. For example if you want to check shift = 1 candle values you'll see shift = 2 candle values(likewise, Bid Candle values too). But if you check chart when continue testing and results after finished the test, you'll see visual JForex tests working correctly (and here is, this is strange part for me).”


I'm wondering if you are comparing VJF with its own historical tester or using rela-time run using Jforex platform ?

Quote:
After do historical tests both JF and VJF (with same strategy, instrument, period, time frame, deposit, etc.), i see strategy test results a little bit different which don't know why. Maybe commission difference or account parameters or something like that. But this is topic of other post, i'll test it later.


In VJF historical tester, all opened positions are closed at the end of the test or when the engine is stopped manually or unexpectedly, in Jforex platform open positions are kept as is and will be displayed as open orders in the end of test report. commission are also considered in Jforex and subject to parameters that can be adjusted by the user.

I also want to inform you that I can arrange a one to one session for advanced users so I would be pleased to meet you in our platform dedicated to live webinars . Let me know your availability in order to set this up. I will communicated the needed details in private once your email is communicated (I'll send also the screenshot that I talked about earlier).

Thanks again !

cheers


 
 Post subject: Re: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Sun 14 Aug, 2016, 04:28 
User avatar

User rating: 0
Joined: Sun 18 Mar, 2012, 14:15
Posts: 8
Location: Turkey, Bursa
Sorry for late response, i read your post instantly but didn't find any chance to respond it because of busy schedule. Unfortunately i'm not a java developer (i know a little bit because of curiosity). I'm expert of .net languages, especially c#. But in time i'm planing to practice on JForex API and develop strategies from scratch or improve VJF output strategy. I'm happy to hear that you'll planing to work about documentation in the near future. Also thanks for info about Java memory heap size, i increase values but didn't have time to test it.

Quote:
How did you verified that ? Looking at your screenshot, I see that candle shift 2 shows in the chart a low price between 1.0985 and 1.0984 which is confirmed by VJF in the same screenshot that displays 1.09844. You need to put the mouse on the relevant candle in the historical tester to see the OHLC widget showing the right data and compare it with the one shown in VJF. Attached fyi.


Yes i know that on my chart my cursor on shift=2 candle, but on VJF i'm showing shift=1 candle. One is shift =1 and other is shift=2 candle but values identical. I think because of lagging. But i'm not interested this anymore because of my strategies working exactly what i want that is the only important point for me.

Quote:
I'm wondering if you are comparing VJF with its own historical tester or using rela-time run using Jforex platform?


I'm comparing both (VJF & JF) in historical test mode. On VJF side putting breakpoint and checking values, on JF side writing values to console.

Quote:
In VJF historical tester, all opened positions are closed at the end of the test or when the engine is stopped manually or unexpectedly, in Jforex platform open positions are kept as is and will be displayed as open orders in the end of test report. commission are also considered in Jforex and subject to parameters that can be adjusted by the user.


Like before said when i do historical tests both JF and VJF (with same strategy, instrument, period, time frame, deposit, etc.), i see strategy test results a little bit different which don't know why. And i didn't interrupt tests manually or receive any error for both of them. But i'll test it again.

Quote:
I also want to inform you that I can arrange a one to one session for advanced users so I would be pleased to meet you in our platform dedicated to live webinars . Let me know your availability in order to set this up. I will communicated the needed details in private once your email is communicated (I'll send also the screenshot that I talked about earlier).


One to one session will be great. It must be weekdays? Are you contact with me about it with private message? Or am i send you a request email? Also i wonder your screenshot.

Best Regards,
AA


 
 Post subject: Re: Historical Test - Get Historical Candle Block Problem Post rating: 0   New post Posted: Fri 09 Dec, 2016, 13:52 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
VJF new version 1.6.57 is just released which includes an pdf user guide under Help menu.
(Make sure to clear your browser's cookies to access it)
Envoy !


 

Jump to:  

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