Alerts: Stop and Reverse action example


Q:  I know I can not do what I want with the Stop and Reverse action.  But, I got my best results with it and need some guidance as to how to make it work with separate study alerts.  Can you help me?  I want to be able to "emulate" as closely as possible the Stop and Reverse with separate study alerts.

A:  Your Buy and Sell signals are events, not states.   They can correspond to the green and red stripes you are putting on the chart as events.  So by way of comparison to the Stop and Reverse relationship for Sto %K being above or below 50, we could replace that with a Buy event when Sto %K Crosses Above 50 and a study alert to Buy Reverse Long.   A Sell Signal would be when Sto %K Crosses Below 50 and a study alert to Sell Reverse Short.

So we have 2 event signals, one to buy and one to sell, and separate actions taken when either signal is True.  Let me show very simple example for Stochastic.

This illustrates the Stop and Reverse action using the Stochastic Study Flag of the relationship of %K Greater Than or Equal to 50.  This flag is the relationship of %K above 50, True when above, False when below.   The Stop and Reverse action will match the Flag for direction, Long when True, Short when False.  Position matches the green and red zone colors too.   This action will automatically reverse the position when the flag changes from True to False and back again.  The relationship flag is true for many bars in a row when the green is showing.  So this is super simple, position matches flag being long or short.

If you understand that, you will realize this flag is NOT the kind of signal flags you are trying to invent.   You want a Buy signal to be True when multiple conditions are present, and you want a Sell signal to be True when other conditions are present.  So you want to Buy on the Buy signal being True, and Sell on the Sell signal being True.  Neither flag can serve as a position indicator.  Both can be false most of the time.   So False does NOT mean short, and True does not mean Long.

Therefore, the Stop and Reverse selection which tracks a flag being True=Long and False=Short  cannot be used for your system based on separate Buy and Sell signals.  Now let me convert the Stop and Reverse to separate buy and sell signals to illustrate the different approach.

The stripes show the events of when to Buy and when to Sell.

The Buy signal is now a crossing event instead of a relationship, and when it is True, we need to establish longs.   A separate Sell signal is also a crossing event and used to establish shorts.   And when no signal is present, the current position continues.

This model more closely matches your end objective.   The %K X> 50 is a crossing event that is true on one bar but not on a sequence of adjacent bars like the relationship flag of %K >=50.   With the relationship flag, True did not mean reverse..... True meant Long for the Stop and Reverse selection, and False meant short.  The action Stop and Reverse will reverse on a change of the flag state from T to F (go short) or from F to T (go Long).  Position will match the flag state.  If True and Long stay long.  If False and Long reverse short. If False and Short stay short.  If True and Short, reverse long.  So I simply think of Long when True and Short when False.


Last modified 1/16/08 5:03 PM