PureBytes Links
Trading Reference Links
|
<SPAN
class=088301917-18022003>Tomasz,
A nice
implementation that you might want to add to the on line help section??????
Useful in the AMA and RSI section
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: Tomasz Janeczko
[mailto:amibroker@xxxxxx]Sent: Tuesday, February 18, 2003 12:13
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker]
Need Help (Tomasz)
Jim,
Yes because it is last value. Built-in RSI accepts contant
period only.
If you want dynamic you have to implement it
using AMA
t = 14<FONT
face="Courier New" size=2>; /// THIS CAN BE VARIABLE
mo = C-<FONT color=#0000ff face="Courier New"
size=2>Ref(C,-<FONT
color=#ff00ff face="Courier New" size=2>1<FONT face="Courier New"
size=2>);Up = <FONT color=#0000ff face="Courier New"
size=2>IIf( mo><FONT
color=#ff00ff face="Courier New" size=2>0<FONT face="Courier New"
size=2>, mo, 0<FONT
face="Courier New" size=2>); Dn = <FONT color=#0000ff face="Courier New"
size=2>IIf( mo<<FONT
color=#ff00ff face="Courier New" size=2>0<FONT face="Courier New"
size=2>, -mo, 0<FONT
face="Courier New" size=2>);Ut = <FONT color=#0000ff
face="Courier New" size=2>AMA<FONT face="Courier New"
size=2>(Up,1<FONT
face="Courier New" size=2>/t); Dt = <FONT color=#0000ff
face="Courier New" size=2>AMA<FONT face="Courier New"
size=2>(Dn,1<FONT
face="Courier New" size=2>/t);
RSIt=100<FONT
face="Courier New" size=2>*(Ut/(Ut+Dt));
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Jim Hutchison
To: <A
href=""
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, February 18, 2003 5:56
PM
Subject: RE: [amibroker] Need Help
(Tomasz)
<SPAN
>When run Explore I
get the attached results after I added LastValue
() to my
formula. RS is always 7
regardless if Trend is 1 or 2 or 3.
<SPAN
>
<SPAN
>Thank
You
<SPAN
>Jim
Hutchison
<SPAN
>
<SPAN
>-----Original
Message-----From: Tomasz
Janeczko [mailto:amibroker@xxxxxx] <SPAN
>Sent: <st1:date Month="2"
Day="18" Year="2003"><SPAN
>Tuesday, February 18,
2003<SPAN
> <st1:time
Hour="11" Minute="15"><SPAN
>11:15
AM<SPAN
><SPAN
>To: <A
href="">amibroker@xxxxxxxxxxxxxxx<SPAN
>Subject: Re: [amibroker] Need
Help
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=2>Jim,
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=2>IIF always returns array while RS accepts
only number. To convert use LastValue:
<FONT face="Times New Roman"
size=3>
<FONT color=black
face="Courier New" size=1><SPAN
>RS= LastValue
( <SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>7<FONT
color=black face="Courier New" size=1><SPAN
>,
<SPAN
>4<FONT
color=black face="Courier New" size=1><SPAN
>))
);
<FONT face="Times New Roman"
size=3> <FONT color=black
face="Courier New" size=1><SPAN
>
<FONT face="Times New Roman"
size=2>Best regards,Tomasz
Janeczkoamibroker.com
<BLOCKQUOTE
>
<SPAN
>----- Original Message -----
<FONT
face=Arial size=2><SPAN
>From:<FONT
face=Arial size=2> <A
href="" title=phutch@xxxxxxxxxxx>Jim Hutchison
<FONT face=Arial
size=2><SPAN
>To:<FONT
face=Arial size=2> <A
href=""
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
<FONT face=Arial
size=2><SPAN
>Sent:<FONT
face=Arial size=2>
<FONT face=Arial
size=2>Tuesday, February
18, 2003<SPAN
> <st1:time
Hour="14" Minute="55"><SPAN
>2:55
PM<SPAN
>
<FONT face=Arial
size=2><SPAN
>Subject:<FONT
face=Arial size=2>
[amibroker] Need Help
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Times New Roman"
size=3><SPAN
>
<SPAN
>When I try to back test the
fowling program I get this AFL Error message:
<SPAN
>Bad
args.
<SPAN
>0-th argument of function call
has invalid (or unsupported) type at line 20, column
21:
<SPAN
>
<SPAN
>
<SPAN
>StochRsi=EMA((RSI(RS)
<SPAN
>--------------------^
<SPAN
>I can not figure out why the RS
variable does not work and the B and S variable work
fine.
<SPAN
>
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Bull=<FONT
color=fuchsia face="Courier New" size=1><SPAN
>9<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Bear=-<FONT
color=fuchsia face="Courier New" size=1><SPAN
>3<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Trend =
<SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Bull<<FONT
color=blue face="Courier New" size=1><SPAN
>ROC<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>EMA<FONT
color=black face="Courier New" size=1><SPAN
>(<SPAN
>C,<FONT color=fuchsia
face="Courier New" size=1><SPAN
>50<FONT
color=black face="Courier New" size=1><SPAN
>),
<SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Bear<<FONT
color=blue face="Courier New" size=1><SPAN
>ROC<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>EMA<FONT
color=black face="Courier New" size=1><SPAN
>(<SPAN
>C,<FONT color=fuchsia
face="Courier New" size=1><SPAN
>50<FONT
color=black face="Courier New" size=1><SPAN
>),
<SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>2<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>3<FONT
color=black face="Courier New" size=1><SPAN
>));
<P class=MsoNormal
><FONT color=green
face="Courier New" size=1><SPAN
>//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<FONT
color=black face="Courier New" size=1><SPAN
>
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>B
=<SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>17<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>63<FONT
color=black face="Courier New" size=1><SPAN
>,
<SPAN
>22<FONT
color=black face="Courier New" size=1><SPAN
>));
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>S
=<SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>58<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>79<FONT
color=black face="Courier New" size=1><SPAN
>,
<SPAN
>83<FONT
color=black face="Courier New" size=1><SPAN
>));
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>RS=<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=blue face="Courier New" size=1><SPAN
>IIf<FONT
color=black face="Courier New" size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
color=black face="Courier New" size=1><SPAN
>,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>7<FONT
color=black face="Courier New" size=1><SPAN
>,
<SPAN
>4<FONT
color=black face="Courier New" size=1><SPAN
>));
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Filter<FONT
color=black face="Courier New" size=1><SPAN
>=<FONT
color=fuchsia face="Courier New" size=1><SPAN
>1<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=blue
face="Courier New" size=1><SPAN
>AddColumn<FONT
color=black face="Courier New" size=1><SPAN
>(Trend,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>"Trend"<FONT
color=black face="Courier New" size=1><SPAN
>);
<P class=MsoNormal
><FONT color=blue
face="Courier New" size=1><SPAN
>AddColumn<FONT
color=black face="Courier New" size=1><SPAN
>(B,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>"B"<FONT
color=black face="Courier New" size=1><SPAN
>);
<P class=MsoNormal
><FONT color=blue
face="Courier New" size=1><SPAN
>AddColumn<FONT
color=black face="Courier New" size=1><SPAN
>(S,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>"S"<FONT
color=black face="Courier New" size=1><SPAN
>);
<P class=MsoNormal
><FONT color=blue
face="Courier New" size=1><SPAN
>AddColumn<FONT
color=black face="Courier New" size=1><SPAN
>(RS,<FONT
color=fuchsia face="Courier New" size=1><SPAN
>"RS"<FONT
color=black face="Courier New" size=1><SPAN
>);
<P class=MsoNormal
><FONT color=blue
face="Courier New" size=1><SPAN
>AddColumn<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>ROC<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>EMA<FONT
color=black face="Courier New" size=1><SPAN
>(<SPAN
>C,<FONT color=fuchsia
face="Courier New" size=1><SPAN
>50<FONT
color=black face="Courier New" size=1><SPAN
>),
<SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>"ROC"<FONT
color=black face="Courier New" size=1><SPAN
>);
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>StochRsi=<FONT
color=blue face="Courier New" size=1><SPAN
>EMA<FONT
color=black face="Courier New" size=1><SPAN
>((<FONT
color=blue face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(RS)-<FONT
color=blue face="Courier New" size=1><SPAN
>LLV<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(RS),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>8<FONT
color=black face="Courier New" size=1><SPAN
>))/(<FONT
color=blue face="Courier New" size=1><SPAN
>HHV<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(RS),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>8<FONT
color=black face="Courier New" size=1><SPAN
>)-<FONT
color=blue face="Courier New" size=1><SPAN
>LLV<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=blue face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(RS),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>8<FONT
color=black face="Courier New" size=1><SPAN
>)),<FONT
color=fuchsia face="Courier New" size=1><SPAN
>3<FONT
color=black face="Courier New" size=1><SPAN
>)*<FONT
color=fuchsia face="Courier New" size=1><SPAN
>100<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Buy<FONT
color=black face="Courier New" size=1><SPAN
>=<FONT
color=blue face="Courier New" size=1><SPAN
>Cross<FONT
color=black face="Courier New" size=1><SPAN
>(B,StochRsi)
AND <FONT
color=blue face="Courier New" size=1><SPAN
>ADX<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=fuchsia face="Courier New" size=1><SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>) >
<SPAN
>20<FONT
color=black face="Courier New" size=1><SPAN
> <SPAN
>AND <FONT color=blue
face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=fuchsia face="Courier New" size=1><SPAN
>4<FONT
color=black face="Courier New" size=1><SPAN
>)<<FONT
color=fuchsia face="Courier New" size=1><SPAN
>50<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Sell<FONT
color=black face="Courier New" size=1><SPAN
>=<FONT
color=blue face="Courier New" size=1><SPAN
>Cross<FONT
color=black face="Courier New" size=1><SPAN
>(StochRsi,S)<SPAN
>AND <FONT color=blue
face="Courier New" size=1><SPAN
>ADX<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=fuchsia face="Courier New" size=1><SPAN
>14<FONT
color=black face="Courier New" size=1><SPAN
>) >
<SPAN
>13<FONT
color=black face="Courier New" size=1><SPAN
> <SPAN
>AND <FONT color=blue
face="Courier New" size=1><SPAN
>RSI<FONT
color=black face="Courier New" size=1><SPAN
>(<FONT
color=fuchsia face="Courier New" size=1><SPAN
>4<FONT
color=black face="Courier New" size=1><SPAN
>)><FONT
color=fuchsia face="Courier New" size=1><SPAN
>50<FONT
color=black face="Courier New" size=1><SPAN
>;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>Short<FONT
color=black face="Courier New" size=1><SPAN
>=<SPAN
>Sell;<SPAN
>Cover=<SPAN
>Buy;
<P class=MsoNormal
><FONT color=black
face="Courier New" size=1><SPAN
>
<SPAN
>Thank
you
<SPAN
>
<SPAN
>Jim
Hutchison
<FONT face="Times New Roman"
size=3><FONT
face="Courier New" size=2>Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
<SPAN
><FONT
face="Courier New">(Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<SPAN
>Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of
Service.
<FONT face="Times New Roman"
size=3><BR
><BR
><FONT
face="Courier New" size=2>Post AmiQuote-related
messages ONLY to: amiquote@xxxxxxxxxxxxxxx <FONT
face="Courier New" size=2><SPAN
><FONT
face="Courier New">(Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of
Service.
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 <A
href="">Yahoo! Terms of Service.
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 <A
href="">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.
|