Building an AI financial market model – Lesson II

Alright class, let’s get started! Before we begin with today’s lesson, we should review the four key questions we asked about building an AI financial market model in Lesson I, they were:

  1. Do I have the right software?
  2. What do I want to model? What are my input and output variables?
  3. Do I have the financial data to model with?
  4. Is the data in the right format?

Hopefully you’ve answered all these questions by now and have downloaded and installed YALE. If not, I suggest you review Lesson I before continuing with this lesson.

In this lesson we’ll do two important things:

  1. Review the input variable spreadsheet
  2. Build the output variable (trend)

Please feel free to email me or post a comment if you have questions or need clarification on anything covered in today’s lesson.

Review the input variable spreadsheet

For those who have decided to use our lesson example (Gold trend), and have downloaded the GA-Gold.xls, please open up the spreadsheet. Once you’ve opened the file, you should see something like this.

GA-Gold Example

The GA-Gold.xls spreadsheet should contain 8 columns, 1 for the date, and 7 others for the input variables we identified in Lesson I. If you remember back to Lesson I, we discussed the relationship between input and output variables. The input variables is the data that drives your output variable; in this example the Gold trend. You’ll notice that our spreadsheet only contains input variables and no output variables. How are we going to get our output? What do we do now? The simple answer is, we roll up our sleeves and build the trend!

Build the output variable (trend)

For this portion of the lesson you’ll need to find a chart of your asset or security and identify the UP, DOWN, or RANGE trend area. For the lesson example, just download a chart of Gold prices from 1997 through today and look at the areas where Gold is in a DOWN, UP, or RANGE trend.

Tip: Make sure that the chart you use covers the data range you plan model. It’s best to use a slightly larger range to help you inspect the chart visually and not miss any key information at the edges.

Gold Lesson Example II

 

Now comes the hardest part of this exercise, add a column called “GC Trend” to the GA-Gold.xls and enter the words UP, DOWN, or RANGE in the GC column as it relates to the date shown on the Gold chart and on the spreadsheet. What you are doing is building the output variable of the model and when we run the AI analysis, the software will find relationships between your inputs and the output to generate UP, DOWN, or RANGE signals when you test the model later with new data.

Tip: You can add other words like STRONG UP or BUY if you like. It depends on what words you want to use to describe the trend.

When you’re finished, your spreadsheet should look something like this:

Gold Example Final Input

 

Now, save your spreadsheet under another file name. This new spreadsheet becomes the input data you will build your trend model from. Of course you can skip all this hard work and download the lesson example spreadsheet: Gold Final Input.

Tip: Save this spreadsheet! Every 3 months or so, you should more input data to this spreadsheet and re-optimize your model. This is important because the market changes all the time and new patterns and relationships emerge. All you have to do is add UP, DOWN, or RANGE to GC Trend column.

Congratulations! Your hard work is now complete! The work gets easier from here on but we still have to cover a lot of ground! The next step will be to build the AI experiment, load in your spreadsheet, and create a model! We’ll tackle this in Lesson III and Lesson IV.

About Tom

Blog owner of Neural Market Trends
This entry was posted in Neural Nets, Tutorials and tagged , , . Bookmark the permalink.

7 Responses to Building an AI financial market model – Lesson II

  1. Nick says:

    Great site, I’m just beginning to investigate all the things RapidMiner can do, and will be waiting for the rest of your lessons.

  2. Tom says:

    Nick, I’m glad you enjoy the site. Spend some time looking through the archives, there’s a lot of good stuff there.

  3. Pingback: Building an AI financial market model – Lesson I | Neural Market Trends

  4. michael says:

    Where the hell are lessons 3 and 4?

  5. Tom says:

    michael: Visit the Tutorials section or check out the “Top 10 Posts” in the left sidebar.

  6. I made a tutorial for one of my professors. It exceeds the limit to send it so I will post a zip file for you on my website tomorrow. Let me know what you think. The button will be called RapidMiner.

  7. Tom says:

    Kyle: Thanks. I downloaded it and will check it out later today.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>