Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

history.getBar returns wrong bars
 Post subject: history.getBar returns wrong bars Post rating: 0   New post Posted: Tue 31 Jan, 2023, 14:55 

User rating: 0
Joined: Tue 31 Jan, 2023, 14:50
Posts: 1
Location: Georgia,
Hi all,
I am trying to get bars close prices from history, like this:

IBar bar=history.getBar(instrument, Period.DAILY, OfferSide.BID, i);
double p=bar.getClose();
console.getOut().println(String.format("price=%.5f",p));

problem is this code gives absolutely wrong results - Daily candle close prices do not match ones getbar returns. It is not bid\ask problem - prices are really wrong - sometimes 10-15 pips away, sometimes absolutely in other dimension. What is wrong?


 

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