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

EL OpenPositionProfit exit query



PureBytes Links

Trading Reference Links

Can someone help me with this query, please. It's driving me nuts!

I'm using 5 min bars and buy on the close of the day. I then want to exit if 
the OpenPositionProfit is less than, say 500.

In some cases, the next day opens way down but instead of exiting on the 
open (or near to) as I would have expected (OPP being well less than 500) 
it's either exiting on the close which is higher than the open or not 
exiting until the next bar.

The pseudo code goes like this:

if blah blah blah... then buy this bar at close; {this bit works just fine}
if OpenPositionProfit<-50 then exitlong;

Although I'm using 5min bars, the data is actually 1 min bars so I set the 
backtesting Setting to 1min but it still doesn't work. Setting it to Tick 
changes the results (even though it's not tick data) but the problem's still 
there.

In some cases it actually looks as though it's ignoring this first bar 
completely.

All suggestions most gratefully received...

Cheers,
Ian