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

Buy Sell Occuring at the wrong Bars



PureBytes Links

Trading Reference Links

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);


A buy should occur on the first bar with a red dot (indicating that bar
is the highest high in the last 5 bars) after a sell. Also, a sell
should occur on the first bar with a blue dot (indicating that bar is
the lowest low in the last 5 bars) after a buy. This generally happens
but a number of times the buy and sell occur on the SECOND highest high
or lowest low (see 1, 2, and 3).  Anyone have an explanation for this
behavior? (MarketPosition changes at the buy and sell bars).

Replacing "sell next bar lowest(L,5) stop" with "ExitLong  Next Bar at
lowest(L,5)  Stop" gives the same results.

Attachment: Description: ""