Announcement

Collapse
No announcement yet.

getminute

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

  • getminute

    Why does the following efs return 59 for 12:00 and not 0? All the other minute return correctly.

    Best Regards,

    Alan

  • #2
    getminute

    This occurs when it is applied to a 30 tick chart and there is a 12:00:xx tick showing.

    alan

    Comment


    • #3
      Re: getminute

      Alan
      FYI there is no efs attached or enclosed to your post
      Alex


      Originally posted by Alan2004
      Why does the following efs return 59 for 12:00 and not 0? All the other minute return correctly.

      Best Regards,

      Alan

      Comment


      • #4
        var xMA1 = null;
        var xMA2 = null;
        var xMA3 = null;
        var xMA4 = null;
        var ctz = null;
        var bInit = false;
        var MA1 = null;
        var MA2 = null;
        var MA3 = null;
        var MA4 = null;

        var lastGetMinute = null;

        function preMain() {

        setPriceStudy(false);
        setStudyTitle(" CROSSOVER1MIN");
        setCursorLabelName("MA1", 0);
        setDefaultBarStyle(PS_SOLID, 0);
        setDefaultBarStyle(PS_SOLID, 1);
        setDefaultBarStyle(PS_SOLID, 2);
        setDefaultBarStyle(PS_SOLID, 3);
        setDefaultBarStyle(PS_SOLID, 4);
        setDefaultBarFgColor(Color.red, 0);
        setDefaultBarFgColor(Color.blue, 1);
        setDefaultBarFgColor(Color.black, 2);
        setDefaultBarFgColor(Color.black, 3);
        setDefaultBarFgColor(Color.black, 4);
        setDefaultBarThickness(1, 0);
        setDefaultBarThickness(1, 1);
        setDefaultBarThickness(4, 2);
        setDefaultBarThickness(1, 3);
        setDefaultBarThickness(1, 4);
        setPlotType(PLOTTYPE_LINE, 0);
        setPlotType(PLOTTYPE_LINE, 1);
        setPlotType(PLOTTYPE_LINE, 2);
        setPlotType(PLOTTYPE_LINE, 3);
        setPlotType(PLOTTYPE_LINE, 4);

        Symbol1 = getSymbol();
        Interval1 = "1";
        }

        function main() {

        ww = -1;
        pp = 0;

        // Capture The Bar Time

        if (getMinute() != lastGetMinute) {

        yfk1zz = getMinute();

        }



        return new Array (ww, pp, yfk1zz);
        }

        Comment


        • #5
          Alan
          In your condition you should evaluate the value ie getMinute(0) rather than the series object ie getMinute() as the latter resolves the 0 to null with the result that the condition evaluates to false on the bars with 00 minutes
          Once you make this change the script will return the proper values also on those bars
          Alex


          Originally posted by Alan2004
          var xMA1 = null;
          var xMA2 = null;
          var xMA3 = null;
          var xMA4 = null;
          var ctz = null;
          var bInit = false;
          var MA1 = null;
          var MA2 = null;
          var MA3 = null;
          var MA4 = null;

          var lastGetMinute = null;

          function preMain() {

          setPriceStudy(false);
          setStudyTitle(" CROSSOVER1MIN");
          setCursorLabelName("MA1", 0);
          setDefaultBarStyle(PS_SOLID, 0);
          setDefaultBarStyle(PS_SOLID, 1);
          setDefaultBarStyle(PS_SOLID, 2);
          setDefaultBarStyle(PS_SOLID, 3);
          setDefaultBarStyle(PS_SOLID, 4);
          setDefaultBarFgColor(Color.red, 0);
          setDefaultBarFgColor(Color.blue, 1);
          setDefaultBarFgColor(Color.black, 2);
          setDefaultBarFgColor(Color.black, 3);
          setDefaultBarFgColor(Color.black, 4);
          setDefaultBarThickness(1, 0);
          setDefaultBarThickness(1, 1);
          setDefaultBarThickness(4, 2);
          setDefaultBarThickness(1, 3);
          setDefaultBarThickness(1, 4);
          setPlotType(PLOTTYPE_LINE, 0);
          setPlotType(PLOTTYPE_LINE, 1);
          setPlotType(PLOTTYPE_LINE, 2);
          setPlotType(PLOTTYPE_LINE, 3);
          setPlotType(PLOTTYPE_LINE, 4);

          Symbol1 = getSymbol();
          Interval1 = "1";
          }

          function main() {

          ww = -1;
          pp = 0;

          // Capture The Bar Time

          if (getMinute() != lastGetMinute) {

          yfk1zz = getMinute();

          }



          return new Array (ww, pp, yfk1zz);
          }

          Comment

          Working...
          X