Hello,
You can try this code:
double EMAValue()
{
//---
int limit=WindowFirstVisibleBar();
double wpr[];
ArrayResize(wpr,limit);
ArraySetAsSeries(wpr,true);
//--
for(int i=limit; i>=0; i--)
{
wpr[i]=iWPR(_Symbol,0,5,i);
}
//--
double wprplus=100-MathAbs(wpr[i]); // If you want to Convert the Minus WPR value to Plus
double ema=iMAOnArray(wpr,0,3,0,MODE_EMA,0)); // The real value of EMA3 (EMA3 Minus)
double emaplus=100-MathAbs(iMAOnArray(wpr,0,3,0,MODE_EMA,0)); // If you want to convert the Minus EMA3 value to Plus
//--
return(ema);
// or return(emaplus);
//----
}
Thank you so much.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
If I want to bring out the value of the EMA.
How to write code?
The default setting is William Period: 5
EMA: 3
Thanks.