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.

how to get current market price?
 Post subject: how to get current market price? Post rating: 0   New post Posted: Thu 27 Jan, 2011, 13:35 

User rating: 0
Joined: Thu 24 Jun, 2010, 04:04
Posts: 27
is this right?
IBar currtBar = history.getBar(instrument, selectedPeriod, OfferSide.BID, 0);

currentprice =currtBar.getclose()

does this return a market price?


 
 Post subject: Re: how to get current market price? Post rating: 0   New post Posted: Thu 27 Jan, 2011, 14:49 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
To get the current market ask or bid price you can use the following code:
history.getLastTick(Instrument.EURUSD).getAsk();
history.getLastTick(Instrument.EURUSD).getBid();


 

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