PureBytes Links
Trading Reference Links
|
Yuki
All Calculations you want to perform must be within the set foreign
statement and passed to variables, which you then display with your
AddColumn statements. Eg in below AFL code "List Ticker" RSI is
correct, The CurrentTicker RSI is not the RSI of your list Ticker
but is the RSI of the "underlying" Current ticker. Comment out the
line,
SetOption("NoDefaultColumns",True); and you will see
the "underlying" Current ticker. It is a trap and yes care needs to
be taken.
List = "NAB,RIO,BHP,ANZ,CBA,";
ORdNum = Status("StockNum");
sym = StrExtract( List, ORdnum );
ticker = "";
result = 0;
CloseOnHigh10 = 0;
if(sym != "")
{
SetForeign(Sym);
Ticker = Name();
//Start your code
Result = RSI();
CloseOnHigh10 = Sum(C==H,10);
//finish your code
RestorePriceArrays();
}
Filter = ticker != "";
SetOption("NoDefaultColumns",True);
AddTextColumn(ticker,"Ticker");
AddColumn(Result,"List Ticker RSI ");
AddColumn(RSI(),"CurrentTicker RSI ");
AddColumn(CloseOnHigh10,"#Close High 10pd");
Hope this makes things clearer
Andrew
--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> Hi again Andrew,
>
> Saturday, December 6, 2003, 10:19:38 AM, you wrote:
>
> A> Yes the original filter was not the best choice, a better choice
> A> would be Filter = ticker !="";
>
> Using this filter statement, I got it to work. But something is
not
> correct. Namely, values of other items are now incorrect. For
> example, one addcolumn statement defines the day's range as a
> percentage of a particular ATR value. That percentage is part of
my
> own filter statement. Oddly, while the filtering that is being
done
> is apparently correct (only tickers meeting my filtering criteria
are
> being displayed), the values now given in the report are out of
> range, in other words if those values were actually true (they are
> not, I hand checked) the ticker would get filtered out.
>
> I think this code is rather dangerous in my hands.
>
> Yuki
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
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 http://docs.yahoo.com/info/terms/
|