Nickola wrote:
how can i get prices for different currency pairs in case i do use multicurrency strategy.
For example methods tick.getBid() and tick.getAsk() returns current prices for all active instruments.
Please show an example how i should get current price for example for only USDCHF.
You can ignore all other currency pairs, by putting this code in start of the onTick method
if (instrument != Instrument.USDCHF) {
return;
}
Nickola wrote:
I see method getBars(...) which returns a list of history bars but how should i work with them?
A small example will be helpful.
You can iterate through any List with for statement:
List<IBar> listOfBars = getBars(...);
for (IBar bar : listOfBars) {
//do what you need with bar
}