Here is the code from the sidebar "Volatility entry advisor for MetaStock" that appeared in the February 2005 article "The Truth About Volatility" by Jim Berg.
VOLATILITY ENTRY ADVISOR


C>(LLV(L,20)+2*ATR(10))
C<(HHV(H,20)+2*ATR(10))

TOOLS, EXPERT ADVISOR, NEW, ENTER NAME, HIGHLIGHTS, NEW, NAME(BUY), 
TYPE IN CONDITION(FORMULA), OK, NEW, COLOR(RED), NAME(SELL), 
TYPE IN CONDITION(FORMULA), OK

TO APPLY TO CHART: TOOLS, HIGHLIGHT ADVISOR, ATTACH, OK


VOLATILITY TRAILING STOP INDICATOR

C-2*ATR(10)

TOOLS, INDICATOR BUILDER, NEW, ENTER NAME, TYPE IN FORMULA, OK

TO APPLY TO CHART: CHOOSE FROM QUICK LIST, DRAG AND DROP OVER CHART

TRAILING STOP P15

HHV(P,15)

THE VOLATILITY TRAILING STOP INDICATOR(ABOVE) OFTEN HAS FALLING 
VALUES AND YOU MIGHT NOT WANT TO LOWER YOUR STOP. THE TRAILING 
STOP P15 INDICATOR WILL MAINTAIN THE STOP AT THE HIGHEST VALUE 
OVER THE PAST 15 DAYS.

TOOLS, INDICATOR BUILDER, NEW, ENTER NAME, ENTER HHV(P,15) IN 
FORMULA WINDOW, OK

TO APPLY TO CHART: CHOOSE FROM QUICK LIST, DRAG AND DROP OVER 
VOLATILITY TRAILING STOP INDICATOR LINE

Combine ATR stop with P15:
HHV(C - 2*ATR(10),15)


VOLATILITY PROFIT INDICATOR

Mov(H,13,E)+2*ATR(10)

TOOLS, INDICATOR BUILDER, NEW, ENTER NAME, TYPE IN FORMULA, OK

TO APPLY TO CHART: CHOOSE FROM QUICK LIST, DRAG AND DROP OVER CHART


-Jim Berg