Dukascopy
 
 
Wiki JStore Search Login

Save feed data in array
 Post subject: Save feed data in array Post rating: 0   New post Posted: Tue 18 Aug, 2015, 15:20 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 17:43
Posts: 16
Hello,

I would like to back up data in a array. For example every minute, a new data
I can't exceed the [0] element that resets itself to each new data.
My code:
// create open variable
double open = askBar.getOpen();
System.out.println("open = " + open);

double[] tabOpen = { open };

for (int i = 0; i < tabOpen.length; i++) {
System.out.println("Position " + i + " : " + tabOpen[i]);
}

Result
Instrument: EUR/GBP open 0.70402 close: 0.70403 low 0.70402 high 0.70403 time : 1439907320000
open = 0.70402
Position 0 : 0.70402
Instrument: EUR/GBP open 0.70402 close: 0.70407 low 0.70402 high 0.70407 time : 1439907330000
open = 0.70402
Position 0 : 0.70402
Instrument: EUR/GBP open 0.70408 close: 0.70404 low 0.70404 high 0.70408 time : 1439907340000
open = 0.70408
Position 0 : 0.70408


Thank you for your help
Greetings


 

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