Dukascopy
 
 
Wiki JStore Search Login

Can I do something every "X" minutes/candles?
 Post subject: Can I do something every "X" minutes/candles? Post rating: 0   New post Posted: Sun 18 Oct, 2015, 20:25 
User avatar

User rating: 0
Joined: Mon 06 May, 2013, 06:08
Posts: 18
Location: CanadaCanada
Hello all,

Is there an easy way to create something that repeats every "X" minutes or every "X" candles? I would post up an .vjf example to build on but I don't know where to start.

Logic Example: Every 10 candles add 1 to 'variable'.

I suspect the loop function will be involved but I don't understand how to use it. Is there a good tutorial available on how to use the loop function? Thanks for any and all responses.


 
 Post subject: Re: Can I do something every "X" minutes/candles? Post rating: 1   New post Posted: Mon 19 Oct, 2015, 13:47 
Visual JForex expert at Dukascopy
User avatar

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

This can be achieved using the loop viewer or using a simple counter. According to your description, my first thought is to implement a counter:
Let's consider that you want to add 1 to the variable 'Sum' every 10 candles of 10 mn each. This would be achieved this way:
First, a counter is needed which is made by the calculation block, but to tell the system that the needed period is 10mn, an IF block is used to filter out the unused periods (10sec, 5mn, 15m, ...) then once the counter reaches 10, the sum is performed and also the reset so that the counter starts back from 0.
to view the attached file: File > import

Cheers


Attachments:
SampleCounter.vfs [23.54 KiB]
Downloaded 99 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: Can I do something every "X" minutes/candles? Post rating: 0   New post Posted: Tue 20 Oct, 2015, 02:08 
User avatar

User rating: 0
Joined: Mon 06 May, 2013, 06:08
Posts: 18
Location: CanadaCanada
Thank you, this is exactly what I need. I don't think it warrants creating a new thread to ask, is there a practical limit to how many blocks can be used per tick? Or maybe the entire system in general? Thanks again.


 
 Post subject: Re: Can I do something every "X" minutes/candles? Post rating: 1   New post Posted: Tue 20 Oct, 2015, 13:44 
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!

There is no rule to limit such use but more likely best practices rules which basically means optimizing a strategy and "remove" excessive use of conditions that can slow down the strategy and may result in unexpected errors afterwards.

Cheers


 

Jump to:  

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