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

Re: Multiple buy signals


  • To: metastock@xxxxxxxxxxxxx
  • Subject: Re: Multiple buy signals
  • From: wander@xxxxxxxx
  • Date: Tue, 1 Jun 1999 19:41:14 -0400 (EDT)
  • In-reply-to: <000d01beabe2$5bfe3ea0$fdab7018@xxxxxxxx-A.flfrd1.on.wave.home.com>

PureBytes Links

Trading Reference Links

 You did say Monday, not first trading day.  See if this does it.

   ==Indicator==
   {Plots 1 for buys}
n:=Input("% of high to trail stop:",91,99,98);
Mon:=DayOfWeek()=1;

  {Highest High Since Monday}
hhsMon:=HighestSince(1,Mon,H);

  {Trail Stop Calc 1}
TScalc1:=hhsMon*n/100;

    {Exit Calc 1}
exitCalc1:=L{C}<TScalc1;

BuyCalc1:=If(Mon AND
                     BarsSince(Ref(exitCalc1,-1))<=
                     BarsSince(Ref(Mon,-1)),1,0);
hhsBC1:=HighestSince(1,BuyCalc1,H);
TS:=hhsBC1*n/100;
exit:=L{C}<TS;
Buy:=If(Mon AND
             BarsSince(Ref(exit,-1))<=
             BarsSince(Ref(Mon,-1)),1,0);
Buy;
------------------------

   ==Indicator==

   --{Plots Monday-only-Buy trailing stop and highest high}--

n:=Input("% of high to trail stop:",91,99,98);
Mon:=DayOfWeek()=1;

   {Highest High Since Monday}
hhsMon:=HighestSince(1,Mon,H);

  {Trail Stop Calc 1}
TScalc1:=hhsMon*n/100;

     {Exit Calc 1}
exitCalc1:=L{C}<TScalc1;

   {Buy Calc 1}
BuyCalc1:=If(Mon AND
                     BarsSince(Ref(exitCalc1,-1))<=
                     BarsSince(Ref(Mon,-1)),1,0);
hhsBC1:=HighestSince(1,BuyCalc1,H);
TS:=hhsBC1*n/100;
TS;
hhsBC1;

------------------------

      ======Test=========

==ENTER LONG:==
Mon:=DayOfWeek()=1;

  {Highest High Since Monday}
hhsMon:=HighestSince(1,Mon,H);

  {Trail Stop Calc 1}
TScalc1:=hhsMon*opt1;

    {Exit Calc 1}
exitCalc1:=L<TScalc1;
BuyCalc1:=If(Mon AND
                     BarsSince(Ref(exitCalc1,-1))<
                     BarsSince(Ref(Mon,-1)),1,0);
hhsBC1:=HighestSince(1,BuyCalc1,H);
TS:=hhsBC1*opt1;
exit:=L<TS;
Buy:=If(Mon AND
            BarsSince(Ref(exit,-1))<
            BarsSince(Ref(Mon,-1)),1,0);
Buy;

----------------------------
-------------------------

==CLOSE LONG:==
Mon:=DayOfWeek()=1;

  {Highest High Since Monday}
hhsMon:=HighestSince(1,Mon,H);

  {Trail Stop Calc 1}
TScalc1:=hhsMon*opt1;

    {Exit Calc 1}
exitCalc1:=L<TScalc1;
BuyCalc1:=If(Mon AND
                     BarsSince(Ref(exitCalc1,-1))<
                     BarsSince(Ref(Mon,-1)),1,0);
hhsBC1:=HighestSince(1,BuyCalc1,H);
TS:=hhsBC1*opt1;
exit:=L<TS;
exit;