Dukascopy
 
 
Wiki JStore Search Login

MACD IN JFOREX COMPARE MACD IN MT4
 Post subject: MACD IN JFOREX COMPARE MACD IN MT4 Post rating: 0   New post Posted: Mon 17 Dec, 2012, 00:05 
User avatar

User rating: 0
Joined: Fri 30 Nov, 2012, 15:12
Posts: 2
Location: France, Dijon
Hello, I observed that for the same parameters (12,26,9), classic MACD in JForex doesnt' give same results, same curve... compare MACD in Metatrader 4
Someone knows how to get the same MACD in MT4, in the JFOREX platform ?

Thanks.


 
 Post subject: Re: MACD IN JFOREX COMPARE MACD IN MT4 Post rating: 0   New post Posted: Mon 17 Dec, 2012, 09:58 
User avatar

User rating: 3
Joined: Mon 05 Mar, 2012, 11:15
Posts: 24
Location: Indonesia, Jakarta
TrojanKill wrote:
Hello, I observed that for the same parameters (12,26,9), classic MACD in JForex doesnt' give same results, same curve... compare MACD in Metatrader 4
Someone knows how to get the same MACD in MT4, in the JFOREX platform ?

Thanks.


I believe JForex indicators by default doesn't using Filter, weekend flat price feeds got the way into calculation.

Here is my fix:
// I want 2 natr values from last bar
// FastNatr  with natrPeriod1
// SlowNatr with natrPeriod2

// indicator which filter out weekends flat
long from = history.getBar(instrument, period, OfferSide.BID, 2).getTime();
long to = history.getBar(instrument, period, OfferSide.BID, 1).getTime();
double natrFast[] = indicators.natr(instrument, period, side, natrPeriod1, Filter.WEEKENDS, from, to);
double natrSlow[] = indicators.natr(instrument, period, side, natrPeriod2, Filter.WEEKENDS, from, to);
         
// indicator which DOES NOT filter out weekends flat
double natrFast1 = indicators.natr(instrument, period, OfferSide.BID, natrPeriod1, 1);
double natrFast2 = indicators.natr(instrument, period, OfferSide.BID, natrPeriod1, 2);
double natrSlow1 = indicators.natr(instrument, period, OfferSide.BID, natrPeriod2, 1);
double natrSlow2 = indicators.natr(instrument, period, OfferSide.BID, natrPeriod2, 2);


I hope that solves your problem.


 

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