Announcement

Collapse
No announcement yet.

PrevDay HiLo w/in limited Range

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

  • PrevDay HiLo w/in limited Range

    I am interested in getting the values for the high, low, and close for the Dow Futures (YM), but I want them from the prior day, and I only want to know them for the time template of 9:30 to 16:00 (the YM trades before and after that time). I've tried using the "=2" suffix ib the symbol, but that still includes the hour before 9:30, and also runs until 16:15pm. So when I use built-in EFS functions to get hi, lo, close of yesterday, the values are not what I want.
    Is there an algorithm to do this, or has anyone done anything like this?
    Thank you for your time.
    John

  • #2
    What I have done to keep track of this is to determine if the time>= 930, then start checking for new daily hi's or lo's

    Comment


    • #3
      David, Thanks for your speedy reply.
      I'm not sure I follow you. What you are suggesting (I think) will only tell me when YM has put in a new daily high or low for the day. That isn't what I want.
      What I want is to know when the YM (today) is at/beyond yesterday's (9:30 to 16:00) highs or lows.
      JOHN

      Comment


      • #4
        John
        The efs attached to this post will compute the OHLC of the prior day using only the data plotted on the chart (see image)
        Alex


        Comment


        • #5
          That's close, but not what I want. That little EFS requires me to have up the 9:30-16:00 time template. I watch the 8:20-16:15 time template (but want bars (like what you have) shown for the HLC of the regular trading hours that the stocks of the DOW are open (ie 9:30-16:00) to show on my 8:20-16:15 time tempated chart.
          I wrote a little EFS hack that does it just for today, but it requires a 5min chart (which is what I use) -- it's not generalized for other time frames, and it just brute-force puts horizontal lines at the three levels.
          It would be nice to get the levels I want to show for each day (not just today), as do yours. But that is something I am not yet able to program successfully. Any suggestions would be appreciated.
          JOHN
          Attached Files

          Comment


          • #6
            John
            You can do that using the inv() function and calculating the values you want based on an external interval (in this case 390 minutes) that in the Time Template is set to Start/End at 9:30-16:00
            For information on the inv() function and the required syntax see the EFS2 Function Reference in the EFS KnowledgeBase
            Alex

            Comment


            • #7
              Alex,

              Thanks, again, for your time in reply. I will look into that.
              I also just found the dsUtilities and see that there are some functions in there that may also do it:
              dsgetMaxValueAtRange()
              dsgetMinValueAtRange()

              Thanks, again.

              JOHN

              Comment


              • #8
                Alex,

                Not sure if this is the place to post this, but here goes.
                I used the dsUtilities and was able to make the code in a few simple lines (see attached).
                What I don't understand, however, is that when I first load this EFS in, it takes over 70 seconds to load. Is that normal? Or does this mean I have a glitch/bug somewhere?

                JOHN
                Attached Files

                Comment


                • #9
                  John:

                  You were calling the logic on every bar, which is really not necessary. Try the attached instead...much faster.

                  Chris
                  Attached Files

                  Comment


                  • #10
                    Ah, that is much better!

                    Thanks a ton, Chris!

                    John

                    PS
                    Thanks for making those dsUtilities. Very handy how I can basically do what I want in a handfull of lines of code. And they are so transparent in their parameters, too. Nice.

                    Comment


                    • #11
                      John
                      You may want to download the update to the dsUtilities library that Chris has just posted.
                      Once you have done that you could modify your efs to plot your variables instead of using addBand(). This would provide you also with historical values of High, Low and Close of the prior day.
                      To modify the efs use the version Chris posted and remove isLastBarOnChart()==true && from the condition isLastBarOnChart()==true && bDone==false. Then replace return; with return new Array( vYesterdayHI, vYesterdayLO, vYesterday4pmClose ); and comment out all the addBand() commands The result of these modifications is shown below. Then all you need to do is add the required statements in preMain to name the labels, color the plots etc.
                      Alex

                      Comment


                      • #12
                        Alex,

                        Could you please post your efs for that plot? I made the changes to Chris's EFS as you suggested, but am not clear on how to use the returned "new array".

                        Thnx.

                        JOHN

                        Comment


                        • #13
                          John
                          Attached is the revised version of Chris' code
                          Alex
                          Attached Files

                          Comment


                          • #14
                            Alex,

                            There must be some line missing or something. That efs does not plot any lines (as shown on your chart posted below). When I load that into my eSignal, it doesn't draw any lines.

                            What am I missing?

                            JOHN

                            Comment


                            • #15
                              I am wondering if there is something wrong with the dsUtilities, perhaps, since, now that I downloaded the latest ones, my old script does not even work any more.

                              Any suggestions?

                              JOHN

                              Comment

                              Working...
                              X