Hello,
I am backtesting a simple gap up strategy where I go long, if open > yesterday's close.
and exit when close > open.
gap = Open > Ref(close,-1);
pricefilter = Open > MA(open,10); // optional filter
Buy = gap;
BuyPrice = Open;
Sell = Close > Open;
SellPrice = Close;
Code itself works fine, but I noticed that some trades aren't being closed when condition is met, instead, they are executed on the next bar.
on 25th April $PEP opened at 186.5 and closed at $189.71, it should have been closed, but instead, it got closed on the next day.
I am using TC2000 EOD data.
Thanks