Sister page assignment_6_integrated_prototype

First, Complete, 5-Part Prototype

  • Nick Yeates
  • 03/22/08
  • IS698B

What was done

The conceptual Model

I put a lot of thought into the conceptual model for this project, and future projects. I have more grandiose plans of where I want this to grow into, and I look at this project as a pre-cursor and learning method in order to implement a more encompassing project.

This project conceptual design

My project is very different in conception than what we have been doing in class. My project has the notion of: Here is a past-proven method of trading that you might use into the future, based on past data. It primarily uses backtesting of technical market data, to come up with which method out of MANY methods, is best. The many methods are currently one strategy of buy and sell, with changing variables, therefore slightly modifying the strategy thousands+ times automatically. Each method is determined and run with a built from scratch evolutionary algorithm. The best of the best survive, and hopefully we end up getting a very fit-tested method and strategy.

The excel application replicates real stock market data and the trading strategy of an investor. The investor owns some cash and shares of a stock at the beginning of day 1. From then on, the investor uses a buy/sell strategy that depends on the recent stock price changes. The current strategy, described on the Inputs sheet, is a version of “buy low/sell high.” Output of this strategy is put on the Summary and Comparison sheets. You can also utilize an advanced Evolutionary Algorithm mode to have the computer automatically test thousands+ combinations of input modifications to attain the fittest output.

The power in this application is not yet reflected, but it is setup to allow future modularity for alternative strategies, new and different data, and heavy worksheet modification with no recoding effort.

The stock price, on the ‘Model’ worksheet, gets its data from Yahoo! Finance.

Downfalls

There are obvious downfalls to my method that I am aware of. Some I have plans to remove or expand, others I need to think on it longer.

  1. Generic / one-size-fits-all strategy
    • This is bad, but luckily, in future editions, I plan to include a strategy plug-in engine that I have implemented in another project
    • A strategy plug-in engine would allow infinite strategies of any kind to be easily programmed and added as functionality.
    • Even the current line of strategy in Roy’s integrated prototype could eventually be implemented
    • Neural nets are planned to be added, via some existent excel NN software found by Frank, in our class
  2. Speed will be a factor
    • Just like how long life took to evolve, many iterations (thousands, millions+) may have to occur to receive valid results
  3. Very little discreet prediction of future variables
    • My design is currently based off of not needing to discreetly know the long-term future, but to identify the fittest methods to approximating signals of now and the medium future
    • This may be changed once pluggable strategies are implemented
  4. Runs for one stock at a time
    • I am still thinking about this troubling problem, and plan to devise some solutions for it
    • It may make this application that much more processor intensive, as it may be another loop outside of the many that already exist

Dream project conceptual design

Basically, I would like to marry my current technical analysis and medium-term trading methods, with the fundamental analysis methods learned in class. I want the entire system to be very modular, and able to easily implement new data sets (news consensus data, macro data, industry data, etc). Please see my conceptual brainstorm drawings below for details. Much of it is already reflected in this current project.

  • Animated, click twice to see gif animation
  • Full plan and notes, click twice to zoom

The Implementation

The following link contains very detailed implementation notes that I did.

what_i_did

Basically I felt that I implemented most of the required concepts, with a key exception of Portfolio Optimization. I guess I am not getting the $100 million! The reason, is that I have still not crafted a solid plan and answer as to how I will implement this for multiple stock tickers, and therefore a portfolio of stocks. As you can see on my dream project concept, I have included portfolio optimization and put thought into it. I also have some ideas of how I can implement it, but it is a tougher problem than to solve in just a few weeks.

How to use the prototype

These same instructions are included on the first worksheet of the application and their original location at assignment_6_integrated_prototype.

Simulation

You can view/change the inputs first or run the simulation with the current inputs. Try changing inputs, and re-running the simulation, comparing their outputs.

Evolution

After experimenting with the simulation and inputs, you can use an automated evolutionary method of changing the inputs and re-running of consecutive simulations by clicking the Run Evolutionary Algorithm. Many simulations will run fully automated, giving many results.

Relationship to assignment

I did a reasonable job at matching the general meaning, effort, and purpose of the assignment. I did not at all match the 11 page description to a tee, but I put forth much more effort and man hours than needed. I would estimate it took me around 40 man hours to get it integrated, coded for future modifications and real world use, and documented out the wazoo. The only exception is that there is no inclusion of Portfolio Optimization. I considered it deeply in planning and sketching of the conceptual design, but I am unable to come up with the hours required for me to implement properly into my project at this moment.

Data

Compustat didn't work

At first, I was using Compustat data, it is nice and fast and integrated once you get it working. The combination of two aspects below stopped me from using it in this project. I may come back to compustat if I implement caching of data.

  1. Limited Access - Had to be in a lab on school to use it. I cant spend 8 hours in a lab on non-ergonomic stations doing work. There is also limited hours to labs and I do most of my school work at odd hours.
  2. Unintuitive to use - I could never figure out how to set and change timing aspects. I wanted to easily change what time period was shown via excel. Design aspects of the user interface and API were not intuitive and seemed outdated, like a product out of the late 90’s. Too bad we don’t have access to the online data they provide.

Yahoo! worked

Yahoo has CSV data for market data, and some financial statements. I only wanted market data for the time being, so this was kind of the easy way out. Other good stuff:

  1. Portable - Can run it anywhere with a public network connection. Although , constantly looking up stats through yahoo slows the program, I may implement a caching system or database for local data.
  2. Available - 24/7
  3. Unintuitive - But not as much as compustat. It was harder to implement my own parsers, downloader, etc, but I am now able to be more flexible to get what I want out of it.

Forecast

I did not per say forecast anything explicitly, but instead came up with mini forecasts, by trying to setup a system that will allow easy and extensive toying with buy/sell strategies.

Portfolio Optimization

This is the only category that I was unable to imagine or begin to work on integrating into my project. Because my project is from such a different viewpoint, and because it still is only dealing with single stocks, I cannot implement a multi-stock portfolio.

My future plan is to first implement another looping mechanism around the entire evolutionary process, that does it each for a different stock. Once I have results for multiple stocks, if I implement a more robust real-world trading strategy, and/or I implement Neural Nets as a “strategy”, I can imagine the system being able to feed to a portfolio optimizer.

:!: Idea to self: Either that, or I have multiple prices(stocks) as inputs from the get-go, and I am constantly calculating a portfolio risk-rewards procedure during each and every replication.

Testing

The entire project is based off of constantly backtesting over and over and over again to see which strategy / method worked the best over time in the past. We hope that because a method showed promise in the past, that it could keep it up in the future, becoming a sort of “generic solution” or at least better than “buy and hold”.

:!: Idea to self: Maybe I can use Roy’s more classical method for stock selection on good fundamentals, and value assessment, then use mine to tell me when to trade these stocks in order to do better than “buy and hold” or better than the market.

Artificial Intelligence

What I did is comparable in complexity to what was done in class, because I implemented an evolutionary algorithm from scratch and with very little formal knowledge on the subject. I had my own intuitions of evolution in general, and how it equates to the computer world and algorithms for it. I also did additional research on it, located at http://nickyeates.com/personal/school/financialitsystems_is698/assignment_5_intelligence#planning_evolutionary_algorithm

What next?

I have many ideas for where this can go. As an integrated project, my long term hopes are that this setup drastically changes or shifts to envelope more data, many more effective strategies or forecasting methods, more complex artificial intelligence, and portfolio optimization. I want technical and fundamental methods to work hand in hand, as they each have their pluses. All of this in a package that is integrated, easily expandable, modular, and real-world usable.

Feature specific, these are where I hope to take it in its current stage:

  • Modular Trading Strategies
    • I have implemented this 80% to stable in another class
    • It should not be too much work to bring over the worksheet changes and compare each function in both code modules to bring over what was written for the strategy modulation
  • Create new trading strategies
    • Use real ideas
      • MACD
      • Oscillators
  • Neural Network Use
    • At first, use one that Frank showed me
      • use it as a strategy to ‘predict’ future outputs on past data (backtesting)
      • when successful candidate found, use it to predict real future
    • Tinker with it outside of this project, see where I could go with it, how I could integrate it, or make a new project direction with NNs
  • Management of ‘Comparison’ and ‘Evolution’ data
    • Saving externally, removing/clearing garbage, etc
  • More data
    • Volume usage
    • Futures data and knowledge
    • News data, processed / quantized
    • Trending data, external factors than direct market
  • Multiple stock consideration
    • Program an encompassing loop around the Evolutionary Algorithm that does the entire process for multiple stocks
    • Integrate more input diversity and multiple stock handling and trading strategies / ability
    • For use in, or to integrate portfolio management
  • Modes: backtesting vs real-time
    • Backtesting - testing out strategies on old data to find fit strategies
    • Real-time - using data from current date back, with a known/fit strategy, in order to predict/signify buy and sell recommendations
  • Other asset classes
    • Options, bonds, forex, etc
    • These may not meld as easily into a system built for stocks
    • Strategy, forecasting, methods and learning strategies may have to focus on each asset class

Brainstorm

  • :!: Instead of having the Model sheet be just about calculating buy/sell symbols, have there be another worksheet about forecasting specifics
    • tracking, determination of fit, etc of that may want to be kept separate
    • may be more important than buy/sell signals, or complimentary at the least
    • possibility of the buy/sells to be partially based off of forecasting
  • :!: If all needed data is known, is there an algorithm/function/calculation, to the most profit that can be made assuming reasonable real-world trading limitations?
  • Neural Nets
    • Think about taking a class to learn more, program my own
      • could use existing open platforms out there, or start own
      • this is on another level, multi core computing and REAL code would be required

Connected

I have shown extensively in the section above, with the system drawings that I created, on the general flow of one system to another. Inputs/variables, determine the data that is used. Data is used to determine an outcome from a strategy instance, this is the closest to forecasting. Over many many variable changes, these ‘predictions’ at a successful strategy can hopefully be just as good as forecasting out discreet data. Backtesting is linked to most aspects, as it is central to how a fit method is determined. Artificial intelligence is used in the evolutionary algorithm that pars down the variety of methods to discover the fittest via what is basically trial and error.

 
personal/school/financialitsystems_is698/assignment_6_integrated_prototype_deliverable.txt · Last modified: 04.03.2008 19:19 by 130.85.90.36
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki