Powershares Water Resources Portfolio – (PHO)

PHO-051807After my Random Thoughts About Trends post, I decided to take a deeper look at one of the Water ETF’s available. I did a quick check on the Powershares Water Resources ETF (PHO) and its holdings. Despite a small correction between March and June 2006, PHO has been steadily marching upward.  I might consider adding this ETF to my 401K account.

In case your wondering, here’s what the ETF seeks to accomplish:

The investment seeks results that correspond generally to the price and yield (before the Fund’s fees and expenses) of an equity index called the Palisades Water index. The fund normally invests at least 80% of total assets in American Depositary Receipts and common stocks of companies in the water industry. In pursuit of its objective, it may invest at least 90% of total assets in American Depositary Receipts and common stocks that comprise the Palisades Water index. It is nondiversified. [via Yahoo]

[tags]PHO, Water, ETF, Investing, Trading[/tags]

9 Steps To Success In Neural Net Model Development

I’m reposting an old article from my former site about how to achieve success in any datamining or neural net/AI model development. These 9 steps were developed by my buddy, the Marketdoctor, and are in his book, Data Mining and Business Intelligence : A Guide to Productivity. If you are newbie at datamining and neural nets, I suggest picking up his book, its a straight forward and easy to understand read.

Step 1: Decide what you want to know

This is tougher than it seems. First you’ll say, oh I want to know what drives my sales but when you dig deeper you might really want to know what drives sales based on your marketing campaigns. Take the time to ask questions and really think about what you want to discover before you spend the time building the model!

Step 2: Select the Relevant Performance Measure

After you decided what you want to find out from your data, you have to identify the relevant performance measure. This essentially means what kind of metric you want to achieve for your output. Are you merely looking for a simple answer, such as is the trend UP or DOWN? Or do you want to know the age group of teenagers who buy a particular brand of your soap?

Step 3: Decide what Instance the Data will be

Next, you have to inspect the data you have at hand and decide the time frame you wish your results to be in. Do you want to know the monthly, weekly, or daily trends of your stock market models or quarterly results from your market campaign?

Step 4: Identify your Driving Variables

Once you have your data and its in the right format you want, you have to determine which variables are the likely drivers that explain what’s causing your events to occur. We discussed driving/input variables at length in Lesson I of Building an AI financial data model.

Step 5: Acquire the Data

After you’ve done all that, you can build your data warehouse. Now download and compile all your data into a spreadsheet or database. See how much thought goes into this if you want to do it right?

Step 6: Visually Inspect the Data

This is where you look for holes in your data. Often I’ve seen missing bits of data or corrupted data such as integers in a categorical columns. This gets really tedious if its volumes of data but t must be done. Tip: YALE alerts you if you have missing data!

Step 7: Transform the Data

Sometimes the raw data you have may not be presented in the best way for you to mine it and you may have to add additional calculations (standard deviations or % returns) to it. In other instances you identify the strange data spikes, called outliers, in the data sets (you should delete these).

Step 8: Mine the Data

Ah, at last! You mine the data!

Step 9: Inspect Your Results

Does the data mining output make sense? Did it meet your assumptions or did it give you something radically different. You should always review and carefully analyze your results because you never know if you made a big blunder or the discovery of the century!

There you have it folks, datamining and the building of a neural net/AI model in 9 easy steps!

[tags]YALE, Datamining, AI, NeuralNets, Howto, FAQ, Success, Development[/tags]

Random Thoughts About Trends

My wife chides me for thinking too much and spending too much time observing things. I must admit, its certainly fun to observe trends and then think of the possible outcomes if and when the trend bursts. Here are my random thoughts for this slow Sunday morning on a few trends:

Peak Oil – Although I believe in the concept of peak oil, I just don’t know when its going to happen. It could be 2010 or 2510. Still though, China will consume more oil as they catch up to us. It’s probably a smart idea to be long oil but you didn’t need a neural net to tell you that!

Alternative Energy – It’s a good idea and I’m all for it. I’m just wondering if the trends we’re seeing in this market will collapse just like it did in for the dotcom companies. Usually, a handful of the companies survive to make it to the next round after a bubble crash. Amazon and Ebay made it, did Pets.com? I don’t know enough about the players in this field to be able to pick the one that I think will survive.

Water Resources – As a civil engineer, the keystone to growth of a civilization is clean water. After water is sanitation and food production but it all starts with water. Expect more strength in the water trend as I’m sure we’ll see water wars one day as one nation builds a dam and deprives a downstream country of their water.

Crocs – I don’t get this trend but people love them. I expect Crocs to go the way of the dinosaur one day as some company will come up with a better shoe/sandal. Maybe they’ll call it O’ shit, get it? Croc O’ Shit. Never mind.

China – China’s growth will continue to trend higher as this nation emerges as the new super power. I worry about its fast growth but then again I worry too much. They’re growth reminds me of weeds that grow so fast that their root system can’t support them and they collapse. I just don’t know if a possible collapse would come from the inside (strife, rebellion, pollution) or externally (war). I very well might be wrong with my assessment and China could emerge into a nice cuddly Panda Bear instead of an aggressive Dragon.

US Elections 2008 – The Flying Spaghetti Monster wins.

[tags]Crocs, China, Water, Oil, Energy, FSM[/tags]

Building an AI financial market model – Lesson V

***The Downloads For This Lessons Have Been Updated for RapidMiner4.0***

In this lesson we will build a prediction experiment for you to test new data against and predict if Gold’s trend is UP or DOWN! Since I put you through four grueling lesson previously, I’m going to take it easy on you here and give you the completed model.

A prediction model, for trend analysis, is typically the same for every one you develop. All it really requires is a data loader for your test data, an experiment visualizer (this is not mandatory but highly suggested), a model loader, and finally a model applier. That’s it, only 4 operators are needed to complete your entire experiment!

Step 1 – Build the Prediction Experiment

This is where you get off easy, I’ve built the prediction model already for you. All you have to do is download the predictive experiment (in zip format: GA-Gold-prediction) and then load it into YALE. (click here for the RapidMiner Compatible Prediction experiment)

Step 2 – Load in the Test Data & Model

Get your test data and load into YALE through the ExcelExampleSource operator. For this example we will use the following Excel spreadsheet: GA-Gold-Test. Select this spreadsheet in the operator and make sure the label field is set at zero (your test data should not have your output label in it because this is what you are trying to predict, it should therefore be zero) and change the id field to 1 (this is for your date column).

Next load in your model (gold_final.mod) that you created in Lesson IV and that I so graciously added to the GA-Gold-Prediction zip file. (click here for the RapidMiner Compatible version)

Step 3 – Run the Experiment

Click Run and YALE will spit back the results in a few seconds. Click on the data view in the Results Tab and you’ll see your predicted trend value (UP or DOWN). Congratulations! You’ve built your first trend model and predicted the trend in Gold!

Conclusion

I hope that you enjoyed these lessons and learned a little bit about the powerful ability of YALE. When I started learning YALE, no one was there to help me. It was one heck of learning curve but after trail and error, it got significantly easier for me to create models. I would guess that it took me 9 months of learning to get to where I am now, it took you 5 lessons!

If you decide to continue with building models, I highly suggest that you continue using YALE, you’ll be surprised at what it can do. Make sure you tip me when you make that cool million trading Gold. :)

Future Lessons

In future lessons I hope to show my readers how to build a model driven by genetic feature selection and an event driven model. If you have any questions or comments, please email me or drop me a comment. If you enjoyed these lessons, please consider subscribing to my RSS feed and passing the word about Neural Market Trends around.

***Please note, the information I’m sharing with you is very valuable and FREE, there’s nothing like this available on the Internet that I know of.  Please consider becoming an RSS Reader or buying something from my sponsors.***

Bridgeway Ultra Small Co. Market Fund – (BRSIX)

BRSIX-051607

Let’s look at mutual fund trend today, BRSIX has been on a nice trend up since late 2001. I think it was at that time I wanted to buy BRSIX but never did, boy what a mistake! Well hindsight is always 20/20 and with the risk of being called a performance chaser, I’ll wait a bit before adding this bad boy to my 401K.

Although it made a new high recently, it seems to be bumping into resistance at $20.

The [fund's] investment seeks to replicate the total return for the CRSP Cap-Based Portfolio 10 index by investing in a representative sample of index companies. The fund invests at least 80% of assets in the index, which is comprised of all common stocks listed on the New York and American stock exchanges and Nasdaq, which are the size of stocks in the smallest 10% of the New York Stock Exchange. [via Google Finance]

Have a good weekend all!

Semiconductor Holders – (SMH)

SMH-051607

Howard wants to buy put options on SMH. Me? I will wait and see which way she breaks from this narrow range, which started in mid 2005, before I do anything. Has it been trading in range for that long?

My guess is that semiconductors aren’t the technology darlings they once were, maybe its because chips are more of a commodity now.

Disclosure: Long INTC from years back.

[tags]INTC, SMH, Semiconductors, Microchips[/tags]

Daytrading on Steroids

I’ve posted this article before on my old site and thought it was fitting to re-post it here. It’s a story about a company called Tradebot Systems, Inc. CEO David Cummings, a former commodity pit trader and programmer, built an Automated Trading System, or Tradebot, which trades between 50 and 100 million shares a day! Wow!

Tradebot trades 50 million to 100 million shares a day. Anywhere from 1 billion to 2 billion shares trade daily on Nasdaq.

That means billions of dollars worth of equities pass through Tradebot’s software-driven trading system each day. At any given time, you might walk in and see that the firm has traded 20 percent of Yahoo! Inc.’s daily volume.

The stock doesn’t stay for long: Tradebot starts each day holding no shares and ends each day holding no shares. It makes profits in the fractions of pennies on each share by quickly buying and selling. When all the gains are added up, you might have a $50,000 day, Cummings said.

It’s day-trading on steroids,” he said.

All the money is the firm’s. It has no customers and uses no outside capital. Instead, Cummings is slowly ratcheting up the amount of trades using Tradebot’s profit each day. He started with $25,000 in a spare bedroom of his house in 1999 [via San Jose Business Journal.

This is my ultimate goal is to build an ATS like this and I've found a worthy partner to do it with. I will be teaming with an experienced daytrader and high level programmer in the second half of the year to build a system like. I'll be bring my expertise in Neural Net's and AI to the table, hopefully we can make some money doing this!

[tags]ATS, Quantitative, Finance, Excel, Algorithms, Trading, Programming, Software[/tags]

Financial Meteor

As part of the development for my S&P500 Volatility Timing Model, I test several data sets and build several tweaked models. What I’m interested in in is finding the “outliers”, also known as the financial asteroids. These represent great opportunities for me because I usually buy either mutual funds, ETF’s, or stocks in our 401k when they happen.

GSPC OutlierIn the case of the May 10, 2007 selloff, we were hit by a small financial meteor. Take a look at the posted pic, you’ll can see a green dot which is “out there” from the regular cluster of data points. That was the financial meteor, the outlier! However, based on my model it was a small buying opportunity, nothing to get overly excited about.

[tags]Finance, Quantitative, YALE, AI, NeuralNets, Trading, Volatility, Timing[/tags]

Build an ETF Trend System in Excel

Today I wanted to share with you a part of the algorithmic back end to my ETF Trend System. Note, I said “part“, I’m not giving away all my secrets. It’s written completely in Excel, incredibly simple, and is a macro that you can import. The system works by using something called linear regression slope.

What’s that?

The easiest way to understand what linear regression slope is, is to think back to your basic statistics class. Linear regression is the “best fit” line between a bunch of data points. A line is defined by the formula: y = mx+b, where y is your data point’s position on the y-axis, m is the slope, x is your data point’s position on the x-axis, and b is the slope intercept. What this ETF Trend following system does is place a “best fit” line across several price data points (8, 13, and 26 weeks) and then calculate the slope of the line. If the slope is positive, you have an upward trending ETF. Conversely, if the slope is negative then you have a downward tending slope.

As the ETF trades in the markets, the price goes up, down, and sometimes consolidates inside a trend. When that happens the linear regression slope begins to “flatten” out, meaning the slope becomes more horizontal. When combined with two or more periods, like an 8, 13, and 26 week period, you can see the overall short-term, medium-term, and long-term trends in a particular ETF. This makes for a great indicator that warns you of either a change in trend or a dip buying opportunity.

Ready to try it out for yourself? Just follow these easy steps and you’ll be ETF Trend following in no time. First you have to make sure you have Excel 2003 or a later version installed and access to ETF data.

Step 1: Get two years of ETF data. You’ll need your favorite ETF and two years of weekly closing data. Make sure you include the date, open, high, low, and closing prices. You can cheat, and follow along with my example by downloading this XLS: GSPC ETF Trend Example

In the example contained in this lesson, I use the S&P500 weekly data but you can substitute that with any ETF or index you’d like to follow

Step 2: Copy the macro code below and paste it into your Excel Visual Basic Editor. You can find this editor by going to Tools > Macros > Visual Basic Editor.

Sub ETF_TREND()

‘ LinReg Macro
‘ Macro recorded 3/8/2007 by Thomas Ott

‘Clear Data
Columns(“G:Q”).Select
Selection.ClearContents
‘Calc ETF Trends
Range(“G1″).Select
ActiveCell.FormulaR1C1 = “8 Week”
Range(“H1″).Select
ActiveCell.FormulaR1C1 = “13 Week”
Range(“I1″).Select
ActiveCell.FormulaR1C1 = “26 Week”
Range(“G9″).Select
ActiveCell.FormulaR1C1 = “=SLOPE(R[-7]C[-2]:RC[-2],R[-7]C[-6]:RC[-6])”
Selection.AutoFill Destination:=Range(“G9:G54″), Type:=xlFillDefault
Range(“G9:G54″).Select
Range(“H14″).Select
ActiveCell.FormulaR1C1 = “=SLOPE(R[-12]C[-3]:RC[-3],R[-12]C[-7]:RC[-7])”
Selection.AutoFill Destination:=Range(“H14:H54″), Type:=xlFillDefault
Range(“H14:H54″).Select
Range(“I27″).Select
ActiveCell.FormulaR1C1 = “=SLOPE(R[-25]C[-4]:RC[-4],R[-25]C[-8]:RC[-8])”
Selection.AutoFill Destination:=Range(“I27:I54″), Type:=xlFillDefault
Range(“I27:I54″).Select
‘ Format Columns
Range(“G9″).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:=”0″
Selection.FormatConditions(1).Font.ColorIndex = 3
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:=”0″
Selection.FormatConditions(2).Font.ColorIndex = 50
Selection.Copy
Range(“G9:I54″).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = “0.000000″
Selection.NumberFormat = “0.00000″
Selection.NumberFormat = “0.0000″
Selection.NumberFormat = “0.000″
‘ Percent Change Function
Range(“J1″).Select
ActiveCell.FormulaR1C1 = “% Change”
Range(“J2″).Select
ActiveWindow.SmallScroll Down:=18
Range(“J53″).Select
ActiveCell.FormulaR1C1 = “=(RC[-5]-R[-51]C[-5])/R[-51]C[-5]”
ActiveWindow.SmallScroll Down:=6
Selection.Style = “Percent”
Selection.NumberFormat = “0.0%”
Selection.NumberFormat = “0.00%”
Selection.AutoFill Destination:=Range(“J53:J54″), Type:=xlFillDefault
Range(“J53:J54″).Select
End Sub

Step 3: Save the file and then activate the macro by clicking Run. You should see that the macro created four new columns and color coded the slopes. It should look something like this XLS: GSPC ETF Trend Example 2

Step 4: This step is optional but I highly recommend you do this. You should build a chart from that 8, 13, and 26 week slopes. This will help you identify the peaks and valleys in the ETF’s (or index’s) trend. See our last XLS example: GSPC ETF Trend Example 3

There you have it! A very simple and fun way for you to build a basic ETF trend system. Please feel free to modify the macro, or add to it as you see fit. If you have any questions or comments, please feel free to contact me.

$100 Forex Experiment – Still Trapped

This is week two of my positions still being trapped near the all time highs in the EURUSD. I had to lighten my load last week and close two more positions after the EURUSD’s plunge triggered two buy orders. I try not to have more than 4 open positions in one currency at a time and all of them remain in negative territory. Right now my average price for my position is $1.35682 and the currency pair is trading at $1.35350.

You might be wondering, why go against all trading wisdom and hold a loser. I wonder that myself but I trust my neural net models. They tell me to continue to be long. Why trust my neural net models? Good question! I trust my models because they’ve been right time and time again based on two observational methods: back-testing and real time observation. I’d agree with you 100% if you argued that back-testing isn’t as good as forward-testing, but my models are built on older data, correlated to a very high degree, and seem to be working well in the real-time environment.

Time will tell if the model is right. :)

[tags]Quantitative, Finance, NeuralNets, Euro, USD, Currency, FOREX, Trading[/tags]

Currency Trends

I fixed my Yen model and its showing the corrected trend signals.  Goes to show you, one small toggle or incorrect label designation in your prediction model and your signals are wrong.  Good thing I only had a few million at stake! :)  It’s wise to always question your results. :)

  •  AUD – UP
  • GBP – STRONG UP
  • USD – STRONG DOWN
  • EUR – STRONG UP
  • JPY – DOWN
  • CHF – RANGE

Remember, its wise to always question your results.

[tags]AI, NeuralNets, FOREX, Currency, Dollar, Euro, Franc, Pound, Money[/tags]

Timing Market Volatility (2)

I’m busy working on my S&P500 Volatility Model tonight and I’m slowly inching toward a better correlation. Despite my headway, it still needs a lot of work to be statistically significant. Right now its close to 75% correlated but I still haven’t figured out how I want to rank the volatility events.

GSPC VolI did create a nice image of how the data looks after its modeled. The x-axis is the rate of price change in the S&500 closing price and the y-axis is the volatility event (1 being severe and 0 being safe). If you squint at the image you can see a possible “U” shape outline, which means that this model could be explained by a second order function (parabola).

GSPC Vol ExcelThe next image, a chart from my Excel spreadsheet, shows the parabolic function of the modeled data.

Well, back to work!

[tags]S&P500, Volatility, Models, NeuralNet, Timing, Quantitative, Finance[/tags]