PureBytes Links
Trading Reference Links
|
Jim,
Here is a Check you can use: add the following :
RS1=IIf(Trend == 1,14,IIf(Trend == 2,7, 4));
AddColumn(ValueWhen(DateNum()==1011018,rs1),"");//pick a date I have
10/18/2001 here.
click explore.
Anthony
Jim Hutchison wrote:
> 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.
>
> Thank You
>
> Jim Hutchison
>
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@xxxxxx]
> Sent:Tuesday, February 18, 200311:15 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Need Help
>
> Jim,
> IIF always returns array while RS accepts only number. To convert use
> LastValue:
> RS= LastValue ( IIf(Trend == 1,14,IIf(Trend == 2,7, 4)) );
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
>
> ----- Original Message -----
> From: Jim Hutchison
> To: amibroker@xxxxxxxxxxxxxxx
> Sent:Tuesday, February 18, 20032:55 PM
> Subject: [amibroker] Need Help
>
> When I try to back test the fowling program I get this AFL
> Error message:
>
> Bad args.
>
> 0-th argument of function call has invalid (or unsupported)
> type at line 20, column 21:
>
> StochRsi=EMA((RSI(RS)
>
> --------------------^
>
> I can not figure out why the RS variable does not work and
> the B and S variable work fine.
>
> Bull=9;
>
> Bear=-3;
>
> Trend
> = IIf(Bull<ROC(EMA(C,50), 14),1,IIf(Bear<ROC(EMA(C,50), 14),2,3));
>
> //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> B =IIf(Trend == 1,17,IIf(Trend == 2,63, 22));
>
> S =IIf(Trend == 1,58,IIf(Trend == 2,79, 83));
>
> RS=IIf(Trend == 1,14,IIf(Trend == 2,7, 4));
>
> Filter=1;
>
> AddColumn(Trend,"Trend");
>
> AddColumn(B,"B");
>
> AddColumn(S,"S");
>
> AddColumn(RS,"RS");
>
> AddColumn(ROC(EMA(C,50), 14),"ROC");
>
>
> tochRsi=EMA((RSI(RS)-LLV(RSI(RS),8))/(HHV(RSI(RS),8)-LLV(RSI(RS),8)),3)*100;
>
> Buy=Cross(B,StochRsi) ANDADX(14) > 20ANDRSI(4)<50;
>
> Sell=Cross(StochRsi,S)ANDADX(14) > 13ANDRSI(4)>50;
>
> Short=Sell;Cover=Buy;
>
> Thank you
>
> Jim Hutchison
>
> 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.
>
>
>
>
> 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.
>
>
> 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.
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 http://docs.yahoo.com/info/terms/
|