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

RE: [amibroker] How do I subtract the difference between two horizontal study lines? (in AFL)



PureBytes Links

Trading Reference Links










<span
>Gurus, Jason & Tomasz,

<span
>My result of Tomasz&#8216;s
example code (shown below) with horizontal study lines labeled &#8220;re&#8221;
and &#8220;su&#8221; is as follows:

<span
> 

<span
 >{EMPTY}<font
color=black>

<span
 >{EMPTY}<font
color=black>

<span
 >{EMPTY}<font
color=black>

<span
> 

<span
>Please advise,

<span
>Bruce

<span
>-----Original Message-----
From: Tomasz Janeczko
[mailto:amibroker@xxxxxx] 
Sent<span
>: <st1:date Month="10"
Day="14" Year="2003">Tuesday, October 14, 2003<font
size=2 face=Tahoma> <st1:time
Hour="14" Minute="27">2:27 PM<span
>
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] <span
class=GramE>How do I subtract the difference between two horizontal
study lines? (in AFL)

<span
> 



<span
>Bruce,





<span
> 





<span
>Please use this code:





<span
> 





<font
size=1 color=black face="Courier New">x=<font size=1 color=blue
face="Courier New">ValueWhen<span
>(NOT IsNull( <font
size=1 color=blue face="Courier New">Study<font size=1 color=black
face="Courier New">(<span
>"re"<font
size=1 color=black face="Courier New">)),<font size=1 color=blue
face="Courier New">Study<span
>(<font
size=1 color=fuchsia face="Courier New">"re"<font
size=1 color=black face="Courier New">));

<font
size=1 color=black face="Courier New">y=<font size=1 color=blue
face="Courier New">ValueWhen<span
>(NOT IsNull( <font
size=1 color=blue face="Courier New">Study<font size=1 color=black
face="Courier New">(<span
>"su"<font
size=1 color=black face="Courier New">)),<font size=1 color=blue
face="Courier New">Study<span
>(<font
size=1 color=fuchsia face="Courier New">"su"<font
size=1 color=black face="Courier New">));

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(x);

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(y);

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(x-y);

<font
size=3 face="Times New Roman"> <font
size=1 color=black face="Courier New">





<span
>Hope this helps.





<span
> 





<span
>Best regards,
Tomasz Janeczko
amibroker.com







<span
>----- Original Message ----- 





<font size=2
face=Arial>From:<font
size=2 face=Arial> <a
href="" title="bdnutter@xxxxxxxxxxx">Bruce Nutter






<span
>To:<font
size=2 face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
size=2 face=Arial> <st1:date
Month="10" Day="14" Year="2003">Tuesday, October 14, 2003<font
size=2 face=Arial> <st1:time
Hour="22" Minute="9">10:09 PM<span
>





<span
>Subject:<font
size=2 face=Arial> RE:
[amibroker] How do I subtract the difference between two horizontal study
lines? (in AFL)





<span
> 



<font
size=1 color=black face="Courier New">Gurus and Jayson

<font
size=1 color=black face="Courier New">I tried this code so I could see the difference
between the two horizontal lines. But the results I get in the interpretation
window is shown below. Could some guru please tell me why this does not work.
(For those of you who might ask yes the labels of my horizontal study lines are
&#8220;re&#8221; and &#8220;su&#8221;)

<b
><span
>Formula code:

<font
size=1 color=black face="Courier New">x=<font size=1 color=blue
face="Courier New">LastValue<span
>(<font
size=1 color=blue face="Courier New">Study<font size=1 color=black
face="Courier New">(<span
>"re"<font
size=1 color=black face="Courier New">));

<font
size=1 color=black face="Courier New">y=<font size=1 color=blue
face="Courier New">LastValue<span
>(<font
size=1 color=blue face="Courier New">Study<font size=1 color=black
face="Courier New">(<span
>"su"<font
size=1 color=black face="Courier New">));

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(x);

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(y);

<font
size=1 color=blue face="Courier New">WriteVal<font size=1 color=black
face="Courier New">(x-y);

<b
><span
>Interpretation window
result:

<font
size=1 color=black face="Courier New">0

<font
size=1 color=black face="Courier New">0

<font
size=1 color=black face="Courier New">0

<font
size=1 color=black face="Courier New"> 

<font
size=1 color=black face="Courier New"> 

<font size=3 color=black
face="Times New Roman">Bruce

<font size=3 color=black
face="Times New Roman"> 

<span
>-----Original Message-----
From: Jayson [mailto:jcasavant@xxxxxxxxxxx]

Sent: <st1:date
Month="10" Day="14" Year="2003"><span
 >Tuesday, October 14, 2003<font
size=2 face=Tahoma> <st1:time
Hour="9" Minute="49">9:49 AM<span
>
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] How do I
subtract the difference between two horizontal study lines? (in AFL)

<span
> 



<font size=2 color=blue
face=Arial>Brian,





<font size=2 color=blue
face=Arial>have a
look in the help files for Study(). You can name your trend line than call its
value in a code.





<span
> 





<font size=2 color=blue
face=Arial>for
instance in this exploration I have named 2 study lines and called the last
value of each and subtracted one from the other....





<span
> 





<span
> 





<font size=2 color=blue
face=Arial>Filter=C>0;<font
size=2 color="#282828">





<font size=2 color=blue
face=Arial>x=<font
size=2 color=blue>LastValue(Study("s1"))<font
size=2 color=blue face=Arial>;<span
>





<font size=2 color=blue
face=Arial>y=<font
size=2 color=blue>LastValue(Study("s<font
size=2 color=blue face=Arial>2")<span
>);<font
size=2 color="#282828" face=Arial>





<font size=2 color=blue
face=Arial>AddColumn<font
size=2 color="#282828" face=Arial>(x,<span
>""<font
size=2 color="#282828" face=Arial>);<span
>





<font size=2 color=blue
face=Arial>AddColumn<font
size=2 color="#282828" face=Arial>(y,<span
>""<font
size=2 color="#282828" face=Arial>);





<font size=2 color=blue
face=Arial>AddColumn<font
size=2 color="#282828" face=Arial>(x-y,<span
>""<font
size=2 color="#282828" face=Arial>);





<span
> 





<span
> 





<font size=2 color=blue
face=Arial>Regards, 





<font size=2 color=blue
face=Arial>Jayson




-----Original Message-----
From: Bruce Nutter
[mailto:bdnutter@xxxxxxxxxxx]
Sent: <st1:date
Month="10" Day="14" Year="2003"><span
 >Tuesday, October 14, 2003<font
size=2 face=Tahoma> <st1:time
Hour="12" Minute="26">12:26 PM<span
>
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] How do I
subtract the difference between two horizontal study lines? (in AFL)

<font size=3 color=black
face="Times New Roman">Gurus,

<font size=3 color=black
face="Times New Roman">Does anybody
know how to subtract between two horizontal study lines in AFL code? I have to
study lines that I move around to calculate entry and exit points. What I'd
like to do is to show that vertical distance between these two horizontal lines
in the interpretation window. Would one of you gurus please let me know how to
do this?

<font size=3 color=black
face="Times New Roman">Bruce

<span
>
Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<font size=2
face="Courier New">
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Your use of
Yahoo! Groups is subject to the Yahoo!
Terms of Service. 




<span
>Send BUG REPORTS to bugs@xxxxxxxxxxxxx<font
size=2 face="Courier New">
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Your use of
Yahoo! Groups is subject to the Yahoo!
Terms of Service. 

<span
> 

<span
>

Send
BUG REPORTS to bugs@xxxxxxxxxxxxx<font size=2
face="Courier New">
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Your use of
Yahoo! Groups is subject to the Yahoo!
Terms of Service. 



<span
>



<font size=2
face="Courier New">Send BUG REPORTS to
bugs@xxxxxxxxxxxxx<span
>
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx 
(Web page: <a
href="">http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: <a
href="">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












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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.