Announcement

Collapse
No announcement yet.

thermometer

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

  • #16
    Graham
    I don't know what to tell you. I have it working here on two completely different setups and I know for a fact it is working on a number of other machines.
    Jason may be able to shed some light on why it is not working on yours.
    Alex

    Comment


    • #17
      Graham

      Graham,

      Try changing your "time template"

      John

      Comment


      • #18
        Hello Graham,

        The first thing we should test is the execution of the formula. In the code below you will notice a debugPrintln("hello") statement just above line 49, which reads: if (1==1){. Open your formula in an EFS Editor (Tools --> EFS --> Editor), add the debugPrintln("hello") statement, and save the file. Next, open up the formula output window (Tools --> EFS --> Formula Output Window) and then run your formula on an advanced chart. What this is going to tells us is whether or not the calls to "getTodayOHLC1.efs" is returning a valid result. If it is, you should see a bunch of lines of "hello" in the output window. If not, then there is a problem with the call to "getTodayOHLC1.efs." Go through this little routine and let us know what you see in the formula output window.

        PHP Code:
        /********************************
        Alexis C. Montenegro © May 2003  
        *********************************/

        /*****************************************************************************
        WARNING: This EFS requires getTodayOHLC1.efs in the OHLC subfolder of Formulas
                 If you do not have it you can find a copy at the following link      
                 [url]http://share.esignal.com/groupcontents.jsp?folder=Formulas&groupid=10[/url]
        ******************************************************************************/

        function preMain() {
            
        setPriceStudy(true);
            
        setStudyTitle("Thermometer");
            
        setShowCursorLabel(false);
        }

        var 
        HH null;
        var 
        LL null;
        var 
        CC null;
        var 
        day1 null;
        var 
        day0 null;

        function 
        main() {

            if (
        getBarState() == BARSTATE_NEWBAR) {
                
        day1 day0;    
            }
            
        day0 getDay();
            
            if (
        day0 != day1) {
                
        HH null;
                
        LL null;
                
        CC null;
            }
            
            if (
        HH == null || high() >= HH) {
                
        HH callFunction("/OHLC/getTodayOHLC1.efs","main","High");
                if (
        HH == null) return;
            }
            if (
        LL == null || low() <= LL) {
                
        LL callFunction("/OHLC/getTodayOHLC1.efs","main","Low");
                if (
        LL == null) return;
            }
            if (
        CC == null) {
                
        CC callFunction("/OHLC/getTodayOHLC1.efs","main","Open");
                if (
        CC == null) return;
            }
            
        debugPrintln("hello");
            if (
        1==1){
            
        drawLineRelative(5,close(),5,HH,PS_SOLID,5,Color.red,1);
            
        drawLineRelative(5,close(),5,LL,PS_SOLID,5,Color.lime,2);
            
        drawShapeRelative(4,CC,Shape.RIGHTTRIANGLE,null,Color.blue,null,3)
            }
          
            return 
        null;

        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


        • #19
          11thermocc.efs

          D.Loomis,

          Thanks so much for sharing your percentage thermometer EFS. I don't know how you guys write such complex code. Not only is it brilliant, but more importantly, I think it's going to be very useful to me.

          A couple of minor bugs-

          For some reason a 150tick chart only goes to 33%....149t is fine, 151t is fine as are other tick intervals, it seems to just be the 150t. It's not a big deal, though I do like to use a 150t(of course, lol). Also, I noticed that there is no text for this EFS in the reload, remove, and edit windows, just a blank space. Again, not a big deal, but I thought you might want to know.

          This is a great EFS!

          Thanks again!
          Steve

          Comment


          • #20
            I just checked the 150t chart on the es #f and it worked ok, see pic below.

            You did realize the first bar wont get to 100% because the efs satrts at 0 and the first bar might have already had a few ticks on it. The TIB counter can not be read by an efs, so I have to count them by hand in the efs and reset the count to 0 when a new bar starts.

            Thanks for the feedback.
            Attached Files

            Comment


            • #21
              Hey D.Loomis,

              Yes, The ES #F is fine, It just seems to be the NQ #F (kinda weird), oh well. Thanks again,

              Steve
              Attached Files

              Comment


              • #22
                hmm, strange. Works here.
                Attached Files

                Comment


                • #23
                  Jason,
                  here is an attempt to put the image on this forum.
                  if i dont get it right i'll come back and type in the formula output window,

                  Thanks
                  Graham

                  Comment


                  • #24
                    sorry bout that jason,


                    the message is :

                    OHLC\thermometer test.efs, line 27 : cannot find formula: /OHLC/getTodayOHLC1.efs


                    Also to DLoomis i am glad my formula is working properly that you sent me - i appreciate it very much,
                    Thanks
                    Graham

                    Comment


                    • #25
                      Termometer

                      I get the same error message, Line 37 can not find formula/OHLC/get TODAY OHLC1.efs

                      Comment


                      • #26
                        Graham and gooch2200
                        Can you please do the following.
                        Using the Editor go to the OHLC subfolder of the Formulas folder and open the getTodayOHLC1.efs
                        Then copy the contents and paste them in a message to this thread.
                        Alex

                        Comment


                        • #27
                          Hello Graham and gooch2200,

                          Also, check to make sure your Formula Root is set to the Formulas folder of your active eSignal folder.
                          Go to Tools --> EFS --> Settings.
                          It should look something like this.



                          If your formula root is set correctly, then you're copy of getTodayOHLC1.efs
                          just needs to be moved to the \eSignal\Formulas\OHLC\ folder.
                          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


                          • #28
                            Originally posted by Alexis C. Montenegro
                            Graham and gooch2200
                            Can you please do the following.
                            Using the Editor go to the OHLC subfolder of the Formulas folder and open the getTodayOHLC1.efs
                            Then copy the contents and paste them in a message to this thread.
                            Alex
                            I'm sorry, but I am still very new to this program. I was able to open the formula, but I don't know how to copy it.

                            I also checked the EFS settings and they are correct. I'm still getting the same syntax error message.

                            Al (gooch2200)

                            Comment


                            • #29
                              gooch2200
                              No problem, here is what you do.
                              Once you have opened the efs with the Editor put the cursor at the beginning of Line 1. Then hit <Shift>+<Ctrl>+<End> keys. This will highlight all of the script. Click the Copy icon then Paste the contents in a message to this thread.
                              Alex
                              Last edited by ACM; 09-28-2003, 05:56 AM.

                              Comment


                              • #30
                                Thanks for your help and patience. I have pasted the formula below.

                                I am also getting error message. Formula Output box
                                OHLC\thermometer.efs, line 37 can not find formula: /OHLC/getTodayOHLC.efs

                                /************************************************** **************************************************
                                Copyright © eSignal, a division of Interactive Data Corporation. 2002. All rights reserved.
                                This sample eSignal Formula Script (EFS) may be modified and saved under a new
                                filename; however, eSignal is no longer responsible for the functionality once modified.
                                eSignal reserves the right to modify and overwrite this EFS file with each new release.
                                ************************************************** ************************************************** */
                                function preMain() {
                                }


                                /*
                                * This is a neat formula because it is working on multiple intervals
                                * sBarItem will be "Open", "High", "Close", or "Low"
                                *
                                */

                                var vLastRawTime = null;
                                var vLastValue = null;
                                var vSymbol;
                                var vInterval;

                                function main(sBarItem) {
                                if(sBarItem == null) {
                                return;
                                }

                                var vBar;
                                var vBarTime;
                                var vAbsTime;
                                var vIndex;


                                var nState = getBarState();
                                if(nState == BARSTATE_ALLBARS) {
                                vLastRawTime = null;
                                vLastValue = null;
                                vSymbol = getSymbol();
                                vInterval = getInterval();
                                vSymbol += ",D";

                                }

                                if(vInterval == null)
                                return;

                                /*
                                * No need to show the OHL or C on a daily chart.
                                * only interested in seeing OHLorC on intraday.
                                */
                                if(vInterval == "D" || vInterval == "W" || vInterval == "M")
                                return;


                                vRawTime = getValue("rawtime");
                                if(vRawTime == null)
                                return;

                                vRawTime = Math.floor(vRawTime / RawTime.DAY);

                                // Start of Performance addition
                                if(vLastRawTime != null) {
                                if(vRawTime == vLastRawTime) {
                                return vLastValue;
                                }
                                }


                                /*
                                * What time is the current bar?
                                */
                                vBarTime = getValue("time");

                                if(vBarTime != null) {
                                /*
                                * Get index to first bar of day. In this case the daily bar.
                                */
                                vIndex = getFirstBarIndexOfDay(vBarTime, vSymbol);
                                if(vIndex != null) {
                                vBar = getValueAbsolute(sBarItem, vIndex, vSymbol);
                                vLastRawTime = vRawTime;
                                vLastValue = vBar;
                                return vBar;
                                }
                                }
                                return;

                                }














                                /************************************************** **************************************************
                                Copyright © eSignal, a division of Interactive Data Corporation. 2002. All rights reserved.
                                This sample eSignal Formula Script (EFS) may be modified and saved under a new
                                filename; however, eSignal is no longer responsible for the functionality once modified.
                                eSignal reserves the right to modify and overwrite this EFS file with each new release.
                                ************************************************** ************************************************** */
                                function preMain() {
                                }


                                /*
                                * This is a neat formula because it is working on multiple intervals
                                * sBarItem will be "Open", "High", "Close", or "Low"
                                *
                                */

                                var vLastRawTime = null;
                                var vLastValue = null;
                                var vSymbol;
                                var vInterval;

                                function main(sBarItem) {
                                if(sBarItem == null) {
                                return;
                                }

                                var vBar;
                                var vBarTime;
                                var vAbsTime;
                                var vIndex;


                                var nState = getBarState();
                                if(nState == BARSTATE_ALLBARS) {
                                vLastRawTime = null;
                                vLastValue = null;
                                vSymbol = getSymbol();
                                vInterval = getInterval();
                                vSymbol += ",D";

                                }

                                if(vInterval == null)
                                return;

                                /*
                                * No need to show the OHL or C on a daily chart.
                                * only interested in seeing OHLorC on intraday.
                                */
                                if(vInterval == "D" || vInterval == "W" || vInterval == "M")
                                return;


                                vRawTime = getValue("rawtime");
                                if(vRawTime == null)
                                return;

                                vRawTime = Math.floor(vRawTime / RawTime.DAY);

                                // Start of Performance addition
                                if(vLastRawTime != null) {
                                if(vRawTime == vLastRawTime) {
                                return vLastValue;
                                }
                                }


                                /*
                                * What time is the current bar?
                                */
                                vBarTime = getValue("time");

                                if(vBarTime != null) {
                                /*
                                * Get index to first bar of day. In this case the daily bar.
                                */
                                vIndex = getFirstBarIndexOfDay(vBarTime, vSymbol);
                                if(vIndex != null) {
                                vBar = getValueAbsolute(sBarItem, vIndex, vSymbol);
                                vLastRawTime = vRawTime;
                                vLastValue = vBar;
                                return vBar;
                                }
                                }
                                return;

                                }

                                Comment

                                Working...
                                X