PureBytes Links
Trading Reference Links
|
Question back: is it enough to require that the cum value equals 150 or
wouldn´t it be correct to require that the cum value of condition 1 (here:
150) is larger than the one of condition two?
Let me give an example:
x=llv(low,5)
condition 1=valuewhen(x,cum(1),1);
y=hhv(high,5)
condition 2=valuewhen(y,cum(1),1);
Now, I want to find the high of condition 2 that occured right before the
low of condition 1. Thus, cum(1) of condition 2 is less than that of
condition 1.
One more specification is necessary, and this is where my problem kicks in:
I have to find the first instance where y applies AND where its cum value is
smaller than that of condition 1.
Are you lost?
most of the time :)
I think I understand what you are trying to do now. first you only need the
cum(1) of the lows. from there we can calculate the hhv at that point to
give you the previous high. Plot this code and you will see where the high
and low values line up. I used 15 days as an example because it lined up
perfectly on the chart. I find plotting it makes it easier to step
through.....
x=LLV(Low,15);
y=HHV(High,15);
condition1=ValueWhen(L==x,Cum(1),1);
condition2=ValueWhen(H==y,Cum(1),1);
test=ValueWhen(Cum(1)==condition1,y,1);
Plot(x,"lows",colorWhite,1);
Plot(y,"highs",colorRed,1);
Plot(test,"test",colorBlue,4);
are we having fun yet??
jayson
Markus
----- Original Message -----
From: Jayson
To: amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, October 29, 2002 6:34 PM
Subject: RE: [amibroker] Where´s the flaw?
Marcus,
this is an exploration?? try.......
filter=cum(1)>150;
valuewhen(condition2,low,1)
or alternatively
valuewhen(cum(1)>150 and condition2,low,1)
Jayson
-----Original Message-----
From: funnybiz@xxxx [mailto:funnybiz@x...]
Sent: Tuesday, October 29, 2002 12:07 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Where´s the flaw?
Folks,
I´m trying to tell AB that one condition show come before another. My
criteria of defining "b3fore" is the cum value of thope two conditions of
which the first one has -let´s say- a cum value 0f 150.
This doens´t work, and I don´t know why:
Valuewhen(iif(condition2,cum(1),0)<150,low,1)
I´m trying to determine the low for the day on which condition two is
fulfilled which should show a cum value <150 AT THE FIRST instance since
condition 2 might ocur several times with a cum value smaller than 150!
Any ideas why it soesn´t wanna work????
Appreciate it!
Markus
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
------=_NextPart_001_02B9_01C27FAB.F7469B50
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D"MSHTML 5.00.3315.2870" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D881170805-30102002>Markus,</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Question back: is it enough to require tha=
t the cum=20
value equals 150 or wouldn=B4t it be correct to require that the cum value=
=20
<STRONG>of condition 1</STRONG> (here: 150) is larger than the one of condi=
tion=20
two?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Let me give an example:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>x=3Dllv(low,5)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>condition 1=3Dvaluewhen(x,cum(1),1);</FONT=
></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>y=3Dhhv(high,5)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>condition 2=3Dvaluewhen(y,cum(1),1);</FONT=
></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Now, I want to find the high of condition =
2 that=20
occured right before the low of condition 1. Thus, cum(1) of condition 2 is=
less=20
than that of condition 1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>One more specification is necessary, and t=
his is=20
where my problem kicks in: I have to find the first instance where y applie=
s AND=20
where its cum value is smaller than that of condition 1.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DArial>Are you lost?<FONT color=3D#0000ff><=
SPAN=20
class=3D881170805-30102002> </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20
class=3D881170805-30102002></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20
class=3D881170805-30102002>most of the time :)</SPAN></FONT></FONT></FONT><=
/DIV>
<DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20
class=3D881170805-30102002></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20
class=3D881170805-30102002>I think I understand what you are trying=20
to do now. first you only need the cum(1) of the lows. from there=
we=20
can calculate the hhv at that point to give you the previous high. Plot thi=
s=20
code and you will see where the high and low values line up. I used 15 days=
as=20
an example because it lined up perfectly on the chart. I find plotting it m=
akes=20
it easier to step through.....</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DArial><FONT color=3D#0000ff><SPAN=20
class=3D881170805-30102002></SPAN></FONT></FONT></FONT> </DIV><SPAN=20
class=3D881170805-30102002><FONT face=3DArial><FONT color=3D#0000ff><FONT s=
ize=3D2>
<P>x=3DLLV(<B>Low</B>,15</FONT></FONT><FONT face=3DArial=20
size=3D2>);</FONT></FONT></P><FONT size=3D2><FONT color=3D#0000ff><FONT fac=
e=3DArial>
<P>y=3DHHV(<B>High</B></FONT></FONT><FONT face=3DArial><FONT=20
size=3D2>,15</FONT></FONT><FONT face=3DArial size=3D2>);</FONT></FONT></P><=
FONT=20
size=3D2><FONT color=3D#0000ff><FONT face=3DArial>
<P>condition1=3DValueWhen(<B>L</B></FONT></FONT><FONT face=3DArial><FONT=20
size=3D2>=3D=3Dx,Cum(1),1</FONT></FONT><FONT face=3DArial=20
size=3D2>);</FONT></FONT></P><FONT size=3D2><FONT color=3D#0000ff><FONT fac=
e=3DArial>
<P>condition2=3DValueWhen(<B>H</B></FONT></FONT><FONT face=3DArial><FONT=20
size=3D2>=3D=3Dy,Cum(1),1</FONT></FONT><FONT face=3DArial size=3D2>);</FONT=
></FONT></P>
<P></P><FONT face=3DArial><FONT color=3D#0000ff size=3D2>
<P>test=3DValueWhen(Cum(1)=3D=3Dcondition1,y,1);</P></FONT></FONT><FONT siz=
e=3D2><FONT=20
color=3D#0000ff><FONT face=3DArial>
<P>Plot(x,"lows",<B>colorWhite</B></FONT></FONT><FONT face=3DArial><FONT=20
size=3D2>,1);</P></FONT></FONT><FONT size=3D2></FONT><FONT color=3D#0000ff>=
<FONT=20
face=3DArial>
<P>Plot(y,"highs",<B>colorRed</B></FONT></FONT><FONT face=3DArial><FONT=20
size=3D2>,1); </P></FONT></FONT><FONT size=3D2></FONT><FONT color=3D#0000ff=
><FONT=20
face=3DArial>
<P>Plot(test,"test",<B>colorBlue</B></FONT></FONT><FONT size=3D2><FONT=20
face=3DArial>,4);<SPAN=20
class=3D881170805-30102002> </SPAN></FONT></FONT></FONT></P>
<P><FONT face=3DArial><FONT color=3D#0000ff size=3D2><SPAN=20
class=3D881170805-30102002><IMG align=3Dbaseline alt=3D"" border=3D0 hspace=
=3D0=20
src=3D"cid:881170805@xxxx"> </SPAN></FONT></P>
<DIV><FONT color=3D#0000ff size=3D2> are we having fun yet??</FONT></D=
IV>
<DIV> </DIV>
<DIV></FONT></SPAN><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D881170805-30102002>jayson</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Markus</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0p=
x; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>Fro=
m:</B>=20
<A href=3D"mailto:jcasavant@xxxx"=20
title=3Djcasavant@xxxx>Jayson</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
href=3D"mailto:amibroker@xxxxxxxxxxxxxxx"=20
title=3Damibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, October 29, 2002 6:=
34=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> RE: [amibroker] Where=B4s=
the=20
flaw?</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial size=3D2></FON=
T><FONT=20
face=3DArial size=3D2></FONT><FONT face=3DArial size=3D2></FONT><FONT fac=
e=3DArial=20
size=3D2></FONT><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
size=3D2></FONT><FONT face=3DArial size=3D2></FONT><BR></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002>Marcus,</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN class=3D010122817-=
29102002>this=20
is an exploration?? try.......</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002>filter=3Dcum(1)>150;</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002>valuewhen(condition2,low,1)</SPAN></FONT></DIV=
>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN class=3D010122817-=
29102002>or=20
alternatively</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D010122817-29102002>valuewhen(cum(1)>150 and=20
condition2,low,1)</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<P><FONT color=3D#0000ff face=3D"Palace Script MT" size=3D6><STRONG>Jayso=
n=20
</STRONG></FONT></P>
<DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT face=3DTah=
oma=20
size=3D2>-----Original Message-----<BR><B>From:</B> <A=20
href=3D"mailto:funnybiz@xxxx">funnybiz@xxxx</A>=20
[mailto:funnybiz@x...]<BR><B>Sent:</B> Tuesday, October 29, 2002 12:07=
=20
PM<BR><B>To:</B> <A=20
href=3D"mailto:amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx</A><B=
R><B>Subject:</B>=20
[amibroker] Where=B4s the flaw?<BR><BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Folks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I=B4m trying to tell AB that one conditi=
on show=20
come before another. My criteria of defining "b3fore" is the cum value of=
=20
thope two conditions of which the first one has -let=B4s say- a cum value=
0f=20
150.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This doens=B4t work, and I don=B4t know=
=20
why:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>Valuewhen(iif(condition2,cum(1),0)<150,low,1)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I=B4m trying to determine the low for th=
e day on=20
which condition two is fulfilled which should show a cum value <150 AT=
THE=20
FIRST instance since condition 2 might ocur several times with a cum valu=
e=20
smaller than 150!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Any ideas why it soesn=B4t wanna=20
work????</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Appreciate it!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Markus</FONT></DIV><BR><BR><TT>Post=20
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx <BR>(Web page=
: <A=20
href=3D"http://groups.yahoo.com/group/amiquote/messages/)">http://groups.=
yahoo.com/group/amiquote/messages/)</A><BR><BR>Check=20
group FAQ at: <A=20
href=3D"http://groups.yahoo.com/group/amibroker/files/groupfaq.html">http=
://groups.yahoo.com/group/amibroker/files/groupfaq.html</A></TT>=20
<BR><BR><TT>Your use of Yahoo! Groups is subject to the <A=20
href=3D"http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</=
TT>=20
<BR><BR><BR><TT>Post AmiQuote-related messages ONLY to:=20
amiquote@xxxxxxxxxxxxxxx <BR>(Web page: <A=20
href=3D"http://groups.yahoo.com/group/amiquote/messages/)">http://groups.=
yahoo.com/group/amiquote/messages/)</A><BR><BR>Check=20
group FAQ at: <A=20
href=3D"http://groups.yahoo.com/group/amibroker/files/groupfaq.html">http=
://groups.yahoo.com/group/amibroker/files/groupfaq.html</A></TT>=20
<BR><BR><TT>Your use of Yahoo! Groups is subject to the <A=20
href=3D"http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</=
TT>=20
<BR></BLOCKQUOTE><BR><BR><TT>Post=20
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx <BR>(Web page: =
<A=20
href=3D"http://groups.yahoo.com/group/amiquote/messages/)">http://groups.ya=
hoo.com/group/amiquote/messages/)</A><BR><BR>Check=20
group FAQ at: <A=20
href=3D"http://groups.yahoo.com/group/amibroker/files/groupfaq.html">http:/=
/groups.yahoo.com/group/amibroker/files/groupfaq.html</A></TT>=20
<BR><BR><TT>Your use of Yahoo! Groups is subject to the <A=20
href=3D"http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</TT=
>=20
<BR></BODY></HTML>
------=_NextPart_001_02B9_01C27FAB.F7469B50--
Attachment:
Description: ""
|