##Definition
Lookback on logics are used to determine whether a condition has occurred any time during the last few bars. This typically used with a combination of logics that do not necessarily occur at the same time (i.e on the same bar) or to check for a precondition that occurred some point in time (i.e. some time between now and the last n bars).
In this example we check for a cross over between two Simple Moving Averages at the current bar. At the same time we would like to check whether an RSI has crossed a certain level at some point during the last n bars. Using a lookback in the RSI logic we could determine whether this condition occurred within the last 20 bars (the shaded region).
Rule:
Legend:
Source: Dukascopy
The equivalent logic using the Strategy Designer can be defined as follows:
In the following example two logics are created one for verifying moving average cross overs and checking whether the moving average has been above its previous value (using an index of 1 - see index function for more details) at least once during the last 10 bars.
To create the looback condition in the designer the following steps must be followed: