Announcement

Collapse
No announcement yet.

Range Indicator

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

  • Range Indicator

    I am new to esignal. Can somebody show me how to make a simple indicator that measures the daily range (not the True Range), just the High - Low. Then I want to create a 10 day moving average of that range.

    Thanks

  • #2
    Timber
    I think the attached efs does what you asked.
    The length of the MA can be changed through EditStudies
    Alex

    Attached Files

    Comment


    • #3
      I had a slightly different way, using the formula wizard

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


      //{{EFSWizard_Declarations

      var vSMA10_of_High = new MAStudy(10, 0, "High", MAStudy.SIMPLE);
      var vSMA10_of_Low = new MAStudy(10, 0, "Low", MAStudy.SIMPLE);
      var vLastAlert = -1;

      //}}EFSWizard_Declarations 20983


      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(false);
      setStudyTitle("");
      setCursorLabelName("MAdiff", 0);
      setDefaultBarStyle(PS_DOT, 0);
      setDefaultBarFgColor(Color.red, 0);
      setDefaultBarThickness(1, 0);
      setPlotType(PLOTTYPE_DOT, 0);
      //}}EFSWizard_PreMain 27905

      }

      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
      if (
      5 < 7
      ) onAction1();
      //}}EFSWizard_Expression_1 5280

      //}}EFSWizard_Expressions 14753


      //{{EFSWizard_Return
      return ((vSMA10_of_High.getValue(MAStudy.MA)-vSMA10_of_Low.getValue(MAStudy.MA)));
      //}}EFSWizard_Return 5998

      }

      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 5589

      //}}EFSWizard_Actions 15622
      Attached Files

      Comment


      • #4
        Daily Range with MA

        You might want to look at HiLoAverageRange1.efs and HiLOAverageRange2.efs. These were kindly coded up by Chris C. in response to my request a couple of months ago. You can find them in Specialty Scripts in the Miscellaneous folder. Certainly met my need.

        BobA.

        Comment


        • #5
          Daily Range with MA

          Timber,
          Sorry for the incomplete post below. Both the ones I mentioned are intraday.The efs you are more likely looking for is in the same Miscellaneous folder but named DailyRangeHist.efs.

          It plots a histogram of daily HiLo Ranges with a user-definable MA line superimposed on it.

          Regards,
          Bob A.

          Comment

          Working...
          X