December 29, 2009

Calling ATR and A Stop Loss Macro In TraderXL Pro

 

Yeah, I still use TraderXL Pro for a bunch of my data manipulation and technical analysis stuff. I use it to download data and run macros through it, macros that I design and then use in my trading screen. After my fucked up 2009 trading year, I had to revamp my entire arsenal of macros and screens for a brighter and more profitable future, I hope.
 
Anyway, below is one of the many macros I use in TraderXL Pro for generating an automatic stop loss using and Average True Range (ATR) function. I then suck this data into my trading screen, and through the use of other magical macros. I then determine if I have to move my stop or sit on my hands.
 
Since I love you guys, here’s the macro call for the ATR function and the stop loss. First name your spreadsheet Current_Stock_Holdings.xls (you can change this later) then copy this into the AutoRun Macro box in BulksquoteXL.
 
AverageTrueRange("G1","X");Current_Stock_Holdings.xls!Module1.Stop_loss_ATR;StockChart("OHLC","J1")
 
 
I use a 20 day time period for my ATR function, as the image above shows. You’ll have substitute “X” in the callout function above for the time period you want. It can be 5, 10, 15, or 50, whatever floats your boat and your needs.
 
Once you’ve done this, then you need to copy and paste in the macro for the stop loss function below. Make sure you save it to your spreadsheet locally. As with the ATR function, you’ll have to edit the X.X that I highlight below to a multiple that you like. It can be 1.5 or 5.5 times the ATR. This will generate wider or tighter stops based on your individual preferences. The smaller the number you input, the tighter the stop you generate. Conversely the larger the number you input, the looser the stop.
 
You can use the Macro Viewer function in TraderXL to import the macro below if you don’t know how to do it manually. Copy and paste the function between the ++++++++’s into a TXT file and then import it.
 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sub Stop_loss_ATR()
'
' Stop_loss_ATR Macro
' Macro recorded 12/15/2009 by neuralmarkettrends
'
 
'
    Range("H1").Select
    ActiveCell.FormulaR1C1 = "Stop Loss"
    Range("H21").Select
    ActiveCell.FormulaR1C1 = "=(RC[-3]-(RC[-1]*X.X))"
    Range("H21").Select
    Selection.NumberFormat = "0.0000"
    Selection.NumberFormat = "0.000"
    Selection.NumberFormat = "0.00"
    Selection.Copy
    Range("H22:H253").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
Just a side note, you might be wondering why I call the stockchart function “StockChart("OHLC","J1").” I do that so I can create a nice candlestick chart next to the downloaded data as eye candy.
 
That’s it, there you have it. Now go cause mischief!

December 28, 2009

50% Off On TraderXL Till December 31, 2009

If you're itching to buy TraderXL and have put it off, now's the time to do it.  They are offering a 50% coupon code for TraderXL and other codes for individual packages. TraderXL is the only XLS addon package that I use religiously for all my technical analysis, data manipulation, and macro writing.  Do it, its worth it!

September 30, 2008

Exciting Times

We are living in exciting times alright!  I’m happy that the bailout plan was voted down but my guess is they’ll try to get it passed again.  I’m not happy that 1.2 trillion dollars of market cap vanished yesterday but my Excel monte carlo simulations pointed to a slide to the 1100′s for the S&P500 if it broke through 1176.

I’ll update my model runs today to see where the S&P500 could go from here.  I usually tweet the results on Twitter so if you wan to be the first on your block to get them, sign up for my tweets!

PS: The market timing model issued the strongest BUY signal yet yesterday.  Even bigger than this one.

July 16, 2008

Market Price Targets

With everyone scrambling to see how low the Dow, Nasdaq, and S&P500 will go, I’ve decided to throw my Monte Carlo simulated price targets into the mix. They’ve been pretty accurate so far and I use this system to find my Forex stops and limit BUY/SELL points. I also use it for work creating complex budget risk Excel spreadsheets but you wouldn’t care about that.

The benefit of the using the Monte Carlo simulation is that you can update the model with new information and get a fresh perspective on where the “key” price areas in the market and how you can profit from them.

The price targets below are from low to high as of this week and the bold numbers are the most likely prices to be hit this week:

  1. S&P500: 1099 / 1161 / 1223 / 1285 / 1347
  2. Dow Jones: 10400 / 10800 / 11200 / 11600 / 12000
  3. Nasdaq: 1700 / 1900 / 2100 / 2300/ 2500

June 9, 2008

Achieving Financial Critical Mass (FCM)

I left work late on Friday because I got distracted running Monte Carlo simulations on our 401k accounts. I’m on a quest to refine my retirement plan of achieving Financial Critical Mass, something I heard about from Bob Brinker many years ago.

Financial Critical Mass is defined as the capital you need in your retirement accounts that will continue to grow after you retire and start withdrawing from it. In other words, your living off the interest of your investments. The trouble is trying to find the right mix of funds of stocks, with the right mix of contributions and savings to pull it off.

Most of my time after work was spent looking on the Internet for the median historical returns and standard deviation of those returns (no easy task) for the mutual funds and stocks we hold. Once I found them, I plugged them into the retirement example spreadsheet that came with Risk Amp and ran the simulations.

The result of my simulations are promising but I did identify some holes in my 401k strategy. For one, we’re not saving enough with our 401k’s alone; we must start contributing to our Roth IRA’s again. Second, we’re not being aggressive enough with our investments; I need to identify more funds with higher historical returns to add to our investment pool.

Although my market timing model helps me a great deal when it comes to making a higher return at the end of the year, I can do more to supercharge the returns on our account.

So what’s the first part of the new strategy now? First I’m going to schedule a monthly deposit of $200 into my Roth IRA and then add to my Noble Corp (NE), ExxonMobil (XOM), General Electric (GE), and Emcore Group (EME) positions!

June 6, 2008

S&P500 Price Targets

I haven’t posted price targets in a while but here’s a quick one for the S&P500 based on today’s close of 1360.

Upside Targets: 1446, 1544

Downside Targets: 1348, 1250, 1152

If you ask me, I think we’re going to see another leg down in the markets but what do I know?

March 1, 2008

S&P500: Catching Falling Knives

bear.jpgI make it a habit of “selectively” catching falling knives and yesterday was definitely such a day. I emailed my members yesterday around lunch time yesterday to tell them that my Market Timing model issued a strong BUY signal. Interestingly enough it was at the 1335 level which is right around the 1337 support level I modeled using my Monte Carlo sim.

Could the market go lower from here? It sure could and I expect it to kiss the 1291 level,just like it nearly touched the 1383 level earlier this week. So why BUY now? Why not wait till the knife hits the floor?

Well its true that this type of investing is counter intuitive. No one can every pick the bottom exactly and I’d rather buy quality mutual funds and stocks that are being sold in panic then waiting for a chart bottom to form. It seems nutty and insane but it works for me.

SPX-022508

I reiterate my downside targets from here: 1291, then 1245, then 1191. You don’t want to know the levels below that because they are downright scary!!!

February 26, 2008

How High or Low Will the S&P500 Go?

I mentioned to my members in this past week’s Market Timing Report that I would run a Monte Carlo simulation on the S&P500 to see what are the potential upside and downside targets for the S&P500.

The Monte Carlo sim confirmed my suspcisions that the the 1310 to 1340 level was indeed an interim support area and the sim calculated it as 1337. The simulation did indicate a negative bias for the S&P500 for the short term so I’m still concerned that we might see a breech of that level before we turn higher.

SPX-022508

The short term upside targets were calculated as: 1383, then 1429, and then 1475. The short term downside targets were calculated as 1291, then 1245, and then 1199.

Now, these targets were simulated using a Gaussian distribution and we all know how that distribution breaks down in very volatile markets. The chances are that if we do see more downside action, it could be violent and my downside targets would be meaningless.

February 22, 2008

Build an ETF Trend System in Excel – Part 2

 

growth-hands-seo.pngThe spreadsheet I’m about to share with you was the basic backend ETF trend system I developed for live trading. I used the RTQuotesXL and AnalyzerXL modules from TraderXL Pro to download the data in real time and create momentum signals on the fly. Note: clicking on the links will download a 10 day FREE trial version of the software, I suggest you do and fool around with it.

 

I spent countless of hours building this spreadsheet (ETF_Trend_System_020808.xls) but have abandoned its development for the time being. For the first time ever, I’m making it available for download on this site. I make no guarantees or warranties for this spreadsheet but I ask that if you modify it, change it, update it, or make it better in anyway to please share it with the world. I want this spreadsheets development to follow the GNU license that covers Linux's development.

Download it and play around with it. I hope that it will be of use to you. As always, if you have any questions, please leave me a comment.

Note: You must have TraderXL Pro installed to use this!  I will post more details about the spreadsheet and what each column means later!

January 19, 2008

Why I Use RiskAMP

A few years ago I got fascinated with Monte Carlo simulations after this application appeared in my 401k plan. At the time they had this “what if” calculator where you enter your age and then the amount you plan to save yearly in the 401k. You’d have to select how you wanted to invest your money, aggressively, middle of the road, or conservatively. After a few seconds of the application running in the background, a mini report would pop up and say:

Mr. Ott, if you invested $10,000 a year in an aggressive 401k portfolio you could end up with an account balance of either $500,000 or $2,300,000 by age 65.

I was intrigued, how did this 401k website know this? A short while later I realized it was a Monte Carlo simulation that was behind it all.

Since that time I started looking around for a good Monte Carlo simulation but come to find that they cost several hundreds to thousands of dollars. Since I’m frugal (cheap), I decided to see if there were any Excel Addin’s out there for free. I did find a few really feature lacking free Excel Addin Monte Carlo Simulations that didn’t impress me too much.

Then I stumbled across RiskAMP and was surprised by the power of this little Addin.

RiskAMP is a feature rich and tightly intergraded Excel Addin that lets you run all kinds of Monte Carlo simulations. It comes with a chart wizard, over 20 simulation functions, and over 35 random distribution functions. You can model simulations to your hearts content, all in the comfort of Excel. Once you run the simulations you can create a simulation results sheet complete with charts, all with a few clicks in the menu system.

Do you want to model at standard Gaussian distribution? RiskAMP does it.

Do you want to model a Pareto distribution? RiskAMP does it!

What about Binomial distributions? Geometric distributions? Multivariate distributions? Power distributions? Yes, yes, yes, and YES! RiskAMP can do it all!

RiskAMP is the primary simulation system I use to model my stop placement in the Forex Market. I won’t tell you how I do it (trade secret) but since I started modeling possible currency volatility outcomes, I’ve been able to place my stops just outside of the volatile price swings and stay in the game. This lead to swinging the probability in my favor and to the much enjoyed success of my $100 Forex Experiment last year.

I’ve also used RiskAMP to model the outcomes in my controversial “When Traders Blow Up” post and I continuously use it to model volatility outcomes for various stocks. Combined with RapidMiner and TraderXL Pro, RiskAMP has contributed greatly to my bottom line over the last year and I look forward to building more “what if” scenarios with it.

Just for fun, I’m attaching a few of the sample spreadsheets that come with the RiskAMP trial. You’ll need the Addin to make it work but you can test out some of the powerful things you can do with it (all Excel spreadsheets).

I suggest my readers take advantage of the RiskAMP free trial to try out the software. I opted to buy the Personal Edition and quickly realized what a steal that was. As always, if you have a question, please leave me a comment. Please subscribe to my feed on the way out.

January 17, 2008

Stocks Get Clobbered – Market Timing Model Successful!

SP500 Timing 011708I’m still at the spa enjoying the recent market insanity. It’s days like these where I’m reminded how awesome my S&P500 Timing model is (members get my weekly report). I’m glad I took its advice and sold my major holdings in mid December (and October) and moved my money into more defensive assets like bonds and cash.

Still though, the timing model actually issued a BUY signal today (see image), so it looks like we might have formed an interim bottom. I’m debating making a small buy here but I haven’t made up my mind, I sometimes don’t act on all the BUY signals the model gives me but I religiously follow its SELL signals.

Who knows which way the market will go but if it breaks down from here you can bet that 1250 will be the S&P500′s next stop.

PS: I created this model using Rapidminer and TraderXL Pro.

January 5, 2008

Using TraderXL Pro to Download Data for RapidMiner Modeling

data.gifIt’s no secret that I use TraderXL Pro to download the majority of my Stock, Future, and Forex data that I use for RapidMiner modeling. I use the BulkquotesXL module because it’s able to download daily and weekly data from Yahoo and daily price data from the PiFin data source. Usually it downloads the data into separate tabs in your spreadsheet, which is nice but a pain to manipulate if you want to create a summary sheet to load into RapidMiner.

Have no fear, TraderXL Pro has a built in macro called “TickerHeader” that you can run automatically as you download your data into a nice summary sheet. This macro will runs automatically for each asset symbol you list and place it into a data column. The next symbol will be placed in the following column and so forth. You can download my template her: TickerHeader Macro Template

This should cut down, considerably, your data downloading process and get you modeling sooner!

However, if you want to build my spreadsheet from scratch, you have go through the following steps below and set a few parameters in the BulkquotesXL:

Step 1 – Create a new project

Step 2 – Enter your asset symbols into column A (see my example spreadsheet)

Step 3 – Enter the data range to download (columns B and C)

Step 4 – Select the period to daily (column D)

Step 5 – Enter the word “Summary” in column F

Step 6 – Enter the values “A1″, “C1″, “D1″… (Without the ” “. Why you skip B1 will become clear as you read further along)

Step 7 – Set your data source (Yahoo or PiFin). If your downloading data from more than one data source, you have to enter its name in each row.

Step 8 – in the Data Field column enter “C” for close but in cell I3 enter “D;C”. This will place the Date field of the downloaded asset in A1 and then the closing price in B1.

Step 9 – Enter “TickerHeader” into the Autorun Macro column J.

Then click Download/Refresh Data and your done! The TickerHeader macro comes stock with BulkquotesXL module and has made my data downloading life a lot easier.

As always, if you have questions please leave me a comment or email me via my contact page. On your way out, please subscribe to my feed!

Next Page »