New software dev project

Discussion in 'Trading Software' started by psheridan050, Apr 6, 2008.

  1. I am considering having some software written that will contain a number of features that I believe would be a leap forward in systems development (at least to me). Here is a small list of what I would like to accomplish with this software:

    1) Stock Screening
    ---a) Custom language

    2) Charting

    3) Strategy Development
    --- a) Backtesting
    --- b) Strategy optimization
    --- c) Walk-forward optimization

    The requirements listed above are pretty typical and something that many software packages can already provide. Specifically, the charting portion of this software wouldn’t be much different than what’s already out there. What makes this package different is the custom language that will drive its main features. Basically what I want created will allow a user to write pseudo code which allows them to screen stocks, backtest trading ideas, and optimize their trading strategies. Still doesn’t sound all that revolutionary, but what I describe here is just the tip of the iceberg. The scope of this project will bring together the best elements of strategy development that are out there.

    I think the best way to get across some of what I want to do is to start off with an example of the custom language. In this example a strategy is defined and optimized:

    Approach type is short
    Equities account is $50,000.00
    If trading Capital falls below $5,000.00, then stop trading
    Initial Day Trading Buying Power is $200,000.00
    Initial Overnight Buying Power is $100,000.00
    Start Date is 10 Apr 1998
    End Date is 5 Aug 2003
    Bar Interval is 5 minute bars
    Intrabar order generation on 1 minute bars
    Maximum number of shares per trade is 5,000
    Maximum number of open positions is 4

    If shares => 500 then commission = $0.01 a share per trade
    if shares =< 501 then commission = $0.006 a share + $5.00 per trade

    Use Slippage algorithm 12

    [Entry Filter 1]
    Maximum number of entries per day is 1
    RSI(10) is above 98
    RSI(5) has been decreasing for 2 days
    Close is between $6.50 and $400.00
    Average Volume(10) is above 500,000
    Add column RSI(2) to chart
    Add column RSI(5) to chart
    Add indicator RSI(2) to chart
    Add indicator RSI(5) to chart

    [Entry Selection Criteria, Entry Filter 1]
    Close descending

    [Exit Filter 1]
    MA(5) has been increasing for 2 days

    [Exit Selection Criteria, Exit Filter 1]
    MACD fast line(3,6) ascending

    [Money Management]
    Fixed Fractional amount is 11% of the Equities Account per trade
    Trailing Stop is 2% per trade
    Profit Stop is 20% with a trailing stop of 1.5% per trade once the profit target is reached
    Time Stop is 10 days
    Break-even Stop is off

    [Optimization Settings]
    The Optimization method is brute force
    Objective Function is PROM Minus
    Maximum Drawdown per trade is 20%
    Maximum Drawdown for strategy is 15%
    The minimum Degrees of Freedom for the strategy is 90%
    The maximum amount of time the strategy is allowed to optimize is 1 day or less

    Optimize RSI(2 to 99 in steps of 2) is above 2 to 99 in steps of 5
    Optimize RSI(2 to 99 in steps of 2) has been increasing for 1 to 10 in steps of 1 days
    Optimize Volume is above 500,000 to 2,000,000 in steps of 10,000
    Optimize MA(2 to 200 in steps of 10) has been increasing for 2 to 7 in steps of 1 days
    Optimize MACD fast line(2 to 20 in steps of 1, 2 to 20 in steps of 1) ascending
    Optimize Fixed Fractional amount is 1 to 100 in steps of 1% of Starting Capital per trade
    Optimize Trailing Stop is 1 to 100 in steps of 1% of Starting Capital per trade
    Optimize Profit Stop is 1 to 50 in steps of 1% with a trailing stop of 1 to 100 in steps of 1% per trade
    Optimize Time Stop is 1 to 10 in steps of 1 days

    Walk-Forward analysis is off

    The text above essential automates the backtesting and optimization of the strategy. The program looks at the phrase combinations and that’s what determines how it will act. The different categories (such as backtest, commission, etc.) further refine how a phrase combination will be treated. BTW, please don’t too hung up on the actual strategy I defined, I just made it up on the spot for this example. Here is a general description of each category:

    This defines things such as whether or not the strategy is long or short, the account size, start and end date of the backtest, bar interval, intrabar order generation, etc. You can also define a watchlist file here if you want this backtest to be performed on a basket of stocks or a specific market. Generally, this category is used to define the framework in which all the other categories will work with.

    The user has the option on how the want to calculate commissions, if any.

    The user has the option on how the want to calculate slippage, if any.

    [Entry Filter]
    The entry filter describes what criteria need to be met in order to place a trade. There can be multiple entry filters to allow greater flexibility when placing trades, each with their own limitations. Here is another example of an entry filter:

    --- [Entry Filter 2]
    --- Close is within 2% of the top of a 90 day channel
    --- Do not trade on Tuesdays
    --- Do not trade between the hours of 09:30 to 10:45
    --- Do not trade between the hours of 14:30 to 15:00

    [Entry Selection Criteria]
    The entry selection criteria defines the order trades will be placed in. For example, say 10 stocks meet the criteria for entry. In the example given the stocks would have been shorted based on the descending close. This is important because if you limit the amount of capital you want to trade via money management, some of those 10 stocks that met the criteria cannot be traded. There is usually an entry selection criteria for each entry filter.

    [Exit Filter]
    Like the entry filter, this category defines how a trade will be exited. It can be based on an indicator, date, time, and whatever else the user can think of. Exit filters can also be limited to specific entry filters depending on the needs of the user. For example, a strategy has 2 entry conditions, and 10 exit conditions. The user can have two of the exit filters apply only to entry filter 1, and the remaining 8 exit filters apply to both entry filter1 and entry filter 2. This can allow for some very complicated exit techniques.

    [Exit Selection Criteria]
    Works the same as the entry selection criteria, except for exits.

    [Money Management]
    The money management category defines stops, the amount of shares to be traded per trade, etc. Pyramiding a trade is further described here. There can be multiple money management techniques defined, each pertaining to a particular entry filter

    [Optimization Settings]
    The optimization settings category defines the methods used to optimize a backtest. Objective functions can be defined here as well as the optimization type; brute force, genetic algorithm, etc. Minimum and maximum values can be set here as well which define acceptable performance. For instance, while the optimization engine is looking for the highest profit factor the strategy must also make a minimum number of trades to be deemed statistically significant. If this condition is not met, then that iteration is thrown out even if it has the highest profit factor. Another example is that an iteration must not surpass an intraday drawdown limit or else be thrown out.

    This is where the actual parameters are set to be optimized. Numerical variables are replaced with default range of numbers and step values. Users can change these values to suite their needs or leave them default. Items like descending, ascending, increasing, decreasing, true, false can also be optimized.

    Walk forward testing can be defined here and automatically conducted. Here is an example of the walk-forward category:

    --- [Walk-Forward]
    --- The Estimation Window is 50% the size of the backtest period
    --- The Test Window size is 12.5% the size of the backtest period
    --- The Step Window size is 12.5% the size of the backtest period
  2. ***************

    The user can also just scan the market for the current day without having to type out a huge script:

    /* Percentage of stocks with RSI(14) less than 20 */
    What percentage of stocks had an RSI(14) less than 20 over the last 100 days?

    Example 2:
    /* RSI(14) Cross below 70 */
    RSI(14) 1 day ago was above 70 for the last 3 days
    And RSI(14) crossed below 70

    The custom language is supposed to give a user near unlimited possibilities when writing their ideas. I’m sure some of you out there are thinking that this language is no match for other stuff out there, like EasyLanguage etc. To some extent this is true. It is more geared for ease of use while still getting the job done. On the other hand there is a lot more to what I want done than what I can put in this forum post. I have written around a hundred pages of stuff defining everything I want this software to be and how it will work. I’m at the point now where I need outside assistance to make it a reality. I am no programmer by any means so I am not even sure what technologies could be used to implement these ideas of mine. In any case here are some more specifics about the project:

    • If possible, I would like this to be a web-based application.
    • The software would be for my own personal use, but eventually marketed as a subscription service via a website.
    • I have a budget of around $25k I can contribute to software development.
    • I am looking for partners interested in forming a company centered on this software. Partners should bring along investment money and skills to contribute.
    • It needs to have a heavy statistics element, such as that found in the R language.
    • It will need a method to distribute optimization jobs to amongst a pool of servers.

    I would be interested in hearing people’s opinions on what I would like to do. Also, if you know of a product that performs similarly to what I want developed, please clue me in. The closest competitor I can think of is, although their feature set is much more limited.
  3. ATLien


    So specifically what you want is to create a comprehensive domain specific language (DSL), while making it easy to use, yet extensive?

    I don't know what kind of market appeal a software package like this will have for serious system developers. For example, what are the advantages of learning yet another software integrated proprietary language, as opposed to just getting a good grip on C#, python, etc.

    Anyhow, I sent you a private message.
  4. Not gonna happen. What you've just described that you want is probably at least 100 grand to get it done.
  5. Thanks for the replies.

    I’ll need to look at StataSearch more closely. On a side note, one thing some software packages offer is portfolio backtesting and optimization. With a normal portfolio you select a basket of stocks and then optimize that portfolio. But what if your portfolio of stocks is any stock over the last two years that had an RSI(14) > 95 (among other things)? With my software, that portfolio becomes dynamic. A stock is only included in it if it meets the criteria defined in the filter, and then it’s only included for as long as it meets the criteria. You can have hundreds of symbols come and go though your portfolio. What ends up happening is that you don’t develop your strategy based on a market or a basket of stocks; you develop your strategy and match stocks that fit its profile. I think this is a different way of strategy development that hasn’t been fully realized in other products.
  6. Please read the original post


  7. This seems to have much of what you want.

    - Spydertrader
  8. tradestrong,

    is ther any particular reason why you believe this? I have been told by others that what Im asking for isnt THAT hard to develop, especialy if open source is used to help with the costs. I am currently looking for partners and investors for this project, but I was under the impression the software costs wouldnt be that high.
  9. Well I've been a software developer for about a decade now. So let me rephrase this. You might be able to get a "hacked" version for that much money, but you aren't going to be able to have a well developed platform for that much money. What you are asking for would probably take 2-3 developers fulltime about 6 months to come up with a really good version of it. 2-3 developers at a cheap price of about 25,000 each for fulltime work for the 6 months.

    One developer could probably hack something together in that timeframe, but I can GAURANTEE you wouldn't be happy with it. So one developer at 25,000 could get a basic version in place for you.
    #10     Apr 6, 2008