DSL for trading

Discussion in 'Automated Trading' started by nitro, Dec 5, 2009.

  1. nitro


    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)
    (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)
    (trade (make-synthetic-ATM-straddle 50 x)
    (delta-hedge (StdDev 1))))

    I am looking for one in C# or F#
  2. nitro


  3. nitro


  4. chvid


    Beyond toy examples - not really.

    Maybe tradestation or one of the financial focused complex event processing solutions.
  5. nitro


    Thanks :(

    I am seriously considering starting an open source project to do one in F#.
  6. chvid


    I'd be interested in participating.

    For my own setup I originally had a DSL I used for genetic programming but now I just have a single Java class and then use dependency injection, static imports and annotations to get a more concise definition of my trading system.

    This is thread on subject from nuclearfinance:

    http://nuclearphynance.com/Show Post.aspx?PostIDKey=116620
  7. 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.
  8. chvid


  9. 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:

          OPTION.DELTA >= 1     
    * 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....
  10. #10     Dec 7, 2009