Announcement

Collapse
No announcement yet.

Measuring the slope of studies

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

  • Measuring the slope of studies

    Hi, I would be grateful if someone could explain how to go about measuring the slope of a study - e.g. - a moving average so that it outputs a value which can be used in filtering rules for an indicator.

    I'm very new to efs and coding generally but hey, trying to learn more everyday

    If there is some example code somewhere that would be great - I haven't found anything on the site yet.

    Thanks

  • #2
    Re: Measuring the slope of studies

    dk
    You can calculate the slope expressed as a percentage using the following equation
    var myStudy = sma(10)
    var slope = ((myStudy.getValue(0)/myStudy.getValue(-1))-1)*100

    or you can use a 1 period ROC of the average which will return the same eg
    var slope = roc(1, sma(10))
    Also try searching the forums for the keyword slope and you will find many other examples as this topic has been discussed before
    Alex


    Originally posted by dk
    Hi, I would be grateful if someone could explain how to go about measuring the slope of a study - e.g. - a moving average so that it outputs a value which can be used in filtering rules for an indicator.

    I'm very new to efs and coding generally but hey, trying to learn more everyday

    If there is some example code somewhere that would be great - I haven't found anything on the site yet.

    Thanks

    Comment


    • #3
      thanks Alex

      Comment


      • #4
        dk
        My pleasure
        Alex


        Originally posted by dk
        thanks Alex

        Comment

        Working...
        X