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.

getbar issue
 Post subject: getbar issue Post rating: 0   New post Posted: Thu 11 Jul, 2013, 17:27 

User rating: 0
Joined: Thu 11 Jul, 2013, 17:18
Posts: 2
Hi,

I just want to have close,open,meax,min price of a Bar with period ONE_MIN.
I work in the OnTick method.
All filters chart and period are set to ONE_MIN.
I just add this line:
IBar bar = history.getbar(instrument,Period.ONE_MIN,OfferSide.ASK,1);

and all the price I get with bar.GetClose(), bar.GetOpen() etc... are identical...

what I'm doing wrong?

Regards,
Laurent.


 
 Post subject: Re: getbar issue Post rating: 0   New post Posted: Fri 12 Jul, 2013, 08:38 

User rating: 0
Joined: Thu 11 Jul, 2013, 17:18
Posts: 2
Ok if I add 4 OLHC click in the historical tester, I have the correct values but now the OnTick method is called 4 ou 5 times in the minute...
Not possible to have one tick per minute and correct values?

Regards,
Laurent.


 
 Post subject: Re: getbar issue Post rating: 0   New post Posted: Fri 12 Jul, 2013, 08:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
lol313 wrote:
I just add this line:
IBar bar = history.getbar(instrument,Period.ONE_MIN,OfferSide.ASK,1);

and all the price I get with bar.GetClose(), bar.GetOpen() etc... are identical...
Bars may also be flat. For further inquiries please post full example strategy of yours and a printscreen of Historical Tester settings (in the case you use it).


 

Jump to:  

  © 1998-2026 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