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

RE: [Metastockusers] Re: how to determine stoploss for divergence trading



PureBytes Links

Trading Reference Links

Hi Kevin, thanks for the response…

 

I won’t post my code for the divergence indicator for reasons I stated before. But seeing as how even s/r levels can be defined in different ways then here is the code I use for that particular component of the indicator.

 

{resistance/support levels}

r1:=ValueWhen(1,HHVBars(H,3)=1,HHV(H,2));

r2:=ValueWhen(1,r1<Ref(r1,-1) AND Ref(r1,-1)>ValueWhen(2,r1<>Ref(r1,-1),Ref(r1,-1)),Ref(r1,-1));

s1:=ValueWhen(1,LLVBars(L,3)=1,LLV(L,2));

s2:=ValueWhen(1,s1>Ref(s1,-1) AND Ref(s1,-1)<ValueWhen(2,s1<>Ref(s1,-1),Ref(s1,-1)),Ref(s1,-1));

 

So, you can see that s1 is very simply a low with two higher lows either side, and an s2 is an s1 low with two higher s1 levels either side. Notice there is no forward referencing in there so the pivots get plotted including the relevant lag.

 

> I would not say that crosses of pivot levels constitute divergence in my book

 

Neither would I…perhaps I didn’t explain myself clearly enough, so hopefully this will help…

 

When I was designing my own divergence indicator the thing I struggled most with was determining what periods of price behaviour were relevant to compare…i.e. how to open and close the “windows” within which I compared the highs/lows of the indicator with the price.

 

What I have actually found is that what works best, for this purpose, is to define a price swing (be it a correction in a trend or an intermediate reversal in a rangebound market) as beginning when the price crosses below the r2 level. By doing this the “divergence window” for a potential buy is opened when the price starts to come down from a high point (due to the inherent lag) and starts to turn downwards. The window is then closed when the price crosses back over r2 (which may be the same r2, or a lower one than the ‘opening’ r2)…This defines the downward impulse as having completed, so it’s time to reset all the “buy” variables. Obviously the opposite is true for the sell variables.

 

My choice of using r2/s2 in this way are simply a matter of having tried and tested various forms and versions of the indicator (using s1/s2/s3 and r1/r2/r3 in all permutations) across a broad range of markets. Hopefully the charts I posted show that it’s not without merit…however, as Jose has pointed out, there are other ways of defining divergence. I have found that my way tends to capture corrective dips and also does a pretty good job of picking the intermediate turning points in rangebound markets. It’s not perfect, but then what is?

 

As for entries and exits and all that, well that’s a different story. When I’m using this indicator I will usually simply buy on a cross above the r1 level (or maybe r2 depending on my confidence and the risk) following a signal. This ensures that the price is moving back in my favour…

 

So, I take all you say about fakes, fades and support/resistance …but I was simply discussing a possible divergence indicator and strategy.

 

 


From: Metastockusers@yahoogroups.com [mailto:Metastockusers@yahoogroups.com] On Behalf Of Kevin
Sent: Thursday, April 28, 2005 11:38 AM
To: Metastockusers@yahoogroups.com
Subject: RE: [Metastockusers] Re: how to determine stoploss for divergence trading

 

Hello,

Thanks for posting the chart. The MACD plots makes perfect sense but I must say that I cannot work out how your R2 is calculated, whether you are using weekly pivots, daily pivots, etc. No matter.

I would not say that crosses of pivot levels constitute divergence in my book. Semantics, perhaps. However, your basic idea is good but could I offer a suggestion or two......?

I'll take that as a yes then..............

>From my own experience, I believe that pivot levels work differently in the FX market than on stocks, although their use is perfectly valid in both markets. IMO, the strength of pivot levels in FX trading is to provide S/R and likely areas for a trend reversal. Once again, only IMO, when the price pushes through a pivot level, one is looking for S/R at the next level. My sense is that this scenario occurs more often than the price turning back around again through the pivot level, especially at S2/R2 (during ACTIVE market hours).

With stocks, it's different story. You mention that you would be looking for a cross above, and then, below S2 in a downtrend. I humbly suggest that a better strategy would be to look for a cross above, and then back down, though R2. What you are looking for here is a head fake where the market makers are shaking out the short stops, and long limit orders, before driving the market lower still. I rigorously tested, and traded, a successful system based upon this principle. To test it properly was beyond the capabilities of MS so I had to use Excel.

So, for anybody interested, here is The Holy Grail. I called it The Fade:

Long: Buy when the price crosses down through and then back above S2. Exit either when the price crosses R2 on the same day or at the close on the following day.
Short: Sell when the price crosses up through and then back below R2. Exit either when the price crosses S2 on the same day or at the close on the following day.

The problem with this strategy was getting the limit orders all in place at market open. S2/R2 are only hit perhaps 20% of the time so there are a hell of a lot of orders that expire unexecuted every day. For this strategy to work, it is essential to have the orders already in the market because the spike often happens so quickly that the move is all over by the time that you see it. I got jack of all the typing ;-).

Regards,
Kevin

At 20:47 25/04/2005 +0100, you wrote:


I was actually referring to picking tops and bottoms with just divergence indicators as being a mugs game . Sure it s possible, but I would personally much rather go about that challenge with pure fundamental analysis and any old indicator, than with purely just a divergence indicator - for all the reasons I discussed. Perhaps in that respect I am not so different from you, although I have never had any good experience with Elliot and Gann. But that s another story&

 

As to how I code it&well yes, I can understand what you re getting at. I use pivot levels s1, s2, s3 and r1,r2, r3 and then define the beginning/end of corrections on crossovers of these various levels. Therefore a correction window for a sell signal in a down trend would begin when the price crosses above the s2 level and end when it crosses back below s2, resuming the down-trend. Then I simply compare the indicator with price within this window. Of course, that means that if prices run away to the upside and don t cross s2 again for ages then I m going to get a lot of divergence signals&primarily as the first push up will often create an indicator high against which most of the subsequent price high will likely diverge.

 

I ve tried to code it to pick just the primary highs and lows and found it wanting, and so ended up with this approach. Well, like I say it works for me&

 

The chart I posted used MACD Histogram as signals. I also find that the Stochastic Momentum can give good signals.

 

Have attached another chart of GBP 60 minute with the MACD Histogram on it to show you the correction divergences on that. The red line is the r2 level&crosses below this line then back above first opens then closes the divergence window . There is one false signal that I would have ignored as it s too close to the first cross below r2. Notice again how it all goes to pot at the right hand side as the trend changes&

 

 

 





Yahoo! Groups Links