PureBytes Links
Trading Reference Links
|
From the S&C Tips 5/2001, There is AFL for
"Baseline Relative
Performance chart"
Attached is a revision that Plots all the tickers in a watchist. This is
handy if you have multiple lists you like to compare.
Also, The StartPoint & Watchlist can be modified with
the parameters feature (CTRL-R)*.
*If you see [EMPTY] next to a ticker - Adjust the StartPoint slider
untill you get all the tickers.
/* Baseline Relative
Performance charts
** with XAO as a base line
** AFL implementation by Tomasz Janeczko
** Watchlist & Parameter's Addition by Michael.S.G.
**
** Use Automatic scaling, Grid: Percent, Limits, Middle
**
** This example plots lines for each entry in watchlist
** Bold red - currently selected ticker
** White - XAO - Base Line
**
** you can of course change the Watchlist/Tickers as you wish
*/
Listnum =
Param(
"Watchlist",
5,
0,
100,
1
);// Watchlist
to display.
//startpoint = 10; // the start point of comparision will be 10th
bar
startpoint =
Param(
"startpoint",
10,
1,
5000,
1
);
// here is a
base line
price =
Foreign("XAO",
"C");
baseline =
100
* (
price/ValueWhen(
Cum(1)
== startpoint, price ) -
1
);
// Show
Currently selected Ticker
price = Close;
Plot(100
* (
price/ValueWhen(
Cum(1)
== startpoint, price ) -
1
) -
baseline,Name(),4,4);
// base line
chart (flat line)
Plot
( baseline -
baseline,"XAO",2,1);
list =
GetCategorySymbols(
categoryWatchlist, listnum );
for(
i =
0;
( sym =
StrExtract(
list, i ) ) !=
"";
i++ )
{
price =
Foreign(
sym,
"C"
);
Plot (100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1 )- baseline,sym,6+i,1);
}
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.
/* Baseline Relative Performance charts
** with XAO as a base line
** AFL implementation by Tomasz Janeczko
** Watchlist & Parameter's Addition by Michael.S.G.
**
** Use Automatic scaling, Grid: Percent, Limits, Middle
**
** This example plots lines for each entry in watchlist
** Bold red - currently selected ticker
** White - XAO - Base Line
**
** you can of course change the Watchlist/Tickers as you wish
*/
Listnum = Param( "Watchlist", 5, 0, 100, 1 );// Watchlist to display.
//startpoint = 10; // the start point of comparision will be 10th bar
startpoint = Param( "startpoint", 10, 1, 5000, 1 );
// here is a base line
price = Foreign("XAO", "C");
baseline = 100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1 );
// Show Currently selected Ticker
price = Close;
Plot(100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1 ) - baseline,Name(),4,4);
// base line chart (flat line)
Plot ( baseline - baseline,"XAO",2,1);
list = GetCategorySymbols( categoryWatchlist, listnum );
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
price = Foreign( sym, "C" );
Plot (100 * ( price/ValueWhen( Cum(1) == startpoint, price ) - 1 )- baseline,sym,6+i,1);
}
|