 Help coding EMA for Volume

# Thread: Help coding EMA for Volume

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));  Reply With Quote

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.  Reply With Quote

3. 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.  Reply With Quote

4. Why don't you use iMAOnArray(...)?  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•