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'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
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.
http://web.progress.com/en/apama/studio.html Nettecture - I can follow you in what you are saying - and it was also my experience - I ended using a general purpose language.
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....
In terms of the previous post, I was noted that the architecture is similar to what Oracle offers: http://download.oracle.com/docs/cd/E12839_01/doc.1111/e14476/overview.htm Have fun... (Building a CEP/ESP engine from scratch is beyond my IT capacity so I'll leave the rest to the "respectable geeks" in the field...)