Storing trading strategy logic

Discussion in 'App Development' started by bln, Feb 17, 2015.

  1. bln

    bln

    You run the code using an Finite State Machine that executes the algorithm.
     
    #21     Feb 27, 2015
  2. bln

    bln

    Not pointless. It gives you multiple advantages.

    - You can load new strategies on-the-fly into an running system without restarting it.
    - You can run multiple strategies at the same time in different contexts/threads.
    - You can outsource the development to external developers without giving away IP.
    - You can very easily tweak parameters and test out new ideas.

    Everyone seams to be reinventing the wheel. I have for example seen 20-30 different people implementing order management logic for IB/TWS in their language. Why not have an open-source implementation that everyone can use regardless of language and platform choice. Ex. micro-services architecture accessible through a common interface, HTTP REST or even better high-performance asynchronous messaging (NanoMsg/ZeroMQ).
     
    #22     Feb 27, 2015
    volpunter likes this.
  3. All of this is possible without crunching your logic into a particular format, or weird descriptive language. As you allude to some kind of messaging system, or decent API, would allow you to write your signal logic as a function / class without needing to learn / create a sufficiently flexible setup to handle all possible signals.

    The problem I have with other peoples implementations that I've seen on open source is that they aren't well written, and even those that aren't flexible enough. If you know what you're doing its quicker to write your own system and have 100% control, reliability and flexibility; than to work out someone elses code.

    Even in a corporate setup I've often ended up in a situation where people have rewritten the wheel because its too hard (technologist resource, politics, whatever) to get the current boilerplate system to do what you want.

    I'd happily donate some time to creating an open source implementation of my particular flavour (futures / IB / python). I'd happily release my own system, minus the 1% of actual signal generation code, except that it suffers from needing a lot of work and refactoring to make it useable to other people. It would make more sense to try and get a few people together and rewrite an implementation from scratch.

     
    #23     Feb 28, 2015
  4. how is all of that possible without scripting?

    Please can you explain how you want to accomplish both, a) human readable and b) hot swapping with, for example, a dll? We are not talking about obscure code. You can for, example, write perfectly compilable C# code pack it into a string and execute it as script via script engine. That is not revolutionary but it still meets both requirements. Nobody was talking about having to learn a new language.

     
    #24     Feb 28, 2015
  5. I've written an engine in Java with beanshell as the scripting.

    Did the same with python

    For live autotrading ended up discarding them all and used multicharts.

    Problem is I have to manually do the rollover and such, but not much hassle.

    However for backtesting and analysis I still use my custom java engine and an R
    and mathlab interface.
     
    #25     Feb 28, 2015
  6. 2rosy

    2rosy

    I was hoping for a concrete implementation. Can you show some code that does this
     
    #26     Mar 1, 2015
  7. 2rosy

    2rosy

    this thread is reinventing the wheel. The pattern is dependency injection or visitor. Both do what you want.
     
    #27     Mar 1, 2015
  8. Hmm, I fail to see how dependency injection or visitor pattern solves any of the issues OP has brought forward. The question is about storing strategy code not how to load a class library or how to resolve dependencies...


     
    #28     Mar 3, 2015