Hi all!
couple of quick questions...
1. I can figure out how to make an MACD (by creating and subtracting averages). How would one normalize this?
2. How would I code an EMA of the resulting value?
Here is what I have so far.....
var vAve1 = null;
var vAve2 = null;
var nValue = null;
function preMain() {
setStudyTitle("normalized MACD");
setCursorLabelName("osc1",0);
setDefaultBarFgColor(Color.blue,0);
}
function main() {
if (vAve1==null) {
vAve1 = new MAStudy(3,0,"Close",MAStudy.EXPONENTIAL);
}
if (vAve2==null) {
vAve2 = new MAStudy(10,0,"Close",MAStudy.EXPONENTIAL);
}
// get MACD (difference of two MA's)
nValue = (vAve1.getValue(MAStudy.MA)-vAve2.getValue(MAStudy.MA));
//normalize nValue here
return nValue;
}
Thanks Very much for your help
Daniel Parker
couple of quick questions...
1. I can figure out how to make an MACD (by creating and subtracting averages). How would one normalize this?
2. How would I code an EMA of the resulting value?
Here is what I have so far.....
var vAve1 = null;
var vAve2 = null;
var nValue = null;
function preMain() {
setStudyTitle("normalized MACD");
setCursorLabelName("osc1",0);
setDefaultBarFgColor(Color.blue,0);
}
function main() {
if (vAve1==null) {
vAve1 = new MAStudy(3,0,"Close",MAStudy.EXPONENTIAL);
}
if (vAve2==null) {
vAve2 = new MAStudy(10,0,"Close",MAStudy.EXPONENTIAL);
}
// get MACD (difference of two MA's)
nValue = (vAve1.getValue(MAStudy.MA)-vAve2.getValue(MAStudy.MA));
//normalize nValue here
return nValue;
}
Thanks Very much for your help
Daniel Parker
Comment