Dukascopy
 
 
Wiki JStore Search Login

how to set timezone in jforex sdk?
 Post subject: how to set timezone in jforex sdk? Post rating: 0   New post Posted: Thu 24 Sep, 2015, 08:45 
User avatar

User rating: 0
Joined: Fri 18 Sep, 2015, 14:32
Posts: 15
Location: Germany, Dresden
Hello Ladies and Gentleman,

for the calculation of pivot Points it is necessary to set the right timezone. But how to set the timezone in the sdk? Does e.g. the Pivot Indicator use the default system timezone?

TimeZone.setDefault(TimeZone.getTimeZone("GMT"));

But this doesn't give the same results for pivot as the standard JForex Plattform. Any Ideas?


Best Regards,
henry


 
 Post subject: Re: how to set timezone in jforex sdk? Post rating: 0   New post Posted: Tue 10 Nov, 2015, 10:20 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1049
Location: Geneva, Switzerland
You should use a custom period - Period.createCustomPeriod(Unit unit, int unitsCount, JFTimeZone jfTimeZone);

E.g. when calculating an indicator (pivot) for Daily candles with CST time zone, at first create a period:
Period period = Period.createCustomPeriod(Unit.Day, 1, JFTimeZone.CST);
now give the created period to some of the pivot methods, e.g.:
context.getIndicators().pivot2(Instrument.EURUSD, period, OfferSide.ASK, 5);


 

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