Easylanguage: domain specific language for trading stocks

'EasyLanguage' should be of interest to people here. It is a domain specific langauge for trading stocks. The goal of the language seems to be to allow non-computer experts to translate their English descriptions of strategies into an expression which describes how trades should occur. An example from their manual:

"if the close is greater than the high of 1 day ago, then buy 100 shares at market"
This is written in EasyLangauge as:
"if the Close > the High of 1 day ago then Buy 100 shares next bar at market;"

I find EasyLangauge interesting for the following reasons:
1. It is designed to be used by domain experts, but not necessarily computer experts.
2. It is apparently quite popular
3. It seems to be related to the logic programming language family rather than functional or imperative langauge family.

While imperative languages are most widely known and functional languages get all the glory among the 'alpha' geeks, logic programming seems to come up again and again for 'end-users' (sql, easylangauge, rules engines).

Just like sql, easylanguage does allow users to define their own functions, but most people are not expected to do so. While researching DSL for trading environments, I keep coming back to Sean McDirmid's paper: Turing Completeness Considered Harmful: Component Programming with a Simple Language, mainly because this paper is the first one I encountered that makes a case against programming in a style which requries creation of functions ... odd since for the past two years I've been convincing myself that lambda-calculus is the be all and end all of programming language theory.

The closest paper I can find to this language is Charting Patterns on Price History. Simon Peyton Jones' famous Composing contracts: an adventure in financial engineering Functional Pearl discusses the same industry (financial markets) but isn't directly related. Obviously FRP and Data flow languages are also relevant and LtU archives contain plenty of good material.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Looks like REBOL

Stock trading is one of the classic examples of a REBOL "dialect," which is the lingo for writing a DSL in that language.

EDIT: Here's one write-up of it. Search for "stock".

Looks like AppleScript

...of which I've never been a fan. It's disconcerting to me writing in a language where some words are necessary and others are not, but are usually put in so programs read more like English. Maybe the problem is that the syntactic flexibility obscures the fact that the computer is not interpreting English, and that programming is still a precise activity.

I just released

an early version of my EasyLanguage to C# translator at http://algokit.com.

Another stock-market DSL

Stockfetcher looks like another language for the financial markets. As far as I can tell, this one can be used only to find patterns (EasyLanguage allows interaction with the market as well). This is much closer to the "Charting Patterns on Price History" paper I cited originally.

Relevant discussion.

Embedded DSLs

Seems like a strong argument for building embedded DSLs rather than standalone ones (and indeed the final sentence of the post explicitly makes that point).

I get the feeling this is

I get the feeling this is becoming the preferred approach. But it should be noted that you can embed DSLs in pure languages such as Haskell not only in ML and Lisp like languages that are impure.