Announcement

Collapse
No announcement yet.

Rate Of Chanege MA

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

  • Rate Of Chanege MA

    Is there a way to add a MA or a Parabolic SAR to the following efs?
    /************************************************** *****************
    Description : This Indicator plots Rate Of Change indicator
    Provided By : Developed by TS Support, LLC for eSignal. (c) Copyright 2002
    ************************************************** ******************/

    function preMain()
    {
    setPriceStudy(false);
    setStudyTitle("RateOChangeFromStart");
    setCursorLabelName("RateOChangeFromStart");
    }
    var FVal = null;
    function main(sPrice)
    {
    if (sPrice == null) sPrice = "Close";
    var Price = getValue(sPrice, 0);
    if (FVal == null) FVal = Price;
    var RateOChangeFromStart = (Price * 100) / FVal - 100;
    return RateOChangeFromStart;

  • #2
    Re: Rate Of Chanege MA

    gwika
    The easiest solution is to write another efs that calls that one using the efsExternal() function (for the description and syntax of this function see the link to the related article in the EFS KnowledgeBase)
    The efsExternal() function creates a series which you can then use as a custom source for the moving average [or other function] as shown in the example enclosed below. Note that this example is only to illustrate the required logic and is not necessarily the most efficient way to write the formula.
    Alex

    PHP Code:
    function main(sPrice){
        if (
    sPrice == nullsPrice "Close";
        var 
    Study efsExternal("\\\\path_to_efs, name_of_efs.efs"sPrice);
        var 
    MAofStudy sma(10Study)
        return new Array (
    Study.getValue(0), MAofStudy.getValue(0))


    Originally posted by gwika
    Is there a way to add a MA or a Parabolic SAR to the following efs?
    /************************************************** *****************
    Description : This Indicator plots Rate Of Change indicator
    Provided By : Developed by TS Support, LLC for eSignal. (c) Copyright 2002
    ************************************************** ******************/

    function preMain()
    {
    setPriceStudy(false);
    setStudyTitle("RateOChangeFromStart");
    setCursorLabelName("RateOChangeFromStart");
    }
    var FVal = null;
    function main(sPrice)
    {
    if (sPrice == null) sPrice = "Close";
    var Price = getValue(sPrice, 0);
    if (FVal == null) FVal = Price;
    var RateOChangeFromStart = (Price * 100) / FVal - 100;
    return RateOChangeFromStart;

    Comment

    Working...
    X