From the Trading Desk
A small piece of MetaStock formula craft: LLV returns the lowest value of any data array over a chosen lookback, and one subtlety in how you use it separates clean signals from sloppy ones.
The Lowest Low Value function returns the lowest value of the selected data array across a specified number of periods. Want the lowest volume of the last 15 bars? That is one LLV call.
LLV(Data Array, Periods) The lowest closing price of the last 40 periods:
LLV(C,40) The obvious formula asks whether today's close equals the 40-period lowest close:
C = LLV(C,40) In other words: has the security just achieved a new 40-period closing low? It works, but MetaStock's formula language usually offers a sharper phrasing, and here it is:
C < Ref(LLV(L,40),-1)
This checks whether today's close is lower than the lowest low of the 40
periods prior to today, the Ref(...,-1) shifting the lookback
window back one bar so today's own bar cannot satisfy the test by itself. The first
formula asks "is today the low of the window?"; the second asks the stricter, usually
more useful question, "did today break below everything that came before it?"
Small distinctions like that are the whole craft of MetaStock's formula language, and they compound: this same pattern builds breakout systems, trailing stop logic and Explorer scans. When you write one you care about, backtest it before it touches money, and if you are learning the language from scratch, the free training videos are the fastest on-ramp.
Every technique on this blog can be tested in MetaStock's 30-day trial: full software, live data, your watchlist.
Start Your Free 30-Day Trial →30-DAY TRIAL · FULL VERSION · CANCEL ANYTIME · AFFILIATE LINK, SAME PRICE FOR YOU
More from the blog: Backtesting · Money management · Turtle trading · Time frames · Directional Movement · LLV function · All posts