Dukascopy
 
 
Wiki JStore Search Login

How to make a cycle "for"
 Post subject: How to make a cycle "for" Post rating: 0   New post Posted: Mon 07 Oct, 2013, 09:53 

User rating: 0
Joined: Mon 07 Oct, 2013, 09:51
Posts: 1
Hello everyone!
How to make a cycle on java that on mql4 would look like:

for (int i=0; i<...; i++) {...}

thanks


 
 Post subject: Re: How to make a cycle "for" Post rating: 0   New post Posted: Mon 07 Oct, 2013, 11:29 
Visual JForex expert at Dukascopy
User avatar

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

You can use "Position Viewer" to go through position list or "Loop Viewer" to go through candles.


 
 Post subject: Re: How to make a cycle "for" Post rating: 0   New post Posted: Mon 07 Oct, 2013, 21:04 

User rating: 1
Joined: Tue 10 Jul, 2012, 11:51
Posts: 25
Location: Czech Republic,
Those cannot be used when I need to get e.g. highest value of an indicator for last 20 candles. For such case, some "for block" would definitely help.
I tried to use IF block with manually increasing a temporary variable, but it's very impractical way.
I vote for "For" block too ;)


 
 Post subject: Re: How to make a cycle "for" Post rating: 0   New post Posted: Tue 08 Oct, 2013, 10:50 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Unfortunately there is no such function in VJ.
But it can be implemented by using other functions.
download/file.php?mode=view&id=4740
Following strategy searches highest SMA(30) in last 10 candles and shows it on chart.
Yes it is really freaky :mrgreen: solution, but it works :twisted: .


Attachments:
ForI.vfs [45.84 KiB]
Downloaded 282 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.
 

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