Announcement

Collapse
No announcement yet.

getValue bug?

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

  • #31
    futurenets
    You may want to watch the entire animation again
    Alex


    Originally posted by futurenets
    sorry Alex, noticed that you not using a 60min ES #F chart.

    can I ask if you could please try that.

    Comment


    • #32
      ok Alexis, I see you are using ES #F.

      at my end if I make those changes then the code never returns form init()

      thanks anyway
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment


      • #33
        Alexis

        just noticed you've loaded 600 bars on your chart

        which is the total bar requirement getValue use below

        aClose = getValue("close", 0, nLength, sSI);
        aClose = getValue("close", -nLength, nLength, sSI);

        is this the problem?
        Paul Williams
        Strategy & Applications
        www.futurenets.co.uk

        Comment


        • #34
          Hi Paul,

          I get -efs Passed- when I load 301 bars or more on a 60 min ES #F chart. Anything under 301 bars seems to stall processing and I get nothing drawn on the chart.

          Wayne

          Comment


          • #35
            ok thanks so it looks like we've at last found the problem.

            so my question is, when using getValue as follows:

            var nLength = 300
            var sSI = getSymbol() + ",60";
            aClose = getValue("close", 0, nLength, sSI);
            aClose = getValue("close", -nLength, nLength, sSI);

            and that we may be loading this efs 60min values on a 60min, 30min, 10min etc. chart

            how many bars does the current chart need for this to work?
            Paul Williams
            Strategy & Applications
            www.futurenets.co.uk

            Comment


            • #36
              As I understand it the syntax for getValue is:
              getValue( barType , barIndex [, numBars ][, Symbol ] )
              The barIndex is the starting point or array value of 0. The numBars if negative will load the array with values going back in time and if it is positive it will load the array with values starting with bar at barIndex and forward towards the current plotted bar.

              So aClose in the "0-testefs.efs" starts 300 bars back and loads forward towards the current bar on the chart.

              I would create a userdefined Time Template with interval = 60 and # Bars = 301 as shown in the attached picture. That way no matter which chart interval you use it will load the needed # of bars for the study.

              Wayne
              Attached Files

              Comment


              • #37
                ok Wayne yes I think that would work but the problem is when nLength is a user defined parameter.
                Paul Williams
                Strategy & Applications
                www.futurenets.co.uk

                Comment


                • #38
                  I don't know how to fix that other than with instructions for users because as far as I know you can't define Time Templates from within an efs.

                  Wayne

                  Comment


                  • #39
                    I think if this isn't regarded as a bug then we need eSignal instruction on how to use.
                    Paul Williams
                    Strategy & Applications
                    www.futurenets.co.uk

                    Comment


                    • #40
                      That would be a good suggestion to post in the eSignal Beta Testing forum for implementation into eSignal 11.

                      To have something within the code that alerts users of insufficient bars you could do a calculation based on the chart interval to identify how many bars need to be loaded and compare it to bars loaded on the chart. If there are insufficient bars an error message would display on the chart instructing the user to load more bars.

                      Wayne

                      Comment


                      • #41
                        to wrap this up ...

                        the length of the returned getValue array cannot exceed the number of bars on the chart.

                        e.g. if your efs code is using something like:

                        var nLength = 300
                        var sSI = getSymbol() + ",60";
                        aClose = getValue("close", 0, nLength, sSI);
                        aClose = getValue("close", -nLength, nLength, sSI);

                        and is running on a 30min chart with only 200 bars, then getValue will end prematurely and not complete the script unless nLength = 200.

                        to be safe, nLength = -getOldestBarIndex()+1;
                        Paul Williams
                        Strategy & Applications
                        www.futurenets.co.uk

                        Comment

                        Working...
                        X