PureBytes Links
Trading Reference Links
|
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 face="Courier New" color=#0000ff
size=2>Ref(C,-<FONT
face="Courier New" color=#ff00ff size=2>1<FONT face="Courier New"
size=2>);Up = <FONT face="Courier New" color=#0000ff
size=2>IIf( mo><FONT
face="Courier New" color=#ff00ff size=2>0<FONT face="Courier New"
size=2>, mo, 0<FONT
face="Courier New" size=2>); Dn = <FONT face="Courier New" color=#0000ff
size=2>IIf( mo<<FONT
face="Courier New" color=#ff00ff size=2>0<FONT face="Courier New"
size=2>, -mo, 0<FONT
face="Courier New" size=2>);Ut = <FONT face="Courier New"
color=#0000ff size=2>AMA(Up,<FONT
face="Courier New" color=#ff00ff size=2>1<FONT face="Courier New"
size=2>/t); Dt = <FONT face="Courier New" color=#0000ff
size=2>AMA(Dn,<FONT
face="Courier New" color=#ff00ff size=2>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 title=amibroker@xxxxxxxxxxxxxxx
href="">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 Year="2003"
Day="18" Month="2"><SPAN
>Tuesday, February 18,
2003<SPAN
> <st1:time
Minute="15" Hour="11"><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 face="Courier New"
color=black size=1><SPAN
>RS= LastValue
( <SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>7<FONT
face="Courier New" color=black size=1><SPAN
>,
<SPAN
>4<FONT
face="Courier New" color=black size=1><SPAN
>))
);
<FONT face="Times New Roman"
size=3> <FONT
face="Courier New" color=black 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
title=phutch@xxxxxxxxxxx href="">Jim Hutchison
<FONT face=Arial
size=2><SPAN
>To:<FONT
face=Arial size=2> <A
title=amibroker@xxxxxxxxxxxxxxx
href="">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
Minute="55" Hour="14"><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
face="Courier New" color=black size=1><SPAN
>Bull=<FONT
face="Courier New" color=fuchsia size=1><SPAN
>9<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Bear=-<FONT
face="Courier New" color=fuchsia size=1><SPAN
>3<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Trend =
<SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Bull<<FONT
face="Courier New" color=blue size=1><SPAN
>ROC<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>EMA<FONT
face="Courier New" color=black size=1><SPAN
>(<SPAN
>C,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>50<FONT
face="Courier New" color=black size=1><SPAN
>),
<SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Bear<<FONT
face="Courier New" color=blue size=1><SPAN
>ROC<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>EMA<FONT
face="Courier New" color=black size=1><SPAN
>(<SPAN
>C,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>50<FONT
face="Courier New" color=black size=1><SPAN
>),
<SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>2<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>3<FONT
face="Courier New" color=black size=1><SPAN
>));
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>B
=<SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>17<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>63<FONT
face="Courier New" color=black size=1><SPAN
>,
<SPAN
>22<FONT
face="Courier New" color=black size=1><SPAN
>));
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>S
=<SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>58<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>79<FONT
face="Courier New" color=black size=1><SPAN
>,
<SPAN
>83<FONT
face="Courier New" color=black size=1><SPAN
>));
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>RS=<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=blue size=1><SPAN
>IIf<FONT
face="Courier New" color=black size=1><SPAN
>(Trend ==
<SPAN
>2<FONT
face="Courier New" color=black size=1><SPAN
>,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>7<FONT
face="Courier New" color=black size=1><SPAN
>,
<SPAN
>4<FONT
face="Courier New" color=black size=1><SPAN
>));
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Filter<FONT
face="Courier New" color=black size=1><SPAN
>=<FONT
face="Courier New" color=fuchsia size=1><SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(Trend,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"Trend"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(B,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"B"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(S,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"S"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(RS,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"RS"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>ROC<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>EMA<FONT
face="Courier New" color=black size=1><SPAN
>(<SPAN
>C,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>50<FONT
face="Courier New" color=black size=1><SPAN
>),
<SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"ROC"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>StochRsi=<FONT
face="Courier New" color=blue size=1><SPAN
>EMA<FONT
face="Courier New" color=black size=1><SPAN
>((<FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(RS)-<FONT
face="Courier New" color=blue size=1><SPAN
>LLV<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(RS),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>8<FONT
face="Courier New" color=black size=1><SPAN
>))/(<FONT
face="Courier New" color=blue size=1><SPAN
>HHV<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(RS),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>8<FONT
face="Courier New" color=black size=1><SPAN
>)-<FONT
face="Courier New" color=blue size=1><SPAN
>LLV<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(RS),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>8<FONT
face="Courier New" color=black size=1><SPAN
>)),<FONT
face="Courier New" color=fuchsia size=1><SPAN
>3<FONT
face="Courier New" color=black size=1><SPAN
>)*<FONT
face="Courier New" color=fuchsia size=1><SPAN
>100<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Buy<FONT
face="Courier New" color=black size=1><SPAN
>=<FONT
face="Courier New" color=blue size=1><SPAN
>Cross<FONT
face="Courier New" color=black size=1><SPAN
>(B,StochRsi)
AND <FONT
face="Courier New" color=blue size=1><SPAN
>ADX<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=fuchsia size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>) >
<SPAN
>20<FONT
face="Courier New" color=black size=1><SPAN
> <SPAN
>AND <FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=fuchsia size=1><SPAN
>4<FONT
face="Courier New" color=black size=1><SPAN
>)<<FONT
face="Courier New" color=fuchsia size=1><SPAN
>50<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Sell<FONT
face="Courier New" color=black size=1><SPAN
>=<FONT
face="Courier New" color=blue size=1><SPAN
>Cross<FONT
face="Courier New" color=black size=1><SPAN
>(StochRsi,S)<SPAN
>AND <FONT
face="Courier New" color=blue size=1><SPAN
>ADX<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=fuchsia size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>) >
<SPAN
>13<FONT
face="Courier New" color=black size=1><SPAN
> <SPAN
>AND <FONT
face="Courier New" color=blue size=1><SPAN
>RSI<FONT
face="Courier New" color=black size=1><SPAN
>(<FONT
face="Courier New" color=fuchsia size=1><SPAN
>4<FONT
face="Courier New" color=black size=1><SPAN
>)><FONT
face="Courier New" color=fuchsia size=1><SPAN
>50<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Short<FONT
face="Courier New" color=black size=1><SPAN
>=<SPAN
>Sell;<SPAN
>Cover=<SPAN
>Buy;
<P class=MsoNormal
><FONT
face="Courier New" color=black 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.
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.
|