Announcement

Collapse
No announcement yet.

Z-Score MAs

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

  • Z-Score MAs

    I am interested in plotting a moving average of the Z-Score indicator and then another ma of that ma. Does anyone have any idea of how I might do that? Being brand new to eSignal I have had some difficulty getting use to not having a "generic" moving average that I can plot on any indicator without it having to be programmed into the indicator's efs.

    Thanks.

  • #2
    darylr
    The easiest way to do this in efs is to use the efsExternal() function which allows you to call an external efs and to create the series object which you can then use as the source for the moving average function.
    Enclosed below is a basic example of the required logic together with some comments. For more detailed examples on the use of efsExternal() see also this and this thread.
    Alex

    PHP Code:
    //call the external efs(s) and retrieve the data series returned by those scripts
    var myVar1 efsExternal("path_to_efs/name_of_efs.efs",parameter1parameter2etc);//(parameters if required)
     
    //the efsExternal() function creates a series object which means that you can use it as the source
    //for other functions that require a series object such as the built-in studies ie

    var myAvg sma(10myVar1);

    //as myAvg is a series object you can in turn use it as the source of a second average (and so on)

    var mySecondAvg sma(10myAvg);
     
    //once you have the series then use the .getValue() method to retrieve or return its/their values ie
    //myAvg.getValue(0) is the current bar, myAvg.getValue(-1) is the value of the average at the prior bar, etc 

    Comment


    • #3
      Thanks Alex. I really appreciate the assist.

      darylr

      Comment


      • #4
        Please also explain where we should be putting this code

        Comment

        Working...
        X