[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Metastockusers] expression must contain only constant data



PureBytes Links

Trading Reference Links

Chris,

The problem is that the value of "-peakbars" varies bar-by-bar.
The Ref function wants a constant - i.e. a value that does not vary
bar-by-bar.

The best you can do is use the LastValue function which takes a variable and
returns a constant equal to the value of the variable at the
hard-right-edge.  i.e. it returns a constant that has a value that is the
same for all bars.  Unfortunately that value might not be the one that you
want depending on what you are trying to achieve.

So, try
Ref(H, LastValue(-peakbars1))
and see if that produces what you want.

Paul

----- Original Message ----- 
From: <chrismontgomery1966@xxxxxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: Sunday, 2 May 2004 9:46 AM
Subject: [Metastockusers] expression must contain only constant data


"This variable or expression must contain only constant data."
=============
peak1:= Peak(1,Fml("MACD Histogram"),5);
peak2 := Peak(2,Fml("MACD Histogram"),5);
peakbars1:=PeakBars(1,Fml("MACD Histogram"), 5);
peakbars2:=PeakBars(2,Fml("MACD Histogram"), 5);

Ref(H,- peakbars1 ) > Ref(H,-peakbars2)
AND peak2 > peak1
===============
I am trying to determine if there is a bearish divergence
between Price and an indicator.

Interpretes as follows: There are two peaks in the Histogram
the latest one is lower that the second ( prior ) one. While the
highest high price is higher than the prior one.

This is where the error occurs.
Ref(H,- peakbars1 ) wants a constant.

Any way around this limitation?

Also is it incorrect to try to use Peak and Trough functions as they
rely on the zigzag function?

Many thanks,
Chris
7.2EOD and 9EOD



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com.  Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/Metastockusers/

<*> To unsubscribe from this group, send an email to:
     Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/