DSL for trading

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

  1. Still not sure it makes sense. Nice example, but now add the comlex stuff - multiple signals, trading logic.... without making it either a SQL style of debugging hell (i.e. one hugh statement without a proper debugger), or.... well... a generic programming langauge ;)
     
    #11     Dec 7, 2009
  2. nitro

    nitro

    Thanks. It would be a big project, but worth well doing.

    That link to NF is interesting. I have done more extensive research on it, and it looks like a good way to do it in .Net is using

    http://www.codeplex.com/ometasharp
     
    #12     Dec 7, 2009
  3. nitro

    nitro

    SQL would make a good DSL, and I have often thought about building on top of it.
     
    #13     Dec 7, 2009
  4. Actually no, SQL already IS a good DSL ;)
     
    #14     Dec 7, 2009
  5. nitro

    nitro

    A DSL makes perfect sense. I believe most of if not all of you are missing the number one reason to implement a DSL: once in place, it makes testing new systems and ideas almost trivial. Your productivity in terms of research explodes.

    One of my mentors in programming told me very early on, the best programmers don't program a solution to a problem, they implement a mini language in which the domain is naturally expressed, and then implement the solution in that system. I have never forgotten that and every day I measure how good a programmer I am by how well I am able to do this.

    So, if you needed a system to do rendering of documents, you don't program the system to render documents by running a C# program, you invent the .pdf format, and you run an interpreter capable of reading and rendering .pdf formats.
     
    #15     Dec 7, 2009
  6. chvid

    chvid

    I was told: Programming is about choosing the right set of primitives.

    The query languages of complex event processing systems look a lot like SQL:

    http://esper.codehaus.org/
    http://coffeeonesugar.wordpress.com/2009/07/21/getting-started-with-esper-in-5-minutes/

    From the example below - embedded in some Java code:

    Code:
    select * from StockTick(symbol='AAPL').win:length(2) having avg(price) > 6.0
    I remember the first editions of Hibernate; their "HQL" language was simply SQL with some search and replace - so this is not necessarily that hard to implement.

    One idea that you toy could with if you had an event query language is to bind the language together with standard Java/.NET via annontations/attributes:

    Code:
    public class MyFirstTradingSystem {
      @OnEvent("select * from ticks where price > 30.00 and symbol like 'J%'")
      public void execute(Event event) {
        // handle the filtered ticks in some standard Java code
      }
    }
    Another interesting platform - focused on model-building / model-exploring:

    http://www.quantmod.com/

    Which sits on top of R.
     
    #16     Dec 8, 2009
  7. nitro

    nitro

    I like you idea of raising an event on a pattern match native in the language. Also, thanks for the interesting links.

    I will point out that this idea sort of already exists with LINQ, if you made it "realtime". Here is an attempt to do just this:

    http://www.codeplex.com/clinq

    It is still immature to use, but it is the right idea, imo.
     
    #17     Dec 9, 2009
  8. nitro

    nitro

    #18     Feb 25, 2010
  9. januson

    januson

    This book here describes DSL amongst others: http://www.manning.com/rahien/

    DSL is interesting but one can also do a lot just by utilizing fluent interface programming :cool:
     
    #19     Feb 25, 2010