Help coding EMA for Volume
Results 1 to 4 of 4

Thread: Help coding EMA for Volume

  1. #1
    Dear users:

    Im trying to code an indior Which shows the MA and EMA of the Volume Pubs. I've managed to successfully code the SMA but with all the EMA, Im getting a few problems and I can't progress. I've discovered some piles overflow also. Anyway below is my code and I dont. Any more experience can help?

    Inserted Code dual EMA_Volume(int I, int size) if (I==MA_Period 2)reunite MA_Volume(I,size); double multiplier=(2 / (size 1) ); return (Volume#91;I#93; - EMA_Volume(I 1,10) * multiplier EMA_Volume(I 1,10)); dual MA_Volume(int I, int size) dual suma=0; for(int j=I; jlt;I size;j ) suma=suma Volume#91;j#93;; if ((suma/size)==0)Alert(Something is wrong with the quantity of pub nÂș=,I,,GetLastError());return 50; else return (NormalizeDouble((Volume#91;t #93;/NormalizeDouble(suma/size,2))*100,2));

  2. #2
    I dont understand that function, I'll assess what it does. But Im more interested in how EMA is calculated itself, I dont think my calculations are great.

  3. #3
    Quote Originally Posted by ;
    I dont understand that purpose, I'll assess what it does. However, Im more interested in the way how EMA is calculated , I dont think my calculations are good.
    The iMAOnArray(...) function is doing the typical of an array you defined (ie. Your quantity calculation). It can be any of the normal MA Method.

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.