Announcement

Collapse
No announcement yet.

Requesting Formula Help

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

  • Requesting Formula Help

    I am new to the Formula building on Esignal. I need help constructing an
    overbot/ oversold indicator. The formula is:

    (((high-open) + (close-low))/ ((2*(high-low)))*100

    I then need a 13 period moving average of this number plotted on chart below
    price. The min. and max values should be 0 to 100.

    thank you,
    Timber

  • #2
    Hello Timber,

    Click on the link below to download your completed formula.

    OverBoughtOverSold.efs
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Hope this is what you want....

      Here is my first attempt at this. The code is manually calculating the averaged return value, so we may have to modify this a bit, but it should be very close to what you want.

      I will also post it into my group... http://share.esignal.com/groupconten...er=&groupid=33

      PHP Code:
      /****************************************************************************************************
      Copyright © Matheny Enterprises
      *****************************************************************************************************/
      var returncount 0;
      var 
      nLastRawTime 0;
      var 
      TimberSum 0


      function preMain() {
          
      setStudyTitle("Timber Ind");
          
      setCursorLabelName("Timber Ind");
      }

      function 
      main(vLength) {
         if (
      vLength == null) {
           
      vLength 13;
         }

         var 
      returnvalue;

         if ((
      returncount <= vLength) && (getValue("rawtime"0) != nLastRawTime)) {
           
      TimberSum += ( ((high(0)-open(0)) + (close(0)-low(0))) / ((2*(high(0)-low(0))) )*100);
           
      nLastRawTime getValue("rawtime"0);
           
      returncount += 1;
           if (
      returncount == vLength) {
             
      returnvalue TimberSum vLength;
           }
         }

         if ((
      returncount vLength) && (getValue("rawtime"0) != nLastRawTime)) {
           
      TimberSum -= ( ((high(-13)-open(-13)) + (close(-13)-low(-13))) / ((2*(high(-13)-low(-13))) )*100);
           
      TimberSum += ( ((high(0)-open(0)) + (close(0)-low(0))) / ((2*(high(0)-low(0))) )*100);
           
      nLastRawTime getValue("rawtime"0);
           
      returncount += 1;

             
      returnvalue TimberSum vLength;
         }

      //  Test for null returns.
          
      if (returncount 13) {
             return 
      0;
          } else {
             return (
      returnvalue);
          }

      Brad
      Brad Matheny
      eSignal Solution Provider since 2000

      Comment


      • #4
        Good work Brad.

        I realize I left out the moving average in my previous formula. Here is the new version with an adjustable length input for the moving average.

        MAOverBoughtOverSold.efs
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment

        Working...
        X