Announcement

Collapse
No announcement yet.

Wilders Smoothed Moving Average

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wilders Smoothed Moving Average

    Hi Guys

    Looking for some EFS code please the emulate the following MetaStock code

    Ref(Wilders(MP(),13),-8)

    All this is is a 13 period moving average on the mid point (H+L)/2
    offset by 8 periods. The trick is that it is adjusted using Wilders smoothing technique

    Does anyone have this please in their arsenal of code or can they point me where it may be found?

    Appreciate any and all help on this one

    Cheers

  • #2
    Benoit
    Wilders smoothing can be easily implemented by using an exponential average and adjusting the period with the equation (period*2)-1.
    As to your code that can be written in several ways in efs. The simplest one (shown below) is to use the offsetSeries() function to displace the ema() by the required number of bars.
    The enclosed images show your code running in a Metastock chart and the equivalent efs in an Advanced Chart
    Alex

    PHP Code:
    function preMain(){
        
    setPriceStudy(true);
    }

    var 
    Avg null;

    function 
    main(){

        if(
    Avg==nullAvg offsetSeries(ema((13*2)-1hl2()), 8);
        
        return 
    Avg.getValue(0);



    Comment


    • #3
      Alexis

      Legend .. thank you very much ...

      B

      Comment

      Working...
      X