Dukascopy
 
 
Wiki JStore Search Login

Close bar value
 Post subject: Close bar value Post rating: 0   New post Posted: Wed 01 Apr, 2015, 11:31 
User avatar

User rating: 0
Joined: Wed 01 Apr, 2015, 11:18
Posts: 1
Location: Italy, Syracuse
Hello everyone.

Into my strategy i am using this method

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {     


But i want only closed bar value without difference between ASK and BID bar.

Ask and Bid bar are used also into SMA indicator signature!!!

i can't do it using historical data without OfferSide params!

thanks!

Fabrizio from italy


 
 Post subject: Re: Close bar value Post rating: 0   New post Posted: Thu 02 Apr, 2015, 23:23 
User avatar

User rating: 0
Joined: Fri 10 Oct, 2014, 00:35
Posts: 58
Location: New Zealand, Auckland
Hi Fabrizio

All Forex data comes as bid & ask, i.e. each tick has a bid and ask price. It's not like stocks where there is a last traded price that is used to make the candles. In Forex, candles are built from either bid OHLC or ask OHLC.

Buy orders trade at the ask price and sell orders trade at the bid price, which is why it is important to know the difference (spread).

For analysis, I think most people just use the bid prices. Your charts probably show the bid candles, but you can change the settings to show ask candles. The onBar() method provides both because automatic strategies that place orders may need access to the ask for buys or bid for sells.

I hope this helps.

Regards
Tony


 

Jump to:  

cron
  © 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