Next steps

I would love to be able to get a running forward-testing system going for the pleasance project. This would involve downloading the latest financial information, then training pleasance on it, and applying the trained neural-net on the latest information, and making a prediction. Then do this all over again every week. Provide a running statistic of the accuracy of the system(s). I’d like to be able to do this not just for one forex market, but for many. And not just for the forex markets, but perhaps for high-volume stocks too. And I’d like to just provide the running total and the predictions on twitter since its an easy way to get it publicized.

I’ve a problem with that, though. I don’t want to do all that work. I really don’t. Doing all that every week for one market is a pain. I don’t even want to think about having to do that for a bunch of markets. Thank goodness for computers. I’m just going to automate all of this. And once that is done, I’ll stick it in a cron-job on my computer and make it run overnight or something. That is a lot more palatable.

The following steps are a to-do list of what I think needs to get done. It will change in the future, as I work on this. They are in no particular order right now.

Figure out how to use cl-twitter.

It seems to be the best twitter interface for CL right now. Sounds good. I’ve been having issues getting started with it, but its nothing that can’t be sorted out by #lisp on the Freenode IRC network. I could definitely have used a user-manual or tutorial or something. There is documentation that is spread out over a few pages and I found it easier to just use #lisp. Or I’m just a baby. Either way, I’m just going to paste out what I did to get things started, along with info on the functions that I think I’ll find useful. With time, this may turn into the user manual I would like to have.

  • (use-package :cl-twit-repl)
  • (repl-authenticate-user) : Use (get-authenticated-user) after that.
  • (use-package :cl-twitter)
  • (user-timeline)

    This gives a list of the tweet-objects representing the last 20 tweets from the user that is presently authenticated. The latest tweet is the first element of the list.

  • (show (user-timeline))

    This will print out the information of the tweet from each tweet-object.

  • (tweet-text (first (user-timeline)))

    This will print out the text of the tweet in the form of a string. Exactly what I need.

Define-element in cl-twitter

This is a very cool macro fons created. In the EOPL3 book they talk about making new datatypes using a define-type function. Looking at the define-element macro has shown me how the define-type can be created. Glad I looked into the source code.

Create a standard for the tweets.

The updates that the program will be making will have to be in an organized way that can be parsed by the program. The information in the tweets will have to consist of the following.

  • Market that the prediction is made in. Perhaps in the official code of the currency pair or the stock
  • The prediction itself. Up or down? By what time/date?
  • Present accuracy of system. This should be in the form of a ratio of the correct predictions divided by the total predictions made.

I’m unsure what to do with information on open predictions (Predictions that haven’t expired yet.). The date the prediction was made, & the prediction itself. I could put that information in tweets and have the program parse through them everytime, or I could just save them on my own computer. It would be easier to have it saved on my computer.

Create a class for neural-nets

When the GA is done with evaluating different groups of indicators, it should return the most robust set of indicators. Then that set of indicators should be trained. Then the trained NN should be applied to the latest information and the prediction should be made.

  • Automate robust-ness identification from GA-function

    This should be a list of the top 5 (Or the the top 1) groups of indicators that showed up through the generations of the GA. Since they cropped up often enough, they can be considered to be the most robust. As opposed to looking only at the ones that made through the last generation, which might have just been luck.

    Perhaps this should be the only thing that the GA function returns since its the only thing that the GA function is supposed to look for in the first place.

  • Take the top answer from the GA-function and train it on the latest financial data. Then return the trained NN.

    Make sure that you use a validation-set to prevent curve-fitting. This is where it gets just a little bit tricky. I need to create that new datatype. Should make sure that I do this properly. Should I do a defclass, or should I just return a closure? A closure might be sufficient for my current purposes.

  • Apply the trained NN. Return the prediction.

Leave a Reply