website header 2

website header 2

Sunday, February 26, 2017


“An endlessly repeating fractal; just like any market.”

Up until recently, and I mean recently the last 2 years of trading [roughly from the EURCHF debacle in January 2015 to the present], my algorithm model worked almost perfectly in markets that modeled “normal” market behavior. “Normal” defined as market price action that spanned the range from slightly less than average intraday volatility to bat excrement crazy; whether it was gold and/or USDJPY [or even EURJPY, GBPUSD, EURGBP, & SP500; I include these last 4 because we now have an “exchange floor” net trading cost structure that supports trading these markets.], the algorithm did an excellent job of modeling market behavior. There’s only one problem.

That problem is that the algorithm models a specific set of the trading universe of conditions, and doesn’t model correctly or accurately the entire population of market conditions that can and will show up in trading; it is therefore “static” when it needs to be “dynamic”, not just in parts, but in its entire structure so that we can capture market moves under ANY CONDITIONS. So, the obvious question becomes, how do I do that?

What we have witnessed in trading these last 2 years is nothing short of an evolution in trading, where as I have commented numerous times on this blog post, an evolution from what used to be “normal” to what is now today and most likely well into the future will be considered “normal”; and that “normal” is speed of light trading [SLT] followed by … crickets; rinse, repeat all day every day. SLT is not generated by a bunch of “Ma & Pa’s” sitting out in Des Moines, Iowa all of a sudden deciding it’s time to buy 1,000 Oz. of XAUUSD from a London bullion dealer; it’s of course, computer driven HFT’s [High Frequency Trading] that hit the market and drive prices quickly and sometimes violently. The M.O. [modus operandi] isn’t to allow anybody on the proverbial train as it’s leaving the station, and thus you can expect no pull backs in price to allow your trading method [no matter what it is] to participate until it’s over and everybody on the wrong side of the market is holding the bag; you’re either on the train or not, and so the question arises, “what is it that HFT’s see [via their computer code] that makes them buy/sell with abandon that can assure them [with a very high probability] profits from their activities; and more importantly, how can we spot it first before the algo’s kick in and position ourselves correctly to take advantage of the algo’s?

So, these are the two $64,000 questions that need to be addressed and solved; 1) making my volatility algorithm more dynamic in scope and not just a “special case” of a market condition, and 2) understanding what it is that the vast majority of the HFT algo’s “look for” in their millions of lines of computer code and front running the front runners!

Everybody here knows that Gann’s ‘Square of Nine’ is useful when measuring what he called the “squaring of price & time”; on it’s simplest level, it can measure price and time in a linear fashion and does a fabulous job of showing anybody the cycle at play from a move that unfolded in the past; the problem is that it has no predictive value since you have no idea on the ‘Square of Nine’ where any move will originate or go towards. It shows you a “cycle” occurred and that “cycles” are ever present in the marketplace for each and every market. Any move can just as easily take you out a level or go in a level in terms of either price or time, and any attempt to extrapolate the last move with the next one isn’t going to be accurate.

However, what I see on the ‘Square of Nine’ isn’t just a bunch of seemingly random numbers; the beautiful thing about mathematics is its abstract nature to be able to project ideas and thoughts into a coherent message, that through other branches of mathematics have meaning and significance far beyond what is possible at the moment. For example, long before computers were even a dream, George Boole invented and created “Boolean Algebra” in the 19th century; it’s the basis and logic of computer circuits and allows your computer to operate the way it does and produce the results you want from software. Similarly, Thomas Bayes is generally credited with creating conditional probability and statistics, long before anybody had any idea what a “standard deviation” [SDEV] was or why it had any significance to anything of value in the real world.

My point is this; I can use the ‘Square of Nine’ for standard deviations [SDEV] and make my algorithm even more powerful because it will cover and map all market moves, not just the ones that go to the present RM=1 exhaustion lines. In other words, I cover all exhaustion events, not just special ones.

From the candlestick chart on gold, I take the “envelope” from the indicators list and make it the following:
[click to enlarge all pics, charts, & tables]

Note that 1) the time “period” is 7 minutes, 2) the “MA Method” is simple, 3) “apply to” (median price[HL/2]), and 4) “deviation” is 0.17%. All of these settings are set to calculate a 3 SDEV move from the mean [7] of M1’s to generate a “normal” probability distribution where 99.7% of all 7 minute periods [reflected in the current real time price] are above the lower threshold [yellow] and below the upper threshold [plum].

If I take this envelope and place it on the gold chart, and make the present algorithm lines “dashed” [aqua & red = RM=1], the chart below shows what happened on February 21, 2017 as price rocketed up to the upper exhaustion line RM=1. 

For calculating the SDEV settings “Envelope” in gold [XAUUSD], I used the time periods from 12:00 – 20:00 Turnkey server time, and looked at 6,720 M1’s of 7 minute duration to insure greater than 99.999% probability that the sample size is representative of the entire population of millions of data sets of 7 M1’s. During this time, 41 times market price either went above the plum line [sell] or below the yellow line [buy]; that means that 99.53% of all 7 M1 periods will be between the plum & yellow lines, and that the lines accurately measure [as well as MT4 can measure them given the math limitations] prices within ± 3 SDEV from the mean 7 M1 price.

Here is the envelope for USDJPY directly below. 

For calculating the SDEV settings “Envelope” in USDJPY, I used the entire trading day from 0:00 – 23:59 Turnkey server time, and looked at 20,160 M1’s of 7 minute duration to insure greater than 99.999% probability that the sample size is representative of the entire population of millions of data sets of 7 M1’s. During this time, 98 times market price either went above the plum line [sell] or below the yellow line [buy]; that means that 99.52% of all 7 M1 periods will be between the plum & yellow lines, and that the lines accurately measure [as well as MT4 can measure them given the math limitations] prices within ± 3 SDEV from the mean 7 M1 price.

For brevity, I will omit the USDJPY chart, as well as the other 4 pairs I mentioned above when I started. Sometime during this week, I’ll have the envelopes of standard deviations for these other markets if you wish to trade them.

Looking at the gold chart from above, one thing should stand out to you; that is, when the market starts going rapidly up/down, the SDEV lines [yellow & plum] very quickly approach the RM=1 exhaustion values from the volatility algorithm model. This proves my point that the volatility algorithm in its current form is a “special situation” of a more general volatility model based on SDEV that is more accurate in its scope of market conditions; the former is a “one off”, the latter can handle all conditions!

Ok, now that I got that settled, time to tackle the HFT’s and what their computer code “looks for”. I know with absolute certainty, the “Quants” [PH.D. math & computer scientists that collaborate and fill up entire secret floors in non-descript suburban buildings and that are kept top secret who run, maintain, and execute the algo’s] are banking on 3 critical criteria; 1) stochastic momentum, 2) extremely high pattern recognition, and 3) trapping as many traders as possible and setting off stops so they can exit longs near the top and shorts near the bottom. In other words, outside of certain momentum methods that need time incorporated into them, price is the criteria NOT time.

Most, if not all Quants, are employed [large hedge funds, large investment banker types, and/or HFT firms] under the strictest secrecy and penalty terms you can imagine; and if they ever catch you “talking shop” with somebody outside the firm who has “no need to know” your donkey is in big trouble. These guys are more “hush hush” than CIA & NSA operatives, and guard information & computer code worth billions of dollars to their firms. So, it’s not like you can call them up on the phone and chat with them, now can you?

However, while we may not have nanosecond connections to institutional trading platforms, or direct links to a bullion house, we got the same charts and access to them as anybody else, and I have the same ability as they do to spot “pattern recognition” and its significance to trading.

There are 2 candlestick chart patterns on the M1, AFTER A MOVE DOWN OR AFTER A MOVE UP [NOT IN BETWEEN], that have extreme significance to Quants and the higher math they use in their algo’s; while fractal combinations and computations play a key role in the computer code calculations, when they are combined with these 2 chart patterns, they have a very, very high probability of success of profit; the key is spotting it before they do and acting on it before they “hit the market”.

The 2 patterns are 1) reversal pattern after a short term move to a high/low, and 2) bullish engulfing pattern after a move down or bearish engulfing pattern after a move up. If you don’t know what these are, Google them under “Japanese Candlestick Patterns” and you’ll get plenty of information to bring you up to speed.

Putting this all together, the new volatility algorithm utilizes both SDEVS & pattern recognition to spot and trade very high probability profitable trades, just like the HFT’s do; only we do it quicker and faster because we are smarter than a computer. How’s that?

Computers execute code in a linear fashion and do EXACTLY WHAT THEY ARE TOLD TO DO BY THE MATH OR MATH LOGIC; NOTHING MORE, NOTHING LESS. Computers don’t have the ability to “think”; they wait for the code to tell them to place the trade based on preset parameters and then they execute the algo. We on the other hand, can plan, see the setup, and be ready to act a hair earlier [1 – 15 seconds] than they can.

[Note: Use this same procedure for USDJPY, EURUSD, GBPUSD, EURGBP, EURJPY, & SP500 if you are going to be trading those markets. I’ll have “Envelope” values for the last 4 markets listed here sometime this week in a blog post.]

Put the “Envelope” indicator on your chart [go up top to “Insert” > “Indicators” > “Envelopes” and click]. Place the values from above for gold into the fields and finish.

Step 2.
Create a 60 minute SMA [any color but I use white] for reference purposes; this SMA [Simple Moving Average} will give you a point of reference during your trading day as to the most current floating value of where HR1 momentum is at in real time; obviously, the slope of this line [positive or negative] tells us if momentum is generally positive or negative. It also acts as a pretty good “mean reversion” point for prices to revert back to at some point.

Go up top to “Insert” > “Indicators” > “Trend” > Moving Average” and click. Use the values for all markets in the box below.

If you would like the volatility algo with the RM=1 exhaustion lines for reference, place the mq4 file onto the chart and make the aqua & red exhaustion lines “dashed”. What you are going to discover are 2 things; 1) they move exactly the same, and 2) when gold has an exhaustion move lasting more than a few minutes, the lines between the SDEV and the exhaustion lines converge to the same point; in other words, the exhaustion lines are but one subset of the SDEV lines!

Create your M1 gold candlestick and have at least the “envelope” and 60 SMA on it, and if you want the old volatility algo on your chart for the exhaustion lines, go ahead and add them; otherwise, just leave it off cuz they aren’t needed anymore due to the fact the SDEV lines will be right there when needed.

What we are looking for in gold to initiate buy positions is, 1) price to move anywhere near the bottom yellow SDEV line and/or penetrate it, 2) WAIT for either the bullish engulfing pattern or price reversal on the M1, and MOST IMPORTANTLY 3) anywhere from 10 seconds in, to the new M1 that is about to come onto your screen and cement either the bullish engulfing pattern or reversal as in fact on the M1 chart, you buy right before the current M1 changes into the new M1 and we end up front running the algo’s that will arrive shortly [not all the time, but plenty of times]. These moves down will generally be of greater significance in price than short term retracements inside an up move, and there is more profit potential on the upside to them.

Initiating sell positions is a little different, in that I’m only interested in being short if gold is lower on the day from the previous trading day close; this is easy enough to remember, or if you want make a note and place it next to you as you trade, or just check the daily candlestick. With that in mind, what we are looking for in gold to initiate sell positions is, 1) price to move anywhere near the top plum SDEV line and/or penetrate it, 2) WAIT for either the bearish engulfing pattern or price reversal on the M1, and MOST IMPORTANTLY 3) anywhere from 10 seconds in, to the new M1 that is about to come onto your screen and cement either the bearish engulfing pattern or reversal as in fact on the M1 chart, you sell right before the current M1 changes into the new M1 and we end up front running the algo’s that will arrive shortly [not all the time, but plenty of times].

Stops for both are on the other side of the engulfing pattern or price reversal.

The key developments here, over and above the previous volatility algorithm that I have been using in trading, are twofold; 1) the SDEV lines [plum & yellow] are like lines in the sand, which by definition cannot be breached but by about fractions of a percent of the time, but are not signal lines in the sense of making a trade, and 2) waiting for the proper pattern recognition to initiate a trade seconds before because I know these price patterns set off “bells & whistles” at every HFT, hedge fund, bullion bank, & LP dealer on the planet. And, those sounds you here will be for the direction we want the market to go for profit.

Not every bottom/top near, at, or exceeding the SDEV lines will see the necessary engulfing pattern or reversal; some will go a short price distance and others will go multiple $$ / Oz., but very few will fail. USDJPY PUTS THESE PATTERNS IN CONSTANTLY AT TOPS AND BOTTOMS RIGHT ALONG WITH GOLD.

From a risk profile point of view, what I don’t want to see in gold [or USDJPY for that matter either] at the bottom yellow SDEV line is what I call the “other shoe to drop” syndrome; “market price comes very close/ hits / or exceeds the yellow SDEV line, and then trades sideways for 2 – 5 minutes and then proceeds to plunge to a lower price and hit the new yellow SDEV lower in price, and thus if I get caught in this I end up selling into a falling market which we all know in gold means disaster.

All the lines mean is that the market is very extended and needs to either bounce or work off the selling pressure by going sideways, before then deciding whether to continue lower or work higher. To get the market on our side [HFT’s and others above], momentum has to change quickly; “for me, it doesn’t matter what a particular hedge fund or HFT Quant uses for their ‘top secret’ momentum code, cuz I know that no matter what it is, an engulfing pattern or price reversal [or both] will set it off once cemented on the M1 chart. Directly below, are 4 examples of reversals and engulfing patterns so you can see what I mean visually.

Now, looking at these, it should become obvious that if I took these trades a few seconds before the M1 closed, I’m beating the algo’s to the punch in most instances, and can decide once in the trade and up profits what to do with it and where to liquidate from a position of strength.

That’s not to say, that when price hits / exceeds / or comes close to the SDEV lines it doesn’t immediately turn around and move and would have been a profitable trade; it does that. But it also goes up/down “hugging” the SDEV line [yellow or plum] as it goes, thus exposing you to the “From the sky above, I’m a professional knife catcher”! … “Hey, where are all your fingers”? So to prevent this, we wait for the market, through price action, to tell us and give us the highest probability trade through pattern recognition, and knowing that all over the world computer code is “smoking” at the close of the M1 to get into the market in our direction, and at the same time having low risk and a rather tight stop below the engulfing or reversal pattern. In other words, it’s not about picking tops and bottoms; it’s about buying into the concept of “buying at 1 and selling at 3”.

Too be sure, while the look and feel of the trade may seem to some as radically different in approach than before, in reality all I have done is gone from a “special situation” where above average volatility “behaves” in what was construed as “normal” trade flow to one where ALL TRADING CONDITIONS MUST OPERATE AND BE DEFINED IF THERE IS A MARKET. The former [let’s call it “A”] is nothing more than a “singularity” of the latter [let’s call it “B”]; so, while A = B, it doesn’t mean B = A. In fact, as market conditions have shown since the start of 2015, when conditions started to change [normal to “speed of light … crickets”], the volatility algorithm started to fail as we moved into newer, far more treacherous conditions.

It would be easy, if you knew going into anything trading related what the limitations were of your model or algorithm; unfortunately, as Kurt Gödel proved 86 years ago, we can never know this with certainty. All we can ever do is attempt to learn as much as possible, all the while looking for things that refute and disprove our hypothesis. As long as things [that would be profits] move along smoothly, there isn’t any need to fix something “that ain’t broke”!

However, you can’t sit there and pretend things are “OK”, when they’re not, and somehow pretend that “once in a [name the number] year event” is unfolding before your eyes; it ain’t, it’s your model or algorithm that is faulty and needs some work.

Of course, all of this before about 5 – 10 years ago, would be impossible to dissect and analyze; before the rise of HFT’s, before negative interest rates, before central bank interventions, and before overt manipulations. Markets operated in a different universe then, with different rules, and different technology. From a practical and theoretical standpoint, with the very Quants I want to crush as the basis and foundation of my algorithm, I don’t see any way for this newer version [I’m calling it “Volatility Algorithm version 3”] to become more general in nature than it is now; the very definition of its structure is already at the outer limit, it can’t be expanded into more general terms. If there is a large sized market that is traded with good liquidity and volume, the version 3 will map it accurately!

For the very simple reason I can’t know [and neither can anybody else] what every computer generated HFT / bullion bank / or LP bank  in the world is doing to compute a change in momentum off of a bottom in prices to get it to “buy” the market, I do know that no matter the code the appropriate engulfing pattern and/or reversal in price on the M1 will do the trick the vast majority of the time. Of course, there will be tops and bottoms that don’t show these 2 patterns; fine, move on to the next one, where more than likely it will.

As we start next week’s trading, I’ll be incorporating the new version 3 volatility algorithm into my trading; I don’t foresee any problems with fills and/or “false positives” going forward. Directly below, the start of the week’s spreadsheet for the PAMM/MAM. I’ll get the new website sections for the PAMM/MAM spreadsheet and trade charts up and done in the next couple of days.


As always, I support what I write and publish; if you have any questions/comments I’d love to hear them [ ], and I will respond back with a personal message ASAP.

Have a great weekend everybody!

No comments:

Post a Comment