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

Re: First Buy signal



PureBytes Links

Trading Reference Links

At 3:08 PM -1000 7/26/01, Pang, Eddie wrote:

>I'm attempting to write a very simple BUY signal based
>on a recent pivot peak value.  Ideally i would like
>to place a buy stop on the any bar that passes over
>the recent pivot peak.

I can see a couple of problems with your code.

  > PivotHighVSBar returns a bar number and you are looking
    for a price. Try PivotHighVS

  > And PivotHighVS returns -1 for error conditions. You
    need to handle that also.

You might try the following (untested).


Inputs:    Pricehigh(High), LStrenhigh(2), RStrenhigh(2);
Variables: HighPivot(0), HiPivVal(0);

HighPivot = PivotHighVS(1, Pricehigh, LStrenhigh, RStrenhigh,
              RStrenhigh+1);

if HighPivot > 0 then HiPivVal = HighPivot;

if Close Crosses Over HiPivVal then
	Buy ("PivB") at next bar at market;


Bob Fulks