Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2458 No spaces inside current bar's returned value
 Post subject: JFOREX-2458 No spaces inside current bar's returned value Post rating: 0   New post Posted: Wed 24 Nov, 2010, 00:47 

User rating: -
This is a small thing, and I'm not even exactly sure if you'll want to consider it as a bug.
When running
            IBar candle = candles[i];
            console.getOut().println(i + " " + candles[i] + " inside drawOutput for loop");

if we have 250 bars in total, then the 249th (current incomplete) bar's values will be without spaces inside the candles[i] array, and making it harder to read when debugging and displaying it on the messages tab.

Image


Attachments:
drawOutput.PNG [19.07 KiB]
Downloaded 425 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: JFOREX-2458 No spaces inside current bar's returned valu Post rating: 0   New post Posted: Mon 03 Jan, 2011, 13:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This code prints every message on a new line:

long time = history.getBarStart(Period.TEN_SECS, System.currentTimeMillis());
List<IBar> bars = history.getBars(Instrument.EURUSD, Period.TEN_SECS, OfferSide.BID, time - 50000, time);
IBar[] candles = bars.toArray(new IBar[bars.size()]);
for (int i = 0; i < candles.length; i++) {
IBar candle = candles[i];
console.getOut().println(i + " " + candles[i] + " inside drawOutput for loop");
}

There is a method print that will print everything on one line, but you can use println, if you need


 

Jump to:  

  © 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