Announcement

Collapse
No announcement yet.

Equidistant 2nd Moving Average

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

  • Equidistant 2nd Moving Average

    I'd like to know, how to draw a parallel
    moving average line to a moving average line.

    How do I create such a parallel moving average ?
    How do I write the formula into the eSignal chart program ?
    The below formula is from MetaStock, what's the syntax for the formula, which works in the eSignal chart program ?

    I mean:

    for example:

    I draw a 500 Mov.Avg. in a 5 minute chart, Close Prices
    and weighted.

    Now I want to draw a parallel Mov.Avg. to the 500 Mov.Avg.,
    which has always the same distance of 0.1 percent to the
    original 500 Mov.Avg.

    Formula (MetaStock)
    mov(500,C,W)+0.001*mov(500,C,W)

    C....Close Prices
    W....Weighted

    Please look at the attached screenshot.

    Thanks.
    Attached Files

  • #2
    In the envelope settings I miss the weighted option. I also don't know how to create the formula within the customMA formula window, cause there's no option for percent and weighted.

    Comment


    • #3
      Hi gerris,
      you can do it easily with the Wizard this way:

      - create a new price study
      - create two data plots (named MA and ParaMA)
      - edit a study used like MAStudy(10, 0, "Close", MAStudy.WEIGHTED) in variable vWMA10
      - in data plot MA edit vWMA10.getValue(MAStudy.MA)
      - in data plot ParaMA edit (vWMA10.getValue(MAStudy.MA)+0.001*vWMA10.getValue (MAStudy.MA))
      The trick is don't miss first and last roud brackets.
      If helps you can use ctrl+c to copy and ctrl+v to paste
      - now check EFS syntax and save.
      Your new Formula Wizard is ready for your Chart.
      Hope this helps.
      Massimo

      //{{EFSWizard_Description
      //
      // This formula was generated by the Alert Wizard
      //
      //}}EFSWizard_Description


      //{{EFSWizard_Declarations
      var vWMA10 = new MAStudy(10, 0, "Close", MAStudy.WEIGHTED);
      var vLastAlert = -1;
      //}}EFSWizard_Declarations


      function preMain() {
      /**
      * This function is called only once, before any of the bars are loaded.
      * Place any study or EFS configuration commands here.
      */
      //{{EFSWizard_PreMain
      setPriceStudy(true);
      setStudyTitle("MAplusParallelMA");
      setCursorLabelName("MA", 0);
      setCursorLabelName("ParaMA", 1);
      setDefaultBarStyle(PS_SOLID, 0);
      setDefaultBarStyle(PS_SOLID, 1);
      setDefaultBarFgColor(Color.blue, 0);
      setDefaultBarFgColor(Color.red, 1);
      setDefaultBarThickness(1, 0);
      setDefaultBarThickness(1, 1);
      setPlotType(PLOTTYPE_LINE, 0);
      setPlotType(PLOTTYPE_LINE, 1);
      //}}EFSWizard_PreMain

      }

      function main() {
      /**
      * The main() function is called once per bar on all previous bars, once per
      * each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
      * in your preMain(), it is also called on every tick.
      */

      //{{EFSWizard_Expressions
      //{{EFSWizard_Expression_1
      //}}EFSWizard_Expression_1

      //}}EFSWizard_Expressions


      //{{EFSWizard_Return
      return new Array(
      vWMA10.getValue(MAStudy.MA),
      (vWMA10.getValue(MAStudy.MA)+0.001*vWMA10.getValue (MAStudy.MA))
      );
      //}}EFSWizard_Return

      }

      function postMain() {
      /**
      * The postMain() function is called only once, when the EFS is no longer used for
      * the current symbol (ie, symbol change, chart closing, or application shutdown).
      */
      }

      //{{EFSWizard_Actions
      //{{EFSWizard_Action_1
      function onAction1() {
      vLastAlert = 1;
      }
      //}}EFSWizard_Action_1

      //}}EFSWizard_Actions

      Comment

      Working...
      X