I'm playing with a long-only scalping strategy. The idea is to buy at today's
closing price and sell on the next day if next day's price reaches profit
target. Following is the simple script I wrote:
Buy = 1;
BuyPrice =
Ref(C,-1);
Sell = H > Ref(C,-1) + 0.25;
SellPrice = Ref(C,-1) +
0.25;
Hence, there are both buy and sell on the same day but the buy
actually sell occurs before buy because buy always occurs at market close.
However, the back test results show that Amibroker reversed the order of buy and
sell, i.e., instead of selling the shares purchased at yesterday's close, shares
which haven't been bought are sold. How can I tell which trade occurs first on
the same day? Thanks.