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

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



PureBytes Links

Trading Reference Links

Hello Heitor,

Many thanks for your suggestion. It does exactly what I was asking for in 
my request for help.

However, I oversimplified what I am actually looking for. After reading the 
John Clayburg book, Four Steps To Trading Success, subsequent to JO's 
recommendation, I created most of the indicators necessary to plot 
Clayburg's trade setups on a chart. Now, I want to create a system test. In 
order to do so, it is necessary to set a flag when a "buy or sell window" 
opens (based upon oscillator crossovers) and maintain the flag's true state 
until (as I understand the strategy) a trade is entered or an opposite 
buy/sell window opens. Therefore, I need to use something more akin to 
Roy's latch idea as I cannot tell how many bars will pass until the trade 
setup, based upon short-term S/R, appears.

If anybody is interested, I am happy to post my versions of the indicators. 
I have them plotted in a "Clayburg" template.

Regards,
Kevin


At 10:02 01/10/2004 +0000, you wrote:
>Hi Kevin,
>If I understand well your request, I think you can achieve what you
>want by simply using Alert ():
>
>Alert(flag, 4) --> This maintains the true state of flag for 4 bars
>                    (including the bar that caused the true state)
>
>heitor
>
>
>--- In Metastockusers@xxxxxxxxxxxxxxx, Kevin Barry
><kevin_barry@xxxx> wrote:
> > Hello Roy,
> >
> > That's great - appreciate your help.
> >
> > Looking forward to your next newsletter.
> >
> > Regards,
> > Kevin
> >
> >
> >
> > At 08:36 01/10/2004 +1200, you wrote:
> > >Hi Kevin
> > >
> > > >>What is the most efficient way of setting a flag in Metastock?
>For
> > > >>example, say I want to enter a trade on a signal but only,
>say, if there
> > > >>has been an RSI overbought signal during the past four hours:
> > > >>
> > > >>flag:=If(Cross(RSI(14),70),1,0)
> > > >>
> > > >>initially sets the flag but it will get reset next bar. How
>can I keep the
> > > >>flag set at 1 for the next four hours?
> > >
> > >There are a number of ways you can do this. The subject will
>feature in my
> > >newsletter in a couple of
> > >months, but for now here's some latch (flag) code that should do
>the
> > >trick. You've already got the
> > >signal to set the latch and all you need is a signal to reset it.
>For my
> > >example I'll use the
> > >beginning bar of the next day.
> > >
> > >FlagSet:=Cross(RSI(14),70);
> > >FlagReset:=Hour()<Ref(Hour(),-1);
> > >Flag:=BarsSince(FlagSet)<BarsSince(FlagReset);
> > >Flag;
> > >
> > >If you want to make sure the very first signal is picked up,
>perhaps for
> > >back-testing, then the code
> > >needs an initialisation (Init) variable added.
> > >
> > >FlagSet:=Cross(RSI(14),70);
> > >FlagReset:=Hour()<Ref(Hour(),-1);
> > >Init:=Cum(FlagSet+FlagReset>-1)=1;
> > >Flag:=BarsSince(Init+FlagSet)<BarsSince(Init+FlagReset);
> > >Flag;
> > >
> > >The same thing can be done with a little less code using PREV,
>but until
> > >you have a reset signal to
> > >complement the set signal no flag or latch code can work.
> > >
> > >
> > >
> > >Kind regards
> > >
> > >Roy Larsen
> > >www.metastocktips.co.nz
> > >Free formulas and MS links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >--
> > >This message has been scanned for viruses and
> > >dangerous content by HostPlus MailScanner, and is
> > >believed to be clean, see www.hostplus.co.uk for details.
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>--
>This message has been scanned for viruses and
>dangerous content by HostPlus MailScanner, and is
>believed to be clean, see www.hostplus.co.uk for details.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/zMEolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Metastockusers/

<*> To unsubscribe from this group, send an email to:
    Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/