PureBytes Links
Trading Reference Links
|
Yesterday, Bruce Robinson described an important feature of the Trade program, namely the 2-D matrix arrangement that allows Dates down the rows and Tickers across the columns.
If you add the concept that a single variable for each ticker and each date are on "sheets" just like the worksheets in Excel, then do you not have the makings of a structure that allows ranking of calculated variables on each date for each ticker? And more, perhaps even portfolio trading?
I was about to try this but am stuck on how to reference individual tickers with a subscript within a For Loop----is it even possible?
Using an example from the Readme
· /* a sample low-level implementation of Profit-target stop in AFL: */
Buy = Cross( MACD(), Signal() );
priceatbuy=0;
for( i = 0; i < BarCount; i++ )
{
if( priceatbuy == 0 && Buy[ i ] )
priceatbuy = BuyPrice[ i ];
if( priceatbuy > 0 && SellPrice[ i ] > 1.1 * priceatbuy )
{
Sell[ i ] = 1;
SellPrice[ i ] = 1.1 * priceatbuy;
priceatbuy = 0;
}
else
Sell[ i ] = 0;
}
What is the Loop command you would put "on top of" or "around" this code to cycle thru the tickers? And how do you even make it pick a watchlist? It seems like it would use whatever watchlist you select as usual, but how to reference and keep track of the tickers by date?
Comments?
Ken
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.
|