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

RE: [amibroker] Need Help (Tomasz)



PureBytes Links

Trading Reference Links










When run Explore I get the attached
results after I added LastValue () <span
> to my formula.<span
>  RS is always 7 regardless if Trend is 1
or 2 or 3.

 

Thank You

Jim Hutchison

 

<span
>-----Original Message-----
From: Tomasz Janeczko
[mailto:amibroker@xxxxxx] 
Sent: <st1:date
Month="2" Day="18" Year="2003">Tuesday, February 18, 2003<font
size=2 face=Tahoma> <st1:time
Hour="11" Minute="15">11:15 AM<span
>
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Need Help

<span
> 



<span
>Jim,





<span
> 





<span
>IIF always returns array while RS accepts only number.
To convert use LastValue:





<span
> 





<font size=1 color=black
face="Courier New">RS= LastValue ( <font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">1<font size=1
color=black face="Courier New">,<span
>14<font
size=1 color=black face="Courier New">,<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New">,<span
>7<font
size=1 color=black face="Courier New">, <font size=1 color=fuchsia
face="Courier New">4<span
>)) );





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





<span
>
Best regards,
Tomasz Janeczko
amibroker.com







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





<font size=2
face=Arial>From:<font
size=2 face=Arial> <a
href="" title="phutch@xxxxxxxxxxx">Jim Hutchison 





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






<span
>Sent:<font
size=2 face=Arial> <st1:date
Month="2" Day="18" Year="2003">Tuesday, February 18, 2003<font
size=2 face=Arial> <st1:time
Hour="14" Minute="55">2:55 PM<span
>





<span
>Subject:<font
size=2 face=Arial> [amibroker]
Need Help





<span
> 



<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
> 

<font
size=1 color=black face="Courier New">Bull=<font size=1 color=fuchsia
face="Courier New">9<span
>;

<font
size=1 color=black face="Courier New">Bear=-<font size=1 color=fuchsia
face="Courier New">3<span
>;

<font
size=1 color=black face="Courier New">Trend = <font size=1 color=blue
face="Courier New">IIf<span
>(Bull<<font
size=1 color=blue face="Courier New">ROC<font size=1 color=black
face="Courier New">(<span
>EMA<font
size=1 color=black face="Courier New">(C,<font
size=1 color=fuchsia face="Courier New">50<font size=1
color=black face="Courier New">), <span
>14<font
size=1 color=black face="Courier New">),<font size=1 color=fuchsia
face="Courier New">1<span
>,<font
size=1 color=blue face="Courier New">IIf<font size=1 color=black
face="Courier New">(Bear<<span
>ROC<font
size=1 color=black face="Courier New">(<font size=1 color=blue
face="Courier New">EMA<span
>(<span
>C,<font size=1 color=fuchsia
face="Courier New">50<span
>), <font
size=1 color=fuchsia face="Courier New">14<font size=1
color=black face="Courier New">),<span
>2<font
size=1 color=black face="Courier New">,<font size=1 color=fuchsia
face="Courier New">3<span
>));

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

<font
size=1 color=black face="Courier New">B =<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">1<font size=1
color=black face="Courier New">,<span
>17<font
size=1 color=black face="Courier New">,<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New">,<span
>63<font
size=1 color=black face="Courier New">, <font size=1 color=fuchsia
face="Courier New">22<span
>));

<font
size=1 color=black face="Courier New">S =<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">1<font size=1
color=black face="Courier New">,<span
>58<font
size=1 color=black face="Courier New">,<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New">,<span
>79<font
size=1 color=black face="Courier New">, <font size=1 color=fuchsia
face="Courier New">83<span
>));

<font
size=1 color=black face="Courier New">RS=<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">1<font size=1
color=black face="Courier New">,<span
>14<font
size=1 color=black face="Courier New">,<font size=1 color=blue
face="Courier New">IIf<span
>(Trend == <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New">,<span
>7<font
size=1 color=black face="Courier New">, <font size=1 color=fuchsia
face="Courier New">4<span
>));

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

<font
size=1 color=black face="Courier New">Filter<font
size=1 color=black face="Courier New">=<font size=1 color=fuchsia
face="Courier New">1<span
>; 

<font
size=1 color=blue face="Courier New">AddColumn<font size=1 color=black
face="Courier New">(Trend,<span
>"Trend"<font
size=1 color=black face="Courier New">); 

<font
size=1 color=blue face="Courier New">AddColumn<font size=1 color=black
face="Courier New">(B,<span
>"B"<font
size=1 color=black face="Courier New">);

<font
size=1 color=blue face="Courier New">AddColumn<font size=1 color=black
face="Courier New">(S,<span
>"S"<font
size=1 color=black face="Courier New">);

<font
size=1 color=blue face="Courier New">AddColumn<font size=1 color=black
face="Courier New">(RS,<span
>"RS"<font
size=1 color=black face="Courier New">);

<font
size=1 color=blue face="Courier New">AddColumn<font size=1 color=black
face="Courier New">(<span
>ROC<font
size=1 color=black face="Courier New">(<font size=1 color=blue
face="Courier New">EMA<span
>(<span
>C,<font size=1 color=fuchsia
face="Courier New">50<span
>), <font
size=1 color=fuchsia face="Courier New">14<font size=1
color=black face="Courier New">),<span
>"ROC"<font
size=1 color=black face="Courier New">);

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

<font
size=1 color=black face="Courier New">StochRsi=<font size=1 color=blue
face="Courier New">EMA<span
>((<font
size=1 color=blue face="Courier New">RSI<font size=1 color=black
face="Courier New">(RS)-<span
>LLV<font
size=1 color=black face="Courier New">(<font size=1 color=blue
face="Courier New">RSI<span
>(RS),<font
size=1 color=fuchsia face="Courier New">8<font size=1
color=black face="Courier New">))/(<span
>HHV<font
size=1 color=black face="Courier New">(<font size=1 color=blue
face="Courier New">RSI<span
>(RS),<font
size=1 color=fuchsia face="Courier New">8<font size=1
color=black face="Courier New">)-<span
>LLV<font
size=1 color=black face="Courier New">(<font size=1 color=blue
face="Courier New">RSI<span
>(RS),<font
size=1 color=fuchsia face="Courier New">8<font size=1
color=black face="Courier New">)),<span
>3<font
size=1 color=black face="Courier New">)*<font size=1 color=fuchsia
face="Courier New">100<span
>; 

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

<font
size=1 color=black face="Courier New">Buy<font size=1
color=black face="Courier New">=<span
>Cross<font
size=1 color=black face="Courier New">(B,StochRsi) AND
<span
>ADX<font
size=1 color=black face="Courier New">(<font size=1 color=fuchsia
face="Courier New">14<span
>) > <font
size=1 color=fuchsia face="Courier New">20<font size=1
color=black face="Courier New"> AND <font
size=1 color=blue face="Courier New">RSI<font size=1 color=black
face="Courier New">(<span
>4<font
size=1 color=black face="Courier New">)<<font size=1 color=fuchsia
face="Courier New">50<span
>; 

<font
size=1 color=black face="Courier New">Sell<font size=1
color=black face="Courier New">=<span
>Cross<font
size=1 color=black face="Courier New">(StochRsi,S)AND
<span
>ADX<font
size=1 color=black face="Courier New">(<font size=1 color=fuchsia
face="Courier New">14<span
>) > <font
size=1 color=fuchsia face="Courier New">13<font size=1
color=black face="Courier New"> AND <font
size=1 color=blue face="Courier New">RSI<font size=1 color=black
face="Courier New">(<span
>4<font
size=1 color=black face="Courier New">)><font size=1 color=fuchsia
face="Courier New">50<span
>; 

<font
size=1 color=black face="Courier New">Short<font
size=1 color=black face="Courier New">=Sell;<span
>Cover=Buy;

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

<span
>Thank you

<span
> 

<span
>Jim Hutchison

<span
>

Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx <font
size=2 face="Courier New">
(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">Post AmiQuote-related
messages ONLY to: amiquote@xxxxxxxxxxxxxxx <font size=2
face="Courier New">
(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


  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.





Attachment:
Ambroker.png

Attachment: Description: "Description: PNG image"