Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Create Standard MACD indicator based on close price
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=77&t=57008
Page 1 of 1

Author:  Bruciew [ Tue 23 Apr, 2019, 15:50 ]
Post subject:  Create Standard MACD indicator based on close price

I want to create a custom indicator based on the JForex MACD indicator to create a standard version which uses the close price. In the calculate method of the MACD, the value is calculated using the following code:

      
for (k = 0; k < slowRes.getNumberOfElements(); k++){
           macd[k] = fastMAOutput[k] - slowMAOutput[k];
        }


I would like to modify it in the following way:

      for (k = 0; k < slowRes.getNumberOfElements(); k++){
           macd[k] = ((fastMAOutput[k] - slowMAOutput[k]) / close) * 100;
        }


but I cannot work out how to get the close price values.

  Page 1 of 1