Announcement

Collapse
No announcement yet.

Can anyone help with simple EFS code?

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

  • Can anyone help with simple EFS code?

    Hey,

    I was just wondering if anyone could tell me how to build a simple indicator that calculates the absolute value of the High minus the low for each bar, and plots a 10 bar simple MA of the data. I tried the formula wizard, but it needs you to input expressions such as "if this is > than this, do this", but the indicator i'm trying to build does not need any expressions. Also, I don't know how to customize the MA to make it compute data from ABS(High - Low).

    Would appreciate any specific code or general info on how to do it.

    Thanks.

  • #2
    Try Average True Range study under Basic Studies.

    Comment


    • #3
      I know about the average true range but that's not what I'm trying to measure. The ATR includes gaps in its measurement, and I want to exclude them by measuring the average intraday day range (i.e. just high minus the low with no regard to opens). Do u know how i could do that?

      Comment


      • #4
        Ziad
        For an example of how to compute the range and its moving average see the second script enclosed in this post. All you need to do is replace ema with sma in ema(Length,nHL);
        FWIW you do not need to calculate the absolute value of High minus Low as that is always a positive number or 0.
        Alex

        Comment


        • #5
          Thank you Alex and Ziad

          I learnt something new here.

          Hamid.

          Comment


          • #6
            Hey Alexis,

            Well thanks a lot for the formula... i guess i got lucky that the example u were giving in that post was the exact formula i was looking for! Now i have a 10 day SMA of highs minus lows just like i wanted.

            As for the ABS, I have no clue what I was thinking but thanks for pointing out the obvious anyways..

            Comment


            • #7
              Hamid,

              Not a problem at all... Many times in the process of trying to help someone out you end up learning something new urself... So i'm glad that was the case.

              Ziad

              Comment


              • #8
                Hamid and Ziad
                You are most welcome
                Alex

                Comment

                Working...
                X