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

Re: Buy Sell Occuring at the wrong Bars



PureBytes Links

Trading Reference Links

There appears to be a disconnect between the lengths used in the
buy/sell order and highest high/lowest low functions. In my setup the
"length" in the buy/sell signal is set to 5 but it is looking back 6
bars including the current bar. In the indicator the highest high/lowest
low functions are set to a length of 5 bars and looking back 5 including
the current bar.

Focusing on the sell side. At the bar where a sell condition is true (
or triggered, that is, a bar that is the lowest of the last 5 including
the current one), the sell signal looks back 6 bars (including the
current one) to find the lowest bar. If the current trigger bar is lower
than any of those 5 bars ago (note the word ago) then a sell takes place
on this current bar at a price equal to the lowest low of the 5 bars
ago. 

If the low of the current trigger bar is NOT lower than any of the 5
bars ago then, on this current bar, the lowest low of the 5 bars ago can
not be reached (it is not as low as any of the 5 bars ago) and no sell
takes place on the current trigger bar. (I think this is what Phil
Kobierowski meant in his reply).

The main point is that the sell signal is setting its trigger price on
the last 6 bars (or 5 bars ago) and trigger condition on the last 4 bars
ago plus the current bar. I suppose this difference has to do with the
implied word "next" as in sell (next bar) ….stop. But I understand this
to mean when the trigger condition is meet then sell next bar.

If the length for the lowest low indicator is changed to 6 and leave
that for the signal set to 5, then no sell order appears on a SECOND
blue dot as in the previous gif.

Even tho I have figured it out (with your help) I still do not
understand why the lookback is different.

Thanks to Phil, Bilo, and Stuart for your Reponses.


>Mon, 15 Oct 2001 16:42:40 -0700

> I have a signal made up of the code below on a chart of VRSN.
> 
> buy next bar highest(h,5)   stop;
> sell next bar lowest(L,5) stop;
> 
> Also added to the chart is the indicator below which gives the red and
> blue dots
> 
> if h=highest(h,5) then plot1(h);
> if L=lowest(L,5) then plot2(L);
>