Average Deviation is not a built in function or indicator in MetaTrader, but you can code it yourself instead:
The average of the absolute deviations of data points from their mean. Average Deviation is a measure of the variability in a data set.
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty. Fernando gave you the math.
No free help (2017)
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help (2017)
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty. Fernando gave you the math.
No free help (2017)
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help (2017)
sorry,My english is very poor,so Maybe what I said was impolite
double TYP=(High[0]+Low[0]+Close[0])/3; double a=iMA(Symbol(),0,14,0,MODE_EMA,0,0); double CCI=(TYP-a)/(0.015*AVEDEV(TYP,14));
mt4 have the AVEDEV fuction? I want use the AVEDEV,what can i do
extern int CCIPeriod = 50; // CCI period extern ENUM_APPLIED_PRICE CCIPrice = PRICE_TYPICAL; // Price for(int i=limit,k; i>=0; i--) { prices[i] = iMA(NULL,0,1,0,MODE_SMA,CCIPrice,i); double avg=0; for(k=0; k<CCIPeriod && (i+k)<Bars; k++) avg += prices[i+k]; avg /= (CCIPeriod); double dev=0; for(k=0; k<CCIPeriod && (i+k)<Bars; k++) dev += MathAbs(prices[i+k]-avg); dev /= (CCIPeriod); // Average Deviation cci[i] = (dev!=0) ? (prices[i]-avg)/(0.015*dev) : 0; }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use