Announcement

Collapse
No announcement yet.

normalized MACD

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • normalized MACD

    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

  • #2
    This thread should help with the EMA calculation. As far as the normalization calculation, I'm not sure.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment

    Working...
    X