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

[amibroker] Re: controlling exploration output {for YUKI}



PureBytes Links

Trading Reference Links




Yuki
Y>I am really having trouble with this. You 
have code in there betweenY>the lines //start your code and //finish your 
code. I do not knowY>whether to leave those in or take them out I guess. 
Basically, I doY>not understand what is 
happening with the code.
Below is a rather verbose rewrite of the original code (full of comments 
etc).  I have removed  an unnecessary if statement, which may make the 
code easier to follow.  Anything within the "Start - Finish" sections can 
be changed, with any limitations/requirements noted.
 
Hope this makes things clearer
 
Andrew
 
 
 
// 
Exploration to display a selected LIST of stocks, in List 
order.
/* 
APPLY TO - set to use Filter. 
DEFINE Filter - select group, watchlist that contains at least as many 
stocks as there are stocks in your list. Choose a Watchlist that has a minimum 
of data holes ( a watchlist full of indexes would be good).  RANGE - set 
whatever you want (probably n last days - n=1).
*/<FONT 
color=#008000>
 
// **************************************** start 1
// Type your comma separated list here. 
List = "NAB,RIO,BHP,ANZ,CBA,";<FONT 
color=#008000>
// **************************************** finish 1
 
ORdNum = Status(<FONT 
color=#ff00ff>"StockNum");
Ticker = StrExtract( List, ORdnum );<FONT 
color=#0000ff>
SetForeign(Ticker);
 
// ---------------------------------------- Start 2
//Insert LIST STOCK calculations in this section. Some examples 
follow
List_C = Close;
Change_1pd = Close - <FONT 
color=#0000ff>Ref(Close,-1);
ROC_10pd = ROC(Close,<FONT 
color=#ff00ff>10); 
List_CCI14 = CCI(<FONT 
color=#ff00ff>14);
// LIST STOCK calculations finish 
// ---------------------------------------- Finish 2<FONT 
color=#0000ff>
 
RestorePriceArrays();
 
// ++++++++++++++++++++++++++++++++++ start 3 
/* Filter Statement must include < ticker != "" >, with any 
additional criteria added with an AND. Additional criteria must reference only 
variables calculated in the LIST STOCK CALCULATION area. */
Filter = ticker != "" AND (Change_1pd 
> 0 OR ROC_10pd > <FONT 
color=#ff00ff>0);
// ++++++++++++++++++++++++++++++++++ finish 3<FONT 
color=#0000ff>
 
SetOption(<FONT 
color=#ff00ff>"NoDefaultColumns",True);
AddTextColumn(ticker,<FONT 
color=#ff00ff>"Ticker");
AddTextColumn(Date(),<FONT 
color=#ff00ff>"Date");  // optional date 
column
 
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Start 4 to 
end 
/* Format Exploration report using AddColumn 
statements. Again only reference variables calculated in the <FONT 
face="Times New Roman" color=#008000>LIST STOCK CALCULATION area. 
*/
AddColumn(List_C,<FONT 
face="Courier New" color=#ff00ff>"Close"<FONT 
face="Courier New">);
AddColumn(Change_1pd,<FONT 
color=#ff00ff>"Change<FONT 
color=#ff00ff>");
AddColumn(List_CCI14,<FONT 
face="Courier New" color=#ff00ff>"CCI(14)"<FONT 
face="Courier New">);






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.


Attachment: Description: ""