Announcement

Collapse
No announcement yet.

Determining the slope of a trendLine

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

  • Determining the slope of a trendLine

    Could somebody suggest a EFS to show in a non-price study a green bar if the slope of a trendline is greater than a predefined fraction and a red bar is below? and trigger an alarm list and sound?

    Could that be done with the Formula Wizard?

    Thanks

    PBC

  • #2
    Trendlines' end points drawn from the Line Toolbar cannot be accessed by an EFS. Trendlines' end points drawn from within an EFS can be accessed, and slope can be determined from there. This would be quite difficult to do with Formula Wizard and would be better suited for a straight EFS file.
    Regards,
    Jay F.
    Product Manager
    _____________________________________
    Have a suggestion to improve our products?
    Click Support --> Request a Feature in eSignal 11

    Comment


    • #3
      Thanks Jay- Trouble is I am not good at EFS writing without the wizard. Could you help--- at your convenience?

      What I really need is tracking the slope of the 40EMA line, to avoid whipsaw action when the slope is les than+/- a predefined amout and show the +ve -ve and flat slope on a non price sudy bar.

      Thanks again

      PBC

      Comment


      • #4
        Actually you can tell how fast the ema is rising or falling, so you can display various colors in the non price study pane depending on the rate.

        What rate do you consider fast? slow?

        Comment


        • #5
          Thanks Dave:

          Actually I would like the possibility of defining those rates, but basically +/- 10-20 and 30% would be a good start

          Thanks again

          Comment


          • #6
            You can input the rate n to this efs fila and have the barsturn red or lime, based on the ems change over the last 2 bars.
            Attached Files

            Comment


            • #7
              Thanks Again Dave.- The formula seems to work only if rate is kept at "0". Any positive value turns the bar red and -ve values blank it. So in essence the bar tells only if the close is above or below the 40EMA with no relations to the slope.

              I tried to change the number of prior bar spread, and that filters the bar somewhat but the plot does not seem to reflect the degree of the slope. You mentioned in your earlier post that one could have various colors for different rates how could that be achieved?

              Am I doing something wrong?

              Thanks

              PBC

              Comment


              • #8
                I think I fixed the logic mistake
                Attached Files

                Comment


                • #9
                  oops, what rate seems reasonable for the ema 40? must be very small, cuz I couldnt get the colors to show up.

                  corrected version attached
                  Attached Files

                  Comment


                  • #10
                    Hi Dave- Me again.

                    I ran your latest fix but still could not get any plots for rates other than zero. Exactly as before with the only difference being the colors were flipped.

                    This is to be expected since the only difference I noted between the original and latest formula is the flipping of the >/< signs in lines 51 and 56.

                    The logic I'm looking for, expressed in words is as follows:

                    "If the rise between MA@point B and MA@point A say n bars before, divided by the horizontal distance between points A and B is greater than +r (rate) then color bar green, and if less than -r then color bar red. If r is between +r and -r then color bar say yellow, meaning rate is flat"

                    Does that make sense?

                    Could this logic be put in an EFS?

                    Thanks again

                    PBC

                    Comment


                    • #11
                      Hi Dave:

                      Having a further thought on the matter. The horizontal distance is time elapsed betweeen points A and B and the ratio would be expressed in units of the underlying per minute, seconds etc.

                      The formula could then be expressed as:

                      MA valu at point B - Ma value at point A/ time of point B- Time of Point A.

                      Thanks

                      PBC

                      Comment


                      • #12
                        Hi Dave: Do you or anybody else have any thoughts about my latest post for generating an EFS to determine the "speed" of a MA? ie units of underlying/time

                        I guess it boils down to whether an EFS could be written to determine the Time Difference betwen two MA's to devide into the difference between the two MA's

                        Thanks

                        PBC

                        Comment


                        • #13
                          The only idea I have is to see what the difference is between the ema's, bar by bar.

                          I got colors to show up with non-zero values around 0.00004 or some such small number.

                          Comment


                          • #14
                            Hi David:

                            If I read your EFS formula right, you are dividing the difference between two EMS bars by the last EMA bar value which, as you point, gives only the %difference between bars.

                            What I am looking for, if at all feasable, is to get the difference between say 1,5,10 etc of the underlying EMA bars, and then divide that difference by the respective difference in times in seconds or minutes to get a result denoting units of EMA per second or minute.

                            Could an EFS be written to calculate the time difference BETWEEN two bars that are 5,10 or fifteen bars apart?

                            If so, then that should resolve the problem since that could be divided into the EMA values to obtain the "Speed" if you will of the EMA.

                            If an EFS cannot be written for the difference of times between two bars, then that answers my question too.

                            Which is it?

                            Thanks

                            PBC

                            Comment


                            • #15
                              Hello PBC,

                              I'm not sure I completely understand your "speed" concept, but there are some EFS functions you can use to look a the time of the bars. Hope this helps.

                              For the current bar:
                              getHour()
                              getMinute()
                              getSecond()

                              For the bar N bars ago:
                              getHour(-N)
                              getMinute(-N)
                              getSecond(-N)
                              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