Announcement

Collapse
No announcement yet.

US Z4 problem

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

  • US Z4 problem

    This may be just sunday afternoon but could someone please check the following code on US Z4

    function preMain() {
    setPriceStudy(true);
    }

    function main() {
    debugPrintln(high()," ",low());
    return new Array(high(),low());
    }

    .. with setPriceStudy = true, the cursor window high/low values are the same as the return high/low but NOT the same as the debug window values.

    .. with setPriceStudy = false, the cursor window high/low values are NOT the same as the return high/low and NOT the same as the debug window values.
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk

  • #2
    Paul
    The returns are correct as far as I can see. If you plot the return as a price study then it gets formatted in 32nds whereas if you plot it as a non price study it gets formatted in decimals (to 2 decimals precision).
    In fact looking at the last bar 28 divided by 32 is equal to 0.875 and the return is 113.87 and 13/28 = 0.40625 and the return shows 112.4
    In the non price study change the return to
    return new Array (formatPriceNumber(high())*1, formatPriceNumber(low())*1);
    and you should get the same values as in the price study (albeit with an extra comma for the thousands).
    Alex

    Comment


    • #3
      thanks Alexis - a sunday afternoon problem.
      Paul Williams
      Strategy & Applications
      www.futurenets.co.uk

      Comment

      Working...
      X