Dukascopy
 
 
Wiki JStore Search Login

Arrays
 Post subject: Arrays Post rating: 0   New post Posted: Fri 11 Apr, 2014, 20:14 

User rating: 0
Joined: Wed 09 Apr, 2014, 00:17
Posts: 4
Location: Spain,
Hi

Is it possible to create arrays or lists of data you can later iterate ? I could not find the type in create new variable option but the system uses that type in collections as candles, positions etc.

Thank you,
Gabriel


 
 Post subject: Re: Arrays Post rating: 1   New post Posted: Mon 14 Apr, 2014, 14:55 
Visual JForex expert at Dukascopy
User avatar

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

Yes indeed ! simply scroll down the variable type when you prompt a new variable window and you'll see variables type such as Candles, Positions or signals ; these types are defined with arrays of data.

Thanks


 
 Post subject: Re: Arrays Post rating: 0   New post Posted: Tue 15 Apr, 2014, 01:02 

User rating: 0
Joined: Wed 09 Apr, 2014, 00:17
Posts: 4
Location: Spain,
Hi!

Thank you for answering, I've seen those variables but I think that are read only and may be I did not express myself correctly. What I need is to create an array with 20 or 30 elements where I can store data for recalling later on. It is for a buffer for an indicator. Need to calculate the values of 20 or 30 candles, store them in the buffer and check it afterwards to see if there's a signal to enter the market.
Really don't know if this is the way in jforex because I come from MT4 and that's the way I know.

Thank you


 
 Post subject: Re: Arrays Post rating: 1   New post Posted: Tue 15 Apr, 2014, 16:20 
Visual JForex expert at Dukascopy
User avatar

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

You're welcome,
You can use the block "Get historical candles" and specify the number of candles that you need to retrieve in order to check the related data using loop viewer for instance. That makes the system buffering these data to be used later;
But if you need is to use an indicator and check its output(s) on several candles, you have to use the "shift" value.

Hope this make things clearer, otherwise it is better to post your strategy in vfs format and provide some more details so that we can help you.

Thanks !


 
 Post subject: Re: Arrays Post rating: 0   New post Posted: Thu 17 Apr, 2014, 17:25 

User rating: 0
Joined: Wed 09 Apr, 2014, 00:17
Posts: 4
Location: Spain,
Hi

For what I've seen, that array I'm creating is not really a variable but a reference to existing collections of data. What I need is to create an empty array that holds x number of variables inside where I can store the result of my calculations in the indicator for later recalling. Unfortunately I think that it is not implemented yet and will have to rethink the strategy.

I need a fractal indicator, that's easy to find but I need to compare it to previous ones to see if the last fractal could be a turning point. If I cannot store the values and positions of previous fractals I have to do it one by one and store the information in several double variables, a lot of work.

Or maybe I have to do it the other way around and find the highest high and/or lowest low and then check if it is a fractal and see if it is close enough to catch a trend.

Thank you.


 
 Post subject: Re: Arrays Post rating: 0   New post Posted: Mon 08 May, 2017, 16:22 
User avatar

User rating: 0
Joined: Tue 01 Jul, 2014, 23:22
Posts: 3
Location: BulgariaBulgaria
Hi,
Would like to add a follow up question about the arrays.
If you have 2x arrays and would like to have the ratios of their members in a 3rd array for further use. How would you do this with vjf?

I also attached the logic in excel.

Regards
Alex

Image


Attachments:
ratios.JPG [161.55 KiB]
Downloaded 267 times
test.xlsx [30.1 KiB]
Downloaded 75 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: Arrays Post rating: 1   New post Posted: Thu 11 May, 2017, 14:59 
Visual JForex expert at Dukascopy
User avatar

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

That's a very good question !

There is a way to do that as following:

Image

The only constraint here is that the 'Ratio' variable is not a array but a simple double variable that gets over-write'd by the next value at every cycle. This is not a major problem because you can add whatever condition / calculation that you want inside the loop.
Hope this is clear enough :)

Cheers


Attachments:
ArrayAdvanced.JPG [117.62 KiB]
Downloaded 284 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: Arrays Post rating: 0   New post Posted: Tue 16 May, 2017, 11:47 
User avatar

User rating: 0
Joined: Tue 01 Jul, 2014, 23:22
Posts: 3
Location: BulgariaBulgaria
Thanks for the advice Amine.
I put the whole logic into the strategy but seems I still miss something, because the strategy starts and stops after one candle... see the attached *.vfs file and the logic in excel.

FYI, This algorithm is meant to trade the difference between 2x indices or 2x CFDs that move relativery in parallel.

Could have a look?
Cheers
Alex


Attachments:
TradeDif_0.vfs [56.98 KiB]
Downloaded 112 times
test.xlsx [31.02 KiB]
Downloaded 74 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: Arrays Post rating: 1   New post Posted: Fri 19 May, 2017, 14:10 
Visual JForex expert at Dukascopy
User avatar

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

There was some errors related to variables not having start values. I've fixed that but I've made this workaround with your xls spreadsheet that I've updated and it doesn't seems to meet the calculation exactly. Can you please test and check again ? feel free to change the logic to get your result ..
ps: Pay attention to the loop logic: Block exits are made to make a loop from a side and end of cycle from the other.
you can also test on realtime with Jforex platform opened and display your charts as Data then copy paste in your xls to double check the result


Cheers


Attachments:
TradeDif_2.vfs [53.81 KiB]
Downloaded 112 times
test2.xlsx [32.43 KiB]
Downloaded 79 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: Arrays Post rating: 1   New post Posted: Thu 25 May, 2017, 16:30 
Visual JForex expert at Dukascopy
User avatar

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

Please ignore the previous strategy and consider the attached STDEV instead
We've treated a similar case and found that the logic is not correct. STDEV implentation is really complex with 2 loops embedded withing 2. there is also 2 technical counters that make sure the series are treated properly and in-sync. To continue your strategy you can use a link out of the "reset" group at the bottom.

Happy testing ! :)


Attachments:
STDEV.vfs [39.11 KiB]
Downloaded 107 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: Arrays Post rating: 0   New post Posted: Tue 30 May, 2017, 08:02 
User avatar

User rating: 0
Joined: Tue 01 Jul, 2014, 23:22
Posts: 3
Location: BulgariaBulgaria
Hi Amine,
Thank you very much for your help. Seems that this algorithm from the strategy works so far.
There are a few other bits and pieces that I need to include in this strategy but I think already have the essential part done.

As I mentioned it is meant for CFDs and indices. And maybe this is the place to put in another question.

Why are there more CFDs for trading in DEMO than in LIVE accounts (like 10 times more)? In LIVE I see only blue chip German CFDs.

Cheers
Alex


 
 Post subject: Re: Arrays Post rating: 1   New post Posted: Tue 30 May, 2017, 08:45 
Visual JForex expert at Dukascopy
User avatar

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

Glad to hear that this strategy part met your requirements !
As for CFDs, we're planning to launch them to live soon and maybe you noticed that we've pushed several CFDs to Demo yesterday. Stay tuned regarding the go live date by checking our website (Company news section)
We're also in a process to launch CFDs in Visual Jforex but if you need to test your strategy I recommend you to build it using any FX instrument then export it to JForex and test it there. Obviously you have to consider trading rules for such instruments (traded amount, conditions, etc ...)


 

Jump to:  

cron
  © 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