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

Delay Signals/Action Delay



PureBytes Links

Trading Reference Links

--- In amibroker@xxxx, "saltyla1" <saltyla1@xxxx> wrote:
> When Backtesting the formula bases its results for the most recent 
loop on the end of the last bars close, so in the settings window if 
I wanted to buy/sell on that close I would set it to close and delay 
0, and if I wanted to buy/sell on tomorrow's open or the open 
beginning of the next bar I would set it to Open delay 1. Is this 
correct?
*********
I was confused by that too, but I found a way that not only keeps it 
clear for me, but allows optimisation of the delay period. Consider 
this (very) basic buy formula:

buy = Ref(close, -1) > Ref(close, -2);// buys on current day using 
Open (if so selected on the Settings Page) if yesterday's close was 
above the previous day's close. (Assumes No delay on the Settings 
Page since the delay is explicit in the buy formula).

This approach allows the delay period to be optimised:

ActionDelay = Optimise("ActionDelay", 1, 1, 5, 1);
buy = Ref(close, -ActionDelay) > Ref(close, -(ActionDelay - 1);

I use this approach a lot, especially when testing contrarian 
formulas to see if they are prone to signalling early. In one case I 
found it was most profitable to wait 3 days before acting on a 
contrarian signal.

b