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

Re: choosing one stock?



PureBytes Links

Trading Reference Links

Hi,

perhaps you can use rel perf

A slightly more advanced version of Relative Performace Chart is a 
baseline version that displays the performance of several securities 
compared to one "base" security (in the example below this is ^DJI) - 
showing exactly what stocks outperform or underperform the base 
stock/index. The formula for the baseline relative performance chart 
is as follows:

/* Baseline Relative Performance charts
** with ^DJI as a base line
** AFL implementation by Tomasz Janeczko
**
** Use Automatic scaling, Grid: Percent, Limits, Middle
**
** This example plots 4 lines
** bold red - currently selected ticker
** blue - DJIA - Base Line
** black - IBM
** green - MSFT
** you can of course change the tickers as you wish
*/
maxgraph = 4; // as many as you wish to use
startpoint = 10; // the start point of comparision will be 10th bar
// here is a base line
price = foreign("^DJI", "C");
baseline = 100 * ( price/ValueWhen( cum(1) == startpoint, price ) - 
1 );
price = close;
graph0 = 100 * ( price/ValueWhen( cum(1) == startpoint, price ) - 
1 ) - baseline;
graph0style = 4;
// base line chart (flat line)
graph1 = baseline - baseline;
graph1style = 1;
// you can change the ticker below
price = foreign("IBM", "C");
graph2 = 100 * ( price/ValueWhen( cum(1) == startpoint, price ) - 
1 ) - baseline;
graph2style = 1;
// you can change the ticker below
price = foreign("MSFT", "C");
graph3 = 100 * ( price/ValueWhen( cum(1) == startpoint, price ) - 
1 ) - baseline;
graph3style = 1;
graph3color = 6;




> This is a good question as i too would like to know how to do this.
> Is it possible to only have stocks that may be choosen by the ROC 
or 
> other sys to compare against an index only if the index is rising 
by 
> using an adx formula or similar.
> I am fairly new to ami and dont understand the capabilities of 
> ami yet.
> I can create a custom index but the results when looking at 
the 
> chart are very choppy and has eratic short price jumps from 1 
extreme 
> to the other.
> The prob is how can i use a custom or even the normal index as 
a 
> base ( but only a base when it is in a rising trend) then only when 
> the formula of the index is true will it then seek to buy stocks 
> from whatever group of stocks you choose.
> I would like this as an exploration, and also to backtest all 
the 
> qoutes.
> I would think this is impossible as it would probably have to be 
> done in 2 steps and save the index results in a separate watchlist( 
> but i dont think you can save a watchlist of the index or any other 
> stock that has the history with only the individual date ranges or 
> true results after running a formula e.g. ADX)
> In this case it would only have stored the ranges of the index 
> after running an ADX formula.
> so then i can compare all the stocks or certain groups against 
this 
> broken index knowing it will only buy if the index has a rising 
trend.
> If there is any other way to do this can someone please be 
helpful 
> and post a formula or the way to do this in a basic explanation.
> 
> sorry if this is a stupid question.
> 
> Thankyou
> 
> peter.
> 
> 
> 
> --- In amibroker@xxxx, "mik954" <mik-u@xxxx> wrote:
> > Hi,
> > 
> > Did you try to store Exploration results in Watch List and then 
> > caclulate the results using back-test for this list?
> > 
> > Mike
> > 
> > --- In amibroker@xxxx, "witold_dabrowski" <witold_dabrowski@xxxx> 
> > wrote:
> > > Hi,
> > > 
> > > I want back-test a trend-following system who watch an index to 
> > > determine trend. When the trend is found, system ranks the 
stocks 
> > > from index and choose one the best. The buy-signal is 
generated 
> > only 
> > > for this stock. Exit signal is generated with 'ApplyStop()' 
> > function.
> > > 
> > > I have troubles with programming buy signal. It's simple to 
watch 
> > > cross-over on the index, but how to tell to AmiBroker to buy a 
> > stock 
> > > XYZ? For this moment I see only one solution: write this as 
> > > Exploration (it's simple) and calculate the results of back-
> testing 
> > > mannualy...