Crossed signals; on the 'wrong side' of the market
|Top Previous Next|
While our simple system served as a good example to help convey some basic concepts, it’s also a good illustration of one of the problems that can arise during system design.
Keep in mind that we’re still viewing things from the perspective of a potential long trade, and look at what happens around Dec-24-2000:
You can see that the 10-day lowest low actually cross above the 28-day simple moving average. The signals are now crossed, with the exit signal above the entry signal, and clearly on the wrong side of the market. The stage is now set for an entry to occur when an exit is already signaled for the same bar.
As you can see, the signals were already crossed on the day our example trade in the previous section exited. This creates an interesting scenario, since the long exit on Jan-12-2001 also happens to satisfy the condition for a long entry on the next day’s open:
IF CLOSE > COL2 THEN BUYOPEN 'long entry signal
(Think about it for a minute. Unless you are a day trader, exiting a long position today only to re-enter long at tomorrow's open probably doesn’t make a whole lot of sense.)
Mechanica automatically detects a wrong side condition and disallows the ensuing long entry, since the exit stop is not only higher than the entry price (the open of the white bar, in this case), but is literally above the price bar. (It is interesting to note that this day also happens to be a legitimate short entry signal, and in fact, a short trade is initiated the next day...two trading days after our example long trade exited.)
Wrong Side is a condition that exists when the exit is literally on the wrong side of the market. This means that either (a) the exit stop for a long trade is above the long entry price, or (b) the exit stop for a short trade is below the short entry price.
In the case of a long trade, the exit doesn’t have to be above the entire price bar for a wrong side condition to exist; it only has to be above the entry price. Likewise, in the case of a short trade, the exit doesn’t have to be below the entire price bar for a wrong side condition to exist; it only has to be below the entry price.
As we saw in the previous example, Mechanica disallows entry when the exit signal is on the wrong side of the entry price. But the existence of crossed signals alone will not prevent Mechanica from entering a trade.
If the signals are crossed and the price bar on a potential entry day has already hit or penetrated the exit stop...but the exit stop is below the designated entry price for a long trade (or above it for a short trade), then Mechanica will take the trade, and exit as instructed at the stop price...on the same day.
Shown in this chart is an example we found in 1997 that serves as a good illustration of this concept. We recorded the date it occurred, commented out our existing entries (the exit statements were left intact), and on the Trade Entry page, instructed Mechanica:
'The 28-day moving average should be a good barometer...
'IF CLOSE > COL2 THEN BUYOPEN
'IF CLOSE < COL2 THEN SELLOPEN
IF DATE = 19971125 THEN BUYOPEN
The conditional statement above tells Mechanica to go long at the opening price on Nov-25-1997...regardless of any other condition. As you can see on the signal chart in the corresponding worksheet, price has already penetrated the exit stop on the day of entry. Mechanica enters as instructed, and exits the same day on the sellstop, at a loss.