Dukascopy
 
 
Wiki JStore Search Login

Simple question: strategy - OnBar - get bar or price at specific time
 Post subject: Simple question: strategy - OnBar - get bar or price at specific time Post rating: 0   New post Posted: Wed 28 Jan, 2015, 09:51 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 18:13
Posts: 72
Location: NetherlandsNetherlands
It seems that the simpler the question, the complexer the answers get with jForex ;-)

Here we go:

Strategy - OnBar:

How do i get the price (ask or bid, i don't care) at a specific time ( like the price at 9 '0 clock )?

The charts i use have different timeframes and P&F, but all i need to know is the price at Market Open (0:00 hours) and the price at London Open (9:00 hours).

Thanks.


 
 Post subject: Re: Simple question: strategy - OnBar - get bar or price at specific time Post rating: 0   New post Posted: Wed 28 Jan, 2015, 11:27 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 18:13
Posts: 72
Location: NetherlandsNetherlands
For a moment i thought

IBar nulBar = history.getBar( instrument, Period.ONE_HOUR, chart.getSelectedOfferSide(), 0 );     


would give me the current one-hour bar, but in runtime it gives a NullPointerException. Also other Shift-values give that exception.

Please help.


 
 Post subject: Re: Simple question: strategy - OnBar - get bar or price at specific time Post rating: 0   New post Posted: Wed 28 Jan, 2015, 13:02 
User avatar

User rating: 0
Joined: Fri 17 Jan, 2014, 18:13
Posts: 72
Location: NetherlandsNetherlands
Solved.

Although i must say that documentation on this jForex is hopeless in comparison with that of MT4 or cAlgo.


 

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