I'd need a feature to get the date of the ETF peak/trough to apply to the
ticker.   I think I might be able to do it by myself if I can do this.
Then, I would simply subtract peaks and troughs to get a % result and then I
could choose to deal only with high%...

Louis

2008/5/23 Louis Préfontaine <[EMAIL PROTECTED]>:

> Hi Ed,
>
> Would it be possible to include this in a single AFL without the need to
> run a separate watchlist?  E.g. to say that every ticker with a correlation
> over 0.9 to fit "cond1" and then use cond1 as a buy to buy when the ETF
> triggers a buy?
>
> Louis
>
> 2008/5/23 Ed Hoopes <[EMAIL PROTECTED]>:
>
>   This code runs a WatchList against itself. I use it to identify
>> securities that have a high positive or negative correlation - that is
>> above about 0.90.
>>
>> So it takes ticker #1 and runs a correlation against all the others -
>> then it takes #2 and runs a correlation. . . .
>>
>> High positive correlation means that my rotational trading ranker will
>> tend to select securities that move in lock step therefore losing
>> diversification - not good.
>>
>> High negative correlation allows me to remove all of the funds that
>> move inversely to one another, since the rotational trading feature
>> takes the absolute value of the ranking. So you would be
>> simultaneously long and short - again not good.
>>
>> The best group of ETF's are ones that have correlations around zero -
>> say +0.5 to -0.5 meaning that they move independently of one another -
>> that is a good thing.
>>
>> It would be easy to run a Watchlist against one security - say SPY by
>> setting Ticker2 = Foreign("SPY", Close) or whatever.
>>
>> Ed
>>
>>
>> --- In [email protected] <amibroker%40yahoogroups.com>, "Louis
>> Préfontaine" <[EMAIL PROTECTED]>
>> wrote:
>> >
>> > Thanks for the code Graham!
>> >
>> > This is a good start for me, but now I am stucked at trying to do what I
>> > want to do with the data. My goal is to automatically select the best
>> > correlated stocks in the last 252 days without having to run the
>> exploration
>> > again and create new watchlists. I'd like to do as if I ran a
>> backtest but
>> > without actually doing it. Instead, my idea was to assign a % value
>> of each
>> > stock between the peaks and troughs. E.g. If I can establish with
>> zigzag
>> > the peaks and trough of the ETF, then I can subtract those dates to the
>> > ticker I am analyzing and adding it up I can establish the ones that are
>> > correlated and the ones that are not without running a backtest and
>> playing
>> > with watchlists. But the question is: how to do this? Do I go
>> with the
>> > dates of the peaks-troughs or if not, how? Thanks!
>> >
>> > Thanks for the code Ed... But how to you choose the ETF or the
>> reference
>> > ticker in all this? I am not sure to actually understand the code
>> right.
>> >
>> > Thank you all,
>> >
>> > Louis
>> >
>> > 2008/5/21 Graham <[EMAIL PROTECTED]>:
>>
>> >
>> > > It is possible to use zigzag in a backtest. the important thing is
>> > > that the signals can only occur after the price has passed the
>> > > reversal level
>> > > eg here is a way to use it
>> > >
>> > > p = Peak(C,10);
>> > > pb = PeakBars(C,10);
>> > > t = Trough(C,10);
>> > > tb = TroughBars(C,10);
>> > >
>> > > cp = Cross(p*0.9,LowestSince( pb==0, C ));
>> > > ct = Cross(HighestSince( tb==0, C ), t*1.1);
>> > >
>> > > Fall = Flip(Cp,Ct);
>> > > Rise = Flip(Ct,Cp);
>> > >
>> > > Buy = Cross(MACD(),Signal()) AND rise;
>> > > Sell = Cross(Signal(),MACD());
>> > >
>> > > SetChartOptions( 0, chartShowDates|chartWrapTitle );
>> > > GraphXSpace=10;
>> > > _N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}} "+_DEFAULT_NAME()+" :
>> > > {{OHLCX}} {{VALUES}}" );
>> > >
>> > > BarColor = IIf( rise, colorPaleGreen, IIf( fall, colorOrange,
>> > > ParamColor( "Price Colour", colorWhite )));
>> > >
>> > > Plot( C, "", BarColor, ParamStyle( "Price Style", styleBar,
>> maskPrice ) );
>> > >
>> > > Plot( Zig(C,10), "Zig", colorRed, styleLine );
>> > > Plot( IIf(pb<tb,Peak(C,10)*0.9,Trough(C,10)*1.1), "Zig",
>> > > IIf(pb<tb,colorOrange,colorPaleGreen), styleStaircase );
>> > >
>> > > PlotShapes( shapeSmallUpTriangle*Ct, colorPaleGreen, 0, L, -12 );
>> > > PlotShapes( shapeSmallDownTriangle*Cp, colorOrange, 0, H, -12 );
>> > >
>> > > PlotShapes( shapeUpArrow*Buy, colorGreen, 0, L, -24 );
>> > > PlotShapes( shapeDownArrow*Sell, colorRed, 0, H, -24 );
>> > >
>> > > --
>> > > Cheers
>> > > Graham Kav
>> > > AFL Writing Service
>> > > http://www.aflwriting.com
>> > >
>> > > 2008/5/21 Louis Préfontaine <[EMAIL PROTECTED] <rockprog80%40gmail.com>
>> > > >:
>> > >
>> > > > Hi,
>> > > >
>> > > > My idea is to use the zigzag feature in the past to find the
>> best stocks
>> > > > which match ETF. I'd like to use the zigzag directly in my formula
>> > > without
>> > > > having to re-build a new watch-list often.
>> > > >
>> > > > Louis
>> > > >
>> > > > 2008/5/21 Ed Hoopes <[EMAIL PROTECTED] <reefbreak_sd%40yahoo.com>>:
>> > > >>
>> > > >> ZigZag
>> > > >> This indicator cannot be used for trading. It effectively looks
>> into
>> > > >> the future. Say you set its threshold at 4%. It will show tops and
>> > > >> bottoms that are 4% or greater difference. If you get a high today,
>> > > >> but a higher hi 2 weeks from now, it will move the reversal to
>> the new
>> > > >> higher high.
>> > > >>
>> > > >> It is most often used to calculate theoretical performance of a
>> series
>> > > >> of price movements. Then you can run your indicators over the same
>> > > >> period and calculate a "capture ratio". Good for comparing
>> indicators
>> > > >> - not trading.
>> > >
>> > >
>> >
>>
>>  
>>
>
>

Reply via email to