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

Re: [Metastockusers] Re Setting A Flag & A Clayburg System Test



PureBytes Links

Trading Reference Links

Hello Keith,

I apologise for the late response to your note. I have been down in Spain and my internet access was by way of two cans and piece of string.

First though, a caveat: the strategy that Clayburg describes in his book is a discretionary trading system. However, I have discovered from experience that discretionary trading is not my forte and so, as has recently been mentioned many times on this forum, I have adapted it to suit my own trading style, i.e. fully automated. In order to facilitate this, I have converted the indicators to give binary signals. Here is the code for the %R indicator; the other indicators that Clayburg describes can be adapted in the same way.

Create an indicator called Clay%R.

A1:=WillR(50); {Fast}
A2:=WillR(75); {Slow}

SIGNAL:=If(A1<-88 AND A2<-70 AND Cross(A1,Ref(A1,-1)),-1,If(A1>-12 AND
A2>-30 AND Cross(Ref(A1,-1),A1),1,0));
SIGNAL;

{The following code is only necessary for display purposes if required}

{Slow Overbought Window Open}

OBWO:=If(A2>-30,1,0);

{Slow Oversold Window Open}

OSWO:=If(A2<-70,-1,0);

OBWO;
OSWO;

Drag the indicator into a new window and display OSWO and OBWO in line style and SIGNAL in histogram style. If you then compare this indicator to the normal %R plot (with the same parameters), it should be clear what is going on.

Next, we need to create a flag indicating that conditions for trade entry have been met pending our entry price being hit. I shall just give you the code here for a long trade. By the way, thanks to Roy and Heitor for helping me to finesse the flag.

Clay%RLongFlag

LongFlagSet:=If(FmlVar("Clay%R","SIGNAL")=-1,1,0);
LongFlagReset:=H > FmlVar("Clayburg Cat3 H&L Stops","CAT3H")
OR
FmlVar("Clay%R","SIGNAL")=1;
Init:=Cum(LongFlagSet+LongFlagReset>-1)=1;
LongFlag:=BarsSince(Init+LongFlagSet)<BarsSince(Init+LongFlagReset);
LongFlag:=Alert(LongFlag,2);
LongFlag;

Open Clay%RLongFlag in a new window and display in histogram style.

Now we need to identify the price level at which we will enter a trade. Create an indicator called Clayburg Cat3 H&L Stops. You will know that there are also category 1 and category 2 stop levels. The code can easily be amended accordingly.

WARNING: Roy has pointed out in his recent newsletter that it is not good programming style to use forward references (e.g. Ref(H,+1) ) in MS formulas. I'm sure that he is right. However, I couldn't easily achieve my objective in this case any other way. I would most certainly suggest that you take Roy's advice in preference to mine.

Clayburg Cat3 H&L Stops

{Category 3 High}

Cat3H:=

ValueWhen(1,
   Ref(H,-3) < H AND
   Ref(H,-2) < H AND
   Ref(H,-1) <= H AND
   Ref(H,+1) <= H AND
   Ref(H,+2) < H AND
   Ref(H,+3) < H, H);
 
{Category 3 Low}

Cat3L:=

ValueWhen(1,
   Ref(L,-3) > L AND
   Ref(L,-2) > L AND
   Ref(L,-1) > L AND
   Ref(L,+1) > L AND
   Ref(L,+2) > L AND
   Ref(L,+3) > L,L);

Cat3H;
Cat3L;

Drag this indicator on to the price chart and you will be able to see where your long stop buy trade should be placed provided the Clay%RLongFlag is set. You can then decide upon your exit strategy. Try a Cat2 stop to begin with.

Now, just test on your favourite stocks and enjoy. If you need any help putting together the system test code, let me know.

Regards,
Kevin



At 09:38 07/10/2004 +1000, you wrote:
Hi Kevin, have also read his book  and would like to see your version of his indicators as you offered.
 
regards  keith

Yahoo! Groups Sponsor
ADVERTISEMENT


Yahoo! Groups Links

--
This message has been scanned for viruses and
dangerous content by HostPlus MailScanner,
and is believed to be clean.

Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links