Dukascopy
 
 
Wiki JStore Search Login

Create Standard MACD indicator based on close price
 Post subject: Create Standard MACD indicator based on close price Post rating: 0   New post Posted: Tue 23 Apr, 2019, 15:50 

User rating: 0
Joined: Mon 18 Mar, 2019, 15:06
Posts: 4
Location: AustraliaAustralia
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.


 

Jump to:  

cron
  © 1998-2011 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