Archive for StrategyDesk

Google
 

TDAmeritrade StrategyDesk Formula To Exclude First 10 Minutes

I got a great question via email the other day, thought I’d share the topic. It’s been quite a while since I’ve written about (or used) TDAmeritrade StrategyDesk, and it’s now up to v1.3.

When I use StrategyDesk anymore, it’s solely for backtesting. Back in the Spring it was too slow (the updates were sometimes minutes late) to use for hair-trigger daytrading.

This question was specifically for a formula related to daytrading, however. The reader wanted a formula which would show all stocks which are up more than 3%, but only after 9:40 EST, the reasoning being that it would give the market time to “settle out” a bit and not trigger any bad trades during that wild first few minutes.

The following should eliminate all results for the 09:30-09:39:59 period:

((Bar[Hour,10] = 9) * (Bar[Minute,10] = 30) = 0)

The 3% part just goes like this: (Last > (Bar[Close,D,1]*1.03))

So all we do is connect them with an “AND” to get the final version for our screener:

(Last > (Bar[Close,D,1]*1.03)) AND ((Bar[Hour,10] = 9) * (Bar[Minute,10] = 30) = 0)


P.S.For any new visitors looking for more formulas, there’s also the StrategyDesk Formula Reference I wrote months back, before Ameritrade came out with decent user documentation. Enjoy.


TDAmeritrade StrategyDesk 1.2 - Looks Like Someone Is Listening

I just got the email today that StrategyDesk v1.2 is available. I haven’t downloaded it and played with it yet, but the email itself looks promising. Here are some tidbits that (coincidentally, serendipitously or otherwise) seem to directly address some of the complaints that have been raised in posts and comments on DummySpots:

  • DummySpots: …if you develop software of any kind (or hardware, or pretzels for that matter), when you release a new, improved version, for the sake of Judas Priest TELL US WHAT THE FREAKING IMPROVEMENTS ARE!!!

    AMTD email:“What’s new in this version?” [list follows]

  • DummySpots: …As of v1.0, SD doesn’t support different directories (”folders”) for groups of formulas- they’re all under the Formula Library list, which can get unwieldy really quickly as you save all your tweaks.

    AMTD email: “Expanded formula and strategy libraries, where you can also set up and organize your own folders for formulas and strategies you created.”

  • DummySpots: (in this article I described how to download and create your own StrategyDesk symbol list for the Nasdaq Comp and other indices that inexplicably were not included with the program)

    AMTD email: “New symbol lists: Russell 1000, NASDAQ, NYSE and AMEX.”

  • Dummyspots: …this StrategyDesk program has potential, although it’s very much like receiving a big grill with five hundred parts and no assembly instructions.

    And here: …How can I RTFM if you won’t WRITE me a decent F’ing Manual?

    And here: …So far, the most infuriating thing I’ve found about this software (including how damned slow it is) is the fact that those three stupid PDFs are all the documentation AMTD has ANYWHERE so far.

    And here: This list is a “work in progress,” and will continue to evolve until/unless Ameritrade finally publishes a decent formula reference themselves.

    And today’s AMTD email?
    “And coming soon: The StrategyDesk Help Center - your all-in-one source for support documents, webcasts, and dynamic tools to help you get the most out of StrategyDesk - which will be accessible from the Help menu at the top of the tool.”

Well, it’s nice to see they’re getting the message from their users, and are listening and trying to improve the software. I’ll probably never know for sure, but if any of those ideas came from the discussions (or the cursing) here, then it’s been well worth it. And rest assured, we’ll continue to discuss, and to curse.


StrategyDesk Formula for Highest Close of Last 5 Days

I haven’t touched StrategyDesk in quite a few days. I’m just burned out on it; I think coding an Apple II in BASIC to do this stuff would be easier. In fact, I know it would. At least we could use the word “IF”, which is apparently too advanced for TDAmeritrade to include in StrategyDesk.

Then this evening I got an email asking about a formula for the highest close of the last “x” days, or the highest open. The PriceRangeChannels function won’t give us that, because it only gives Upper, Lower, and Mid (for whatever the hell good “Mid” is). In other words, highest high, not highest close. Big difference.

I doodled for a few minutes, and here’s what I came up with (it’s getting scary how fast I can spit this junk out now):

(Bar[Close,D] * (Bar[Close,D] > Bar[Close,D,1] AND Bar[Close,D] > Bar[Close,D,2] AND Bar[Close,D] > Bar[Close,D,3] AND Bar[Close,D] > Bar[Close,D,4])) + (Bar[Close,D,1] * (Bar[Close,D,1] > Bar[Close,D] AND Bar[Close,D,1] > Bar[Close,D,2] AND Bar[Close,D,1] > Bar[Close,D,3] AND Bar[Close,D,1] > Bar[Close,D,4])) + (Bar[Close,D,2] * (Bar[Close,D,2] > Bar[Close,D] AND Bar[Close,D,2] > Bar[Close,D,1] AND Bar[Close,D,2] > Bar[Close,D,3] AND
Bar[Close,D,2] > Bar[Close,D,4])) + (Bar[Close,D,3] * (Bar[Close,D,3] > Bar[Close,D] AND Bar[Close,D,3] > Bar[Close,D,1] AND Bar[Close,D,3] > Bar[Close,D,2] AND Bar[Close,D,3] > Bar[Close,D,4])) + (Bar[Close,D,4] * (Bar[Close,D,4] > Bar[Close,D] AND Bar[Close,D,4] > Bar[Close,D,1] AND Bar[Close,D,4] > Bar[Close,D,2] AND Bar[Close,D,4] > Bar[Close,D,3]))

That will give you the highest close of the last 5 days. Do a “find and replace” on it with “open” replacing “close”, and voila, highest open of the last 5 days (much less useful than highest close, but someone may want it).

To find the highest open or close of the last 10 days, copy the above formula and follow its pattern to make a formula which is two million characters long instead of one million. Email me if you need help, or better yet, post questions in the comments to this, um, post, and we’ll hash it out with the help of all our fellow StrategyDesk haters fans.


The Wisdom of Art Cashin, and More StrategyDesk Tips

This morning I overheard Erin on CNBC speaking to Art Cashin who, along with Rick Santelli and Bill Seidman, make up the bulk of CNBC’s real wisdom all rolled into their few minutes per week of exposure.

Erin: So word has it that private investment is buying much of the subprime mortgage paper at pennies on the dollar. Is that evidence that the problem is correcting itself?

Art: Well, Erin, vultures are needed in any ecosystem…


StrategyDesk Formula-Writing Tip of the Day:

Be aware of the difference between the high of the last 30 minutes and the high of the last 30-minute bar.

StrategyDesk’s Bars are clock-dependent (for lack of a better term). Its 30-minute bars go from 0900-0930, 0930-1000, etc. If you use the Bar[High,30,1] formula at 0945, you’ll get the high for the 0900-0930 period, no matter what happened from 0930-0945.

If you want the true “high for the past 30 minutes” at any point in the day, say from 0915-0945, use the PriceRangeChannels function instead, as in PriceRangeChannels[Upper,30,0,1].


And remember the infuriating formula in the so-called Syntax Guide that goes like this

Bar[High,90]*(Bar[Hour,90] = 9) + Bar[High,90,1]*(Bar[Hour,90] = 11) + Bar[High,90,2]*(Bar[Hour,90] = 12) + Bar[High,90,3]*(Bar[Hour,90] = 14) + Bar[High,90,4]*(Bar[Hour,90] = 15)

StrategyDesk’s 90-minute bars appear to go as follows:

  • Bar 1: 0930-1059 EST

  • Bar 2: 1100-1229 EST

  • Bar 3: 1230-1359 EST

  • Bar 4: 1400-1529 EST

  • Bar 5: 1530-1600 EST

That’s right- the last “90-minute bar” is only 31 minutes long.

Anyway, from that little bit of detective work I’ve decided one error in the above formula is that the “12″ in Bar[Hour,90] = 12 should actually be a “13″. I’m pretty sure there’s a problem with the “15″ statement as well, but I’m too tired tonight to think any farther into it… more work to do here.

Update: Upon further review (and after a few hours’ sleep), the formula stands as written by AMTD. They right, me wrong. What I failed to observe last night was that the Hour part of the formula stands for the hour in which the current bar begins, and since the 90-minute bars (by my own description above) begin at 0930, 1100, 1230, 1400 and 1530, we do indeed only need statements for the hours of 9, 11, 12, 14 and 15. Dang. Happily, this realization cleared the cobwebs up enough that I can now construct various time of day formulas. Check my Formula Reference Page for updates.


TDAmeritrade StrategyDesk Formula Reference

It’s here! After hours of intensive HTML and CSS work, and many more hours of troubleshooting (I think I’m getting rusty, especially with tables), I’ve completed the first version of my StrategyDesk Formula Reference. I’m so tired of looking in forty different places for this stuff, and I figured everyone else probably is, too. So here y’go. Enjoy.


Review of Today’s COO Trade

Only made one trade today, then had to go to ICK! the full-time job and work until 10pm. Have to be back first thing in the morning, so this is going to be short and sweet.

In the one day a week I get to daytrade, I’ve evolved something of a system. StrategyDesk, with all its shortcomings, has made quite a difference in that system. This morning, I ran my old faithful Prophet.net scan for up-gappers with good volume. As usual, it returned about 15-20 stocks (actually, a little lower than normal). Since I’m using the free version, I didn’t get my list until around 0950 EST, which is fine as I don’t normally trade before then anyway.

Next, I made a custom symbol list from those results and loaded it in a realtime screener in StrategyDesk. It was very similar to the one I described a few posts back, and is solely designed to make my job easier. This one looks for a couple of simple things that I would previously have had to manually and constantly scan for (very labor-intensive):

  • A series of lower lows where the last one closes within 1% of the 5ema

  • A current bar that is threatening to break the previous bar’s high (I just have it look for “Last Price >50% of the prior bars range”)

The screener only kicked out a few stocks, exactly as it should have on a day like today. The list would only be from 0-4 stocks long at any given time… most of the time it was empty. I drank coffee, checked the Market Overview, read/wrote some email, played a little guitar.. then when a symbol would pop up, I’d look at the charts on multiple timeframes (both StrategyDesk and Quotetracker), and within about 10 seconds I’d be back to drinking and playing.

Finally it kicked out COO (The Cooper Companies) on the 1100 EST bar, and it was a beauty:

COO

I simply entered when the 1100 bar broke the 1030 bar’s high of 46.60, set the low of the entry bar (46.30) as my initial stop, and let ‘er go. She went up nicely. I had to sell on the 1130 bar, because I had to go to (choke, puke) work and couldn’t practice my stop-trailing. However, I made a nice little gain in about 30-40 minutes, and as it turns out, I didn’t miss out on much until that big run at the close.

Ah, low-stress trading. I could get used to this.


StrategyDesk Formulas

In the comments of a recent post, we’ve been discussing the construction of various formulas for TDAmeritrade StrategyDesk. The last comment was by Dave:

Let’s try this:

Buy:

RSI[RSI,14,D] < 40 AND (MACD[MACD,Close,12,24,9,D] AND MACD[MACD,Close,8,13,6,D] AND MACD[MACD,Close,5,8,4,D]) AND (Stochastic[StocK,14,3,1,10] > Stochastic[StocD,14,3,1,10] AND Stochastic[StocK,14,3,1,10,1] < Stochastic[StocD,14,3,1,10,1])

Sell:

RSI[RSI,14,D] > 60 AND (Stochastic[StocK,14,3,1,10] < Stochastic[StocD,14,3,1,10] AND Stochastic[StocK,14,3,1,10,1] > Stochastic[StocD,14,3,1,10,1])

Dave- thanks for the formula (and we finally got those escape codes working.. I went in and edited them one last time).

The Stochastics crossover is similar to the one provided in the (short, wimpy) documentation of SD, and combining it with a “loose” RSI as you’ve done is a great idea. Seems like that would prevent it from generating a signal when the “K” crosses the “D” in the bottom half of a trend. (I’m thinking, however, that we may be able to require that the Fast Stochastic simply be above a certain level upon the crossover, and we could achieve similar results).

I was confused by the MACD statements in this formula. We need some type of operator on them. We could require the (12,24,9) to be greater than the (8,13,6), or do one of those “X > Y today but X < Y yesterday” crossover statements. Alternatively, we could use the MACD Histogram formula and simply say X > 0, for when the histogram crosses the zero line.

I went and read the thread you referred to where you got the MACD info. I believe the author is confusing various things (although he’s doing a heckuva job trying to get some info out there, and I commend him for it.) He refers to “Ameritrade Analyzer” … which at first I thought meant Ameritrade’s Advanced Analyzer; but I’ve been using that one for months and there’s not a way to lay three MACD curves on it.

The fact that he just gives the parameters for the three MACDs tells me he’s talking about a chart, or possibly setting up custom columns with those figures, but that they’re not, in that form, any use in a StrategyDesk formula. I was able to place the three MACDs on a StrategyDesk Chart… but those charts just SUCK! Much better to just do the charting in QuoteTracker. Anyway, I still haven’t clearly seen where this particular combo acts as the great filter he seems to have found it to be.

Please continue the conversation in the comments to this post. Thanks!


TDAmeritrade StrategyDesk 1.1 Arrives; An Example With the TradingMarkets R2 Method

For the folks who are visiting because of my recent Saturday-morning ramble- it’s now one post down, so scroll scroll scroll; this stock stuff is the meat of the site ;-)

One quick note on The Market Today- notice all the Gravestone Doji candlesticks, particularly on the Qs. These are normally very bearish, but at the bottom of a downtrend, the fact that the buyers even made a stab at it can be a sign that the selling is weakening. Watch those stops!


StrategyDesk 1.1: Minor Improvements, Still No Documentation

As John noted in the comments to a previous post, AMTD released the 1.1 version of StrategyDesk over the weekend. The changes are very small, in most cases hardly noticeable, but they are definitely improvements, so we can at least keep hope alive.(Not a fan of Jackson’s, but his delivery in ‘88 hit that speech out of the park; if you have time, listen to the 2nd mp3 and how it builds to a crescendo like a long version of Stairway)

Let me just say right here- if you develop software of any kind (or hardware, or pretzels for that matter), when you release a new, improved version, for the sake of Judas Priest TELL US WHAT THE FREAKING IMPROVEMENTS ARE!!!. Do you StrategyDesk developers (I’m assuming there’s more than one of you) have any idea how aggravating it is to have to SEARCH for the changes like we’re working that puzzler in the funny papers where the dog’s tail is longer in one picture?? Is it too much to ask for a little info-teaser, like “Hey, try the new SD 1.1; we’ve addressed many issues including 1)this and 2)this and 3)that.”

The changes I’ve noticed include 1) the Screener and Strategy Setup windows (basically the same) are “sectioned” more clearly, making it a little more obvious what’s optional and what’s not 2) the context menus have improved in many places, notably with the options to import/export watchlists from within the Screener, and to Export Data from both the Screener and Backtester. This one seems minor at first, but it makes a world of difference when you start with a long list, say the S&P, and run it through a preliminary “filter screen” to pare it down. Rather than having to TYPE the resulting symbols into a new symbol list, you can now quickly EXPORT them into the new, “lean and mean” watchlist, on which you then apply your more complex criteria.

One other notable item - TDAmeritrade has now added a special email and phone number so we can contact the “StrategyDesk Team” directly. I’m still holding back, but I’m wanting to call and yell, “How can I RTFM if you won’t write me a decent FM?”

Using StrategyDesk to Test the TradingMarkets R2 Method

This is where a tool like StrategyDesk comes into its own. As you may know, TradingMarkets.com sells a tool called the R3/R4 method which claims average annual returns of nearly 260%. Sounds fantastic. Not fantastic as in “wow! great!” but fantastic as in “ludicrous and unrealistic”. Well, I’m here to report that after testing their publicly-published R2 system, I’m inclined to believe them. Not that you’ll make 260% per year (past performance yada yada yada), but that their system, over the specified time period, did in fact achieve that return. What will it return now? I dunno. It costs $8000, which means I can’t buy it unless I feel pretty certain it can make me $8001 over what I can do on my own. Hey, maybe it can. If I ever find out, I’ll let you know.

The R2 system is extremely simple, which is also to say, good. The name comes from the fact that their research on Welles Wilder’s RSI apparently showed that the “normal” 14-bar period didn’t return what they considered significant results, but that a very short 2-bar RSI actually did. The trading method they set up was very straightforward. It’s based on the S&P 500 index (or the related ETF, the SPYders), and simply looks for three consecutive lower-RSI2 days, with the first one being below 65 and as long as the current price is above the 200-day simple moving average. That’s the “buy” signal. The “sell” signal is even simpler: it’s the close of the day where the RSI2 subsequently hits 75. And with a 2-bar RSI, that’s usually within a couple of days.

Setting it up in StrategyDesk: Easy-greasy. Here’s the buy formula:

Bar[Close,D] > MovingAverage[MA,Close,200,0,D] AND RSI[RSI,2,D,2] < 65 AND RSI[RSI,2,D,1] < RSI[RSI,2,D,2] AND RSI[RSI,2,D] < RSI[RSI,2,D,1]

And here’s that big bad sell formula:

RSI[RSI,2,D] > 75

At first I ran the backtest, then ran it via a chart (StrategyDesk has a very neat function where it tags all the “buys” and “sells” the strategy generates on a chart, so you can observe visually whether the signals seem valid… think chart vs. spreadsheet). The results were very disappointing- at first. There seem to be a million buy and sell signals, and none of them catches the big moves. Click the chart and have a look for yourself:

SPY test

However, I then noticed that the strategy seemed to be doing exactly what they claimed: generating a ton of very- short- term trades where the vast majority of the “sells” were higher than their corresponding “buys”. (I’ve noted, as I’m sure you have, that the last signal generated was a “BUY” and it was prior to last Tuesday. Once it pops up and the RSI2 hits 75, this last trade may knock the stats down for many months back — an even better argument for the 1.00 initial stop I suggest below).

I’m a “need-to-know” kinda guy, so I naturally exported the results into Excel to do some more calcs on them.

One caveat- StrategyDesk data only go back to January of 2000. Why? Hell, I don’t know. I’ve learned by now not to ask that question regarding this software. So the results are for 1/1/00 thru 12/31/06, and you’ll note the first trade triggered was in 2003 if you download the spreadsheet. That’s because May of ‘03 was the first time the price was above the 200ma and we had the three declining-RSI2 days as required by the formula.

The results from Excel are pretty impressive, and do bear out TradingMarkets’ claim about the R2 strategy. Here they are:

  • Total Trades Triggered: 35

  • Winners: 28 (80%)

  • Losers: 7 (20%)

  • Average gain per winner: 1.15/share (+/- 0.53)

  • Average loss per loser: 0.64/share (+/- 0.35)

  • Expectancy: 0.80 (this is an extremely good expectancy, considering that a stop could be placed 1.00 below the entry without decreasing the system’s performance… for an excellent discussion of expectancy, see this great article by TraderMike)

If you want to look at the (short, boring) spreadsheet of these results, grab a copy here.

The Upshot: Would I recommend the R2 method for trading? Nope, although it apparently isn’t too shabby even in this basic form. I would definitely recommend this as an excellent starting point for experimentation. Add rules to go short. Vary the period. See what works with different stocks. I suspect this is what the TradingMarkets folks did with their “R3/R4″ system, and after this little experiment, I think I see why you’ve gotta pay to see that one!


« Previous entries