Announcement

Collapse
No announcement yet.

Daily ATR on an intraday chart

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

  • Daily ATR on an intraday chart

    Anyone know if we can plot a daily ATR on an intraday chart?

  • #2
    Re: Daily ATR on an intraday chart

    Mario
    You can using the atr() function set to compute on daily data. For the description, syntax and examples of the function see this article in the EFS KnowledgeBase
    Note also that the customATR.efs that is in the EFS2 Custom folder of Formulas is already enabled for use with external symbols and/or intervals
    Alex


    Originally posted by redislk
    Anyone know if we can plot a daily ATR on an intraday chart?

    Comment


    • #3
      Re: Re: Daily ATR on an intraday chart

      Originally posted by Alexis C. Montenegro
      Mario
      You can using the atr() function set to compute on daily data. For the description, syntax and examples of the function see this article in the EFS KnowledgeBase
      Note also that the customATR.efs that is in the EFS2 Custom folder of Formulas is already enabled for use with external symbols and/or intervals
      Alex
      Alexis,

      I can't find that customATR.efs in the efs2 folder. Can you point me to it?

      Thanks,
      Mario

      Comment


      • #4
        Re: Re: Re: Daily ATR on an intraday chart

        Mario
        The file is located on your hard drive in the EFS2 Custom sub-folder of the Formulas folder in the eSignal directory
        Alex


        Originally posted by redislk
        Alexis,

        I can't find that customATR.efs in the efs2 folder. Can you point me to it?

        Thanks,
        Mario

        Comment


        • #5
          Re: Re: Re: Re: Daily ATR on an intraday chart

          Alex,

          Thanks, I was looking for it online lol...

          Anyways, I set the Interval to daily and I see that it uses that days daily info to calculate the ATR. Can I get it to calculate off the prior days daily data?

          Thanks,
          Mario


          Originally posted by Alexis C. Montenegro
          Mario
          The file is located on your hard drive in the EFS2 Custom sub-folder of the Formulas folder in the eSignal directory
          Alex

          Comment


          • #6
            Re: Re: Re: Re: Re: Daily ATR on an intraday chart

            Mario
            Use the getValue() method of the Series Object to retrieve the prior values
            Alex


            Originally posted by redislk
            Alex,

            Thanks, I was looking for it online lol...

            Anyways, I set the Interval to daily and I see that it uses that days daily info to calculate the ATR. Can I get it to calculate off the prior days daily data?

            Thanks,
            Mario

            Comment


            • #7
              Re: Re: Re: Re: Re: Re: Daily ATR on an intraday chart

              Alex,

              I tried to add the getValue() to the ATR formula but it still seems to be pulling the data from the current day. Here is what I did.

              /************************************************** *******
              By Alexis C. Montenegro for eSignal © December 2004
              Use and/or modify this code freely. If you redistribute it
              please include this and/or any other comment blocks and a
              description of any changes you make.
              ************************************************** ********/

              /************************************************** ********
              Additions by MarioM March 28, 2010

              I am trying to make this calculate the ATR based on
              yesterdays daily ATR.

              I added DaysBack var so you can specify how many days back
              you would like the ATR to calculate on.

              ************************************************** *********/

              var fpArray = new Array();

              function preMain() {

              setPriceStudy(false);
              setStudyTitle("Mario_ATR");
              setCursorLabelName("ATR", 0);
              setDefaultBarFgColor(Color.blue, 0);
              setPlotType(PLOTTYPE_LINE,0);
              setDefaultBarThickness(1,0);
              askForInput();

              var x=0;
              fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
              with(fpArray[x++]){
              setLowerLimit(1);
              setDefault(14);
              }
              fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
              with(fpArray[x++]){
              setDefault();
              }
              fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
              with(fpArray[x++]){
              setDefault();
              }
              fpArray[x] = new FunctionParameter("DaysBack", FunctionParameter.STRING);
              with(fpArray[x++]){
              setDefault(0);
              }
              fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
              with(fpArray[x++]){
              setName("Show Parameters");
              setDefault(false);
              }
              }

              var bInit = false;
              var xATR = null;

              function main(Length,Symbol,Interval,DaysBack,Params) {

              if(bInit == false){
              if(Symbol == null) Symbol = getSymbol();
              if(Interval == null) Interval = getInterval();
              if(DaysBack == null) DaysBack = getValue();
              var vSymbol = Symbol+","+Interval+","+DaysBack;
              xATR = atr(Length,sym(vSymbol));
              setShowTitleParameters(eval(Params));
              bInit = true;
              }

              return getSeries(xATR);




              Originally posted by Alexis C. Montenegro
              Mario
              Use the getValue() method of the Series Object to retrieve the prior values
              Alex

              Comment


              • #8
                What I am trying to do is to eventually have a channel based on the prior days ATR plotted on to an intraday chart. So for example on a 5 min chart of GS I want to see a channel based on the prior days ATR. I went ahead and read thru the getValue() function and think I have applied it correctly but still do not get a result back. If anyone can shed some light on what I am doing wrong I would greatly appreciate it.
                Attached Files
                Last edited by redislk; 03-29-2010, 06:16 PM.

                Comment


                • #9
                  Mario
                  You are not getting anything because the syntax used in the return statement is invalid. This should be
                  return xATR.getValue(-1);
                  Additionally delete line 67 which is correct from the point of view of the syntax but not of the usage as the value retrieved from the series will be assigned to the variable nValue_1 only once when the bInit routine is executed [at which point BTW the value of the xATR series is still null as the indicator is not yet primed]. If you do want to use that line then you would need to place it outside of the bInit routine at which point you would also simply use nValue_1 in your return statement
                  Also delete line 64 as it is incorrect as is
                  Alex


                  Originally posted by redislk
                  What I am trying to do is to eventually have a channel based on the prior days ATR plotted on to an intraday chart. So for example on a 5 min chart of GS I want to see a channel based on the prior days ATR. I went ahead and read thru the getValue() function and think I have applied it correctly but still do not get a result back. If anyone can shed some light on what I am doing wrong I would greatly appreciate it.

                  Comment


                  • #10
                    Thanks Alex.

                    Comment


                    • #11
                      Mario
                      You are welcome
                      Alex


                      Originally posted by redislk
                      Thanks Alex.

                      Comment

                      Working...
                      X