Hi,
I would like to smooth the below Willams %R indicator with iMA function but I cannot do it in the expert. Can anyone help me on this?
Thanks indeed.
AED.
w=iWPR(NULL,0,14,0);
How have you tried to do it so far ?
Hi Raptor,
Yes I did but I cannot be sure about it. I was using Metastock previously and I was doing it as below. I'm not familiar with writing indicator so I cannot see if it's right or wrong.
w=iWPR(NULL,0,14,0); // 14 period Willams % R
sw=iMA(NULL,0,3,0,MODE_SMA,w,0); // 3 period smoothed Willams % R
I would appreciate if you can comment on this.
Thanks
AED.
aed71:
Yes I did but I cannot be sure about it. I was using Metastock previously and I was doing it as below. I'm not familiar with writing indicator so I cannot see if it's right or wrong.
w=iWPR(NULL,0,14,0); // 14 period Willams % R
sw=iMA(NULL,0,3,0,MODE_SMA,w,0); // 3 period smoothed Willams % R
- Same code in an indicator or in an EA. Put the values into an array and use iMAonArray.
- If you just want to see the MA on top of the indicator you can drag the moving average indicator to the wpr window and select price=previous indicator.
- Same code in an indicator or in an EA. Put the values into an array and use iMAonArray.
- If you just want to see the MA on top of the indicator you can drag the moving average indicator to the wpr window and select price=previous indicator.
Thanks WHRoeder,
I'm really very much surprised to see so many commands for MQL at the top of C. I didn't know iMAonArray.
I write the below code, would appreciate if you can check it. sw0,sw1 and sw2 are my variables to play with during TA, crossing some values etc.
I tired to drag the moving average indicator to the wpr but couldn't succeeded yet :-)
void Smoothed() { int i; double myarray[20]; double sw0,sw1,sw2; for(i=0;i<10;i++) myarray[i]=iWPR(NULL,0,14,i); // take the willams % r to array // Smoothing with 5 period moving avarage with SMA sw0=iMAOnArray(myarray,0,5,0,MODE_SMA,0); // smoothed willams % R 0th index sw1=iMAOnArray(myarray,0,5,0,MODE_SMA,1); // smoothed willams % R 1st index sw2=iMAOnArray(myarray,0,5,0,MODE_SMA,2); // smoothed willams % R 2nd index }
Hi WHRoeder,
I've put the code using SRC, sorry for that.
I traced the code and I saw that if I take 2nd parameter of iMAOnArray function (the total parameter) as zero or Bars, it gives zero to the variables sw0,sw1,sw2. When I put 5 it gives some values more logically but I cannot trace it by comparing the chart.
Could you please comment if I'm using the iMAOnArray function wrong? And I would also appreciate if you can elaborate how can I put moving average on top of Willams%R indicator on chart? It would help me to trace my results.
Thanks
AED.
I traced the code and I saw that if I take 2nd parameter of iMAOnArray function (the total parameter) as zero or Bars, it gives zero to the variables sw0,sw1,sw2. When I put 5 it gives some values more logically but I cannot trace it by comparing the chart.
Could you please comment if I'm using the iMAOnArray function wrong? And I would also appreciate if you can elaborate how can I put moving average on top of Willams%R indicator on chart? It would help me to trace my results.
double myarray[20]; for(i=0;i<10;i++) myarray[i]=iWPR(NULL,0,14,i)
Maybe you should fill in the entire array!
Yes, good point. I have tested recently it but it's the same.
Could you please help me to put moving average at the top of willams %R on the chart? I couldn't succeeded, any documentation, video on that? I can verify my results only by comparing with the chart indicator.
Thanks in advance

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I would like to smooth the below Willams %R indicator with iMA function but I cannot do it in the expert. Can anyone help me on this?
Thanks indeed.
AED.
w=iWPR(NULL,0,14,0);