DSL for trading

Does anyone know of a DSL (Domain Specific Language) that implements trading semantics?

For example, it would be great to be able to say something like:

(when (and (< time 20:00)
(timing-is-right))
(trade (make-shares 100 x)))

(That's a lisp DSL).

It would be also be great if this thing handled options. So to be able to say:

(when (and (< time 16:00)
(timing-is-right))
(trade (make-synthetic-ATM-straddle 50 x)
(delta-hedge (StdDev 1))))

I am looking for one in C# or F#
 
Beyond toy examples - not really.

Maybe tradestation or one of the financial focused complex event processing solutions.
 
I am not sure a DSL makes sense. See, the main problem is that trading decisions fall into the normal programming langauge paradigm. Yes, you need some methods to do the trading, but that is just methods.

DSL are normally used when normal programming semantics do not fit. Example: SQL DDL (data definition language) expresses things that one can not normally express within a programming language (note: constructing an object tree is not the same as expressing something in the langauge).

As I said, I do not think trading is something that widely benefits from a DSL approach.
 
Quote from NetTecture:

I am not sure a DSL makes sense. See, the main problem is that trading decisions fall into the normal programming langauge paradigm. Yes, you need some methods to do the trading, but that is just methods.

DSL are normally used when normal programming semantics do not fit. Example: SQL DDL (data definition language) expresses things that one can not normally express within a programming language (note: constructing an object tree is not the same as expressing something in the langauge).

As I said, I do not think trading is something that widely benefits from a DSL approach.
Somewhat agree...

As nitro's 2nd example in his 1st post, if you're dealing with Pairs and Greek Arbs, Flow Hedges and other types of multiple legged trades... DSL helps out. Personally, all my trades are done within the normal semantics because I'm the only one using it. But I can see the benefit of it when there are multiple people handling the dev.

I know a firm that has a SQL like DSL that does things like:

Code:
"TRADE 
      SYNTHETIC_ATM_STRADDLE(OPTION.DELTA_NEUTRAL)
FROM 
      OPTIONS
INNER JOIN
      UNDERLYING
      ON UNDERLYING.SYMBOL_CODE = OPTIONS.UNDERLYING_CODE
WHERE
      OPTION.DELTA >= 1     
      AND UNDERLYING.CORP_ACTION != '1'
      AND UNDERLYING.REGION = 'US';"

* The example above in not what that firm exactly uses but it's based on what I've heard from the chick. But from she said, the query is like a SQL SELECT statement that uses TRADE instead of SELECT. Each data column represents a set or a single leg. From is the Data source. Where statement is the Analytics. Also, by changing the "TRADE" to "DISPLAY", the app. outputs a string result of the query.

I thought it was cool....
 
Back
Top