Put a Param in Period and you'll see what happens
Louis ... Sometimes I am getting both lines but in most of the times not ... If
that's the problem. I just tested the code and did not get the second Plot. When
looking to the code it's array dependent. So the above result is normal for
me ...
Regards, Ton.
----- Original Message -----
Sent: Tuesday, July 22, 2008 2:02
PM
Subject: Re: [amibroker] Easy question
again
Here is the complete code so anyone can test it: Period = 30; LowestClose= Ref (LLV(C,
Period),-5); RSIatLowestClose =ValueWhen(C == LowestClose,
RSI(15)); CurCloseToPastClose = C /
LowestClose; CurRSI_To_RSIatLowestClose = RSI(15) /
RSIatLowestClose;
Plot(Curclosetopastclose, "\n"
+Curclosetopastclose+ " - curclosetopastclose",
colorBlue); Plot(CurRSI_To_RSIatLowestClose, "\n"
+CurRSI_To_RSIatLowestClose+ " - CurRSI_To_RSIatLowestClose",
colorRed);Louis
2008/7/22 Louis Préfontaine < rockprog80@xxxxxxcom>:
Euh...
sorry. I meant EMPTY, not zero. It seems like it does not return
a numeric value. Louis
2008/7/22 Louis Préfontaine < rockprog80@xxxxxxcom>:
Hi, I tried this: Instead of
LowestClose= LLV(C, Period) I wrote LowestClose= Ref
(LLV(C, Period),-5); but for some reason about one third of the
time the value of CurMFI_To_MFIatLowe stClose is zero and I can't draw
any line. Do you get the same results?
Thanks,
Louis
2008/7/21 Louis Préfontaine < rockprog80@xxxxxxcom>:
A last question: Would it be possible to get a past peak
that is not the exact LLV of today? Because today or yesterday
might be the LLV of the last 20 days. I'd like to set somehow a
buffer zone; e.g. I want to look for the LLV that is NOT in the last 5
days (it would exclude today, or yesterday and the days before).
That may be very useful. How would one do that? I tried
this: LowestClose= LLV(C, Period) AND NOT Ref (C,-1) AND NOT Ref
(C,-2) AND NOT Ref (C,-3) AND NOT Ref (C,-4); but it is a
failure... Thanks again! Louis
Thanks, it works well!
Louis
2008/7/21 Thomas Z. < tzg@xxxxxxxxxxxxxxx.com>:
Ah, yes, the following line should be changed: RSIatLowestClose
= ValueWhen(C == LowestClose, RSI(15));
Sent: Monday, July 21, 2008 11:51 PM
To: amibroker@xxxxxxxxxps.comSubject: Re:
[amibroker] Easy question again Thanks, I added the
two following plot to the formula: Period =
20; LowestClose= LLV(C, Period); RSIatLowestClose =
ValueWhen(LowestClo se, RSI(15));
CurCloseToPastClose = C
/ LowestClose; CurRSI_To_RSIatLowestClose = RSI(15) /
RSIatLowestClose;
Plot(Curclosetopastclose, "\n"
+Curclosetopastclose+ " - curclosetopastclose",
colorBlue); Plot(CurRSI_To_RSIatLowestClose, "\n"
+CurRSI_To_RSIatLowestClose+ "
- CurRSI_To_RSIatLowestClose",
colorRed);
Unfortunately the red line is always
1. I must have done
something wrong...
Thanks,
Louis
2008/7/21
Thomas Z. <tzg@xxxxxxxxxxxxxxx.com>: I guess it is
possible to get the price, simply by
writting ValueWhen(LowestClose, Close); right? Yes,
correct. You can also even get any other value.
There is an
additional optional parameter that allows to get the value of the
last n-th recent occurrence. Example: ValueWhen(LowestClose,
Close, 2);
Thomas www.PatternExplorer.com
From: amibroker@xxxxxxxxxps.com [mailto:amibroker@xxxxxxxxxps.com] On Behalf Of
Louis Préfontaine Sent: Monday, July 21, 2008 11:37 PM To: amibroker@xxxxxxxxxps.com Subject: Re:
[amibroker] Easy question again
Thanks a lot! That was
what I was looking for.
I guess it is possible to get the
price, simply by writting ValueWhen(LowestClose, Close);
right?
BTW, when and how do you use your
CurCloseToPastClose... Seems really interesting as a
concept.
Louis 2008/7/21 Thomas Z. <tzg@xxxxxxxxxxxxxxx.com>: Hello,
You
can do this with the following code:
Period =
20; LowestClose= LLV(C, Period); RSIatLowestClose =
ValueWhen(LowestClose, RSI());
CurCloseToPastClose = C /
LowestClose; CurRSI_To_RSIatLowestClose = RSI() /
RSIatLowestClose;
Thomas www.PatternExplorer.com
From: amibroker@xxxxxxxxxps.com [mailto:amibroker@xxxxxxxxxps.com] On Behalf Of
Louis Préfontaine Sent: Monday, July 21, 2008 11:02 PM To: amibroker@xxxxxxxxxps.com Subject:
[amibroker] Easy question again
Hi,
Another easy
question here. (I'm still juggling with the difficult
things and thanks again to the people who helped me; but why not
add this little twist while I'm here).
I'd like to use to
know how to use valuewhen to make it possible to know what was
the price at a particular time.
I had a look in the manual to
many files which unfortunately had zigzag functions in
them. This is not what I'm looking for.
What I'd
like to do is to compare the price right now to the LLV C of
the last X periods and to get the value of RSI of that LLV
C at that time to compare it with the RSI right
now.
Is this possible, without Zig
function?
Thanks,
Louis
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___
|