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.

MT4 function to Jforex
 Post subject: MT4 function to Jforex Post rating: 0   New post Posted: Tue 13 Oct, 2009, 06:00 

User rating: 0
Joined: Tue 13 Oct, 2009, 05:13
Posts: 4
I am transfer MT code to Jforex java code:
MT code: double x = iHigh(null,PERIOD_M15,1)-iLow(null,PERIOD_M15,1);
which function in Jforex? the follow is right? double x =
indicators.ceil(HuoBi,Period.FIFTEEN_MINS,OfferSide.BID,IIndicators.AppliedPrice.HIGH,1))
-indicators.floor(HuoBi,Period.FIFTEEN_MINS,OfferSide.BID,IIndicators.AppliedPrice.LOW,1));


 
 Post subject: Re: MT4 function to Jforex Post rating: 0   New post Posted: Tue 13 Oct, 2009, 09:22 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
We suppose that parameter "HuoBi" is of type Instrument and parameter "indicators" is of type IIndicators.
Yes, it looks right.


 
 Post subject: Re: MT4 function to Jforex Post rating: 0   New post Posted: Wed 14 Oct, 2009, 14:40 

User rating: 0
Joined: Tue 13 Oct, 2009, 05:13
Posts: 4
I test this two function,it return 1.0 or 2.0,not High or Low value
this function doesn't work
which indicator I should use?
indicator.max?


 
 Post subject: Re: MT4 function to Jforex Post rating: 0   New post Posted: Wed 14 Oct, 2009, 15:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
iHigh returns Highest bar for given candle. This is from MT4 documentation https://docs.mql4.com/series/iHigh ;)
To get highest value for candle consider this example:
context.getHistory().getBar(Instrument.EURUSD, Period.FIFTEEN_MINS, OfferSide.BID, 1).getHigh();

For lowest value is similar - instead of getHigh() use getLow()
Here is reference on IHistory interface documentation https://www.dukascopy.com/swiss/english/forex/jforex/tutorial/interfaces/IHistory.htm


 

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