Announcement

Collapse
No announcement yet.

Moving Average Studies

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

  • Moving Average Studies

    I would like to plot a 10 DAY SMA on a 5-minute chart. Live Rep said this would be the place to go. Can anybody help?

    Thanks,

    Joe

  • #2
    Hello Joe,

    The combination of the two formulas below will plot your MA on intra-day charts. Download and save getPrevDaysOHLC.efs to /Formulas/OHLC/. Then download and save DailyMAonIntraday.efs to any folder inside /Formulas/.

    Then all you need to do is apply DailyMAonIntraday.efs to your 5 minute chart and you will see the 10 day moving average plotted as a blue line, which includes the current day's data for the MA. This formula will work on any intra-day interval. If you want to show the 10-day MA for the previous 10 trading days, enter -1 for nOffset.

    DailyMAonIntraday.efs input parameters can be changed through the "Edit Studies" option.
    nLength: Default is 10. (Length for moving average)
    nPriceSource: Default is Close. Valid inputs are Open, High, Low and Close.
    nOffset: Default is 0. (Offsets the group of data to calculate MA in terms of number of Days)

    getPrevDaysOHLC.efs is a utility formula that is called from the above formula using the callFunction() function. Syntax for using callFunction() on getPrevDaysOHLC.efs follows.
    var aData = callFunction("/OHLC/getPrevDaysOHLC.efs", "main", nPriceSource, nOffset, nNumDays);
    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
      Jason,

      I downloaded the scripts and the moving averages show up fine but they are only as of the previous day, not the current day. I check against the moving average plotted on a daily chart. It is probably because it calls getPREVIOUSdaysOHLC. Is there a way I can get the formula to use the current days data?
      Thanks.
      Later,
      drd1

      Comment


      • #4
        Hello drd1,

        You're observations are correct. My previous message was slightly incorrect. The getPrevDaysOHLC.efs formula does not include the current day's price. I need to make a new version of that formula for the library. For the time being, DailyMAonIntraday2.efs, should work for you. If you enter 5 for the length, the MA will be based on the current day's close plus the previous 4 days closes. In addition to getPrevDaysOHLC.efs you'll need to download, getTodayOHLC1.efs, and save it to \eSignal\Formulas\OHLC\ as well. Try it out and let me know if you have any trouble.
        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


        • #5
          Thanks Jason,

          Seems to work just right. I'll have to wait until tomorrow to see the results while the market is open. Thanks again for the quick work.
          Later,
          drd1

          Comment


          • #6
            Originally posted by JasonK
            Hello drd1,

            You're observations are correct. My previous message was slightly incorrect. The getPrevDaysOHLC.efs formula does not include the current day's price. I need to make a new version of that formula for the library. For the time being, DailyMAonIntraday2.efs, should work for you. If you enter 5 for the length, the MA will be based on the current day's close plus the previous 4 days closes. In addition to getPrevDaysOHLC.efs you'll need to download, getTodayOHLC1.efs, and save it to \eSignal\Formulas\OHLC\ as well. Try it out and let me know if you have any trouble.
            thanks! the only problem is that i want this to update on the 5-min chart every bar. you have to manually reload the script to update the value. any ideas?

            Comment


            • #7
              Is it possible to get an EMA version of this? Thx!

              Comment


              • #8
                Daily EMA on intraday chart

                JT47319

                Have you found the EFS that plots daily EMA on 5 charts. If yes, can you please let me know.

                Thanks

                Comment


                • #9
                  blank EFS file

                  Does anyone have the getPrevDaysOHLC.efs file, the download from this post appears to be blank.

                  many thanks

                  TJ

                  Comment


                  • #10
                    TJ
                    You can find a copy of getPrevDaysOHLC.efs here
                    Alex

                    Comment


                    • #11
                      Hi There,

                      I downloaded the file as suggested and added it to the same formula folder as the 3 days rolling average formula. The error message on line 59

                      "formula file not found: /OHLC/getPrevDaysOHLC.efs

                      still comes up.

                      Any suggestions to fix this error?

                      Thanks in advance for your kindness,
                      Magda

                      Originally posted by Alexis C. Montenegro
                      TJ
                      You can find a copy of getPrevDaysOHLC.efs here
                      Alex

                      Comment


                      • #12
                        Magda
                        The error message could suggest that you did not download the required file. Note that at the link provided there are three files with a similar name. Make sure you are downloading getPrevDaysOHLC.efs
                        Alex


                        Originally posted by Magda
                        Hi There,

                        I downloaded the file as suggested and added it to the same formula folder as the 3 days rolling average formula. The error message on line 59

                        "formula file not found: /OHLC/getPrevDaysOHLC.efs

                        still comes up.

                        Any suggestions to fix this error?

                        Thanks in advance for your kindness,
                        Magda

                        Comment


                        • #13
                          Alex,

                          Double checked the downloaded formula file and it is the correct one. It opens fine on its own in the "Editor" but I am now not sure how to get the error fixed as it still prevails.

                          Any other fixes I could try?

                          Thanks for your patience.
                          Magda

                          Originally posted by Alexis C. Montenegro
                          Magda
                          The error message could suggest that you did not download the required file. Note that at the link provided there are three files with a similar name. Make sure you are downloading getPrevDaysOHLC.efs
                          Alex

                          Comment


                          • #14
                            Magda
                            Are both formulas located in the OHLC folder in Formulas?
                            If not then you can do one of two things. Either move the getPrevDaysOHLC.efs to the OHLC folder or edit the calling script and change the path from the current "/OHLC/getPrevDaysOHLC.efs,..." to "getPrevDaysOHLC.efs,..."
                            Alex



                            Originally posted by Magda
                            Alex,

                            Double checked the downloaded formula file and it is the correct one. It opens fine on its own in the "Editor" but I am now not sure how to get the error fixed as it still prevails.

                            Any other fixes I could try?

                            Thanks for your patience.
                            Magda

                            Comment


                            • #15
                              Hi There Alexis,

                              Apologies for the late reply, but I had no time until today to review the formula again and to introduce your tips. Thanks a million for your 2nd tip = it now plots 100%!!

                              Many thanks again for your kindness.

                              Best regards,
                              Magda

                              Originally posted by Alexis C. Montenegro
                              Magda
                              Are both formulas located in the OHLC folder in Formulas?
                              If not then you can do one of two things. Either move the getPrevDaysOHLC.efs to the OHLC folder or edit the calling script and change the path from the current "/OHLC/getPrevDaysOHLC.efs,..." to "getPrevDaysOHLC.efs,..."
                              Alex

                              Comment

                              Working...
                              X