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.