Francis D. from Australia likes to bounce different EA ideas off of me. He mentioned in the latest emails a fear of getting whipsawed from a signal that is either long or short.
This type of problem occurs all the time. I first encountered it with a simple strategy that fades price crosses over the moving average. Whenever the price crosses and closes below the moving average, go long. Shorts follow the same rules. It’s the kind of stupid simple range trading strategy that I always advocate.
The example above highlights the same thing that Francis complains about. The price floats around the moving average without going anywhere.
Random Outcomes
Trades based on the price crossing above the SMA come out near breakeven. Winners occur approximately 66% of the time and are one third the size of losers. Such a strategy neither makes nor loses money when ignoring trading costs.
The vast majority of the winners in the strategy are teeny tiny. The strategy encounters its maximum opportunity whenever it is closest to the SMA. The further away it goes, the more likely it keeps going the wrong way.
Flipping the trades still yields a random outcome. The only difference is that winners drop to 33% accuracy, but the average winner is now 2:1.
The Birth of a Trading Strategy
I always wonder how a scaling strategy might affect the outcome. If the strategy is most likely to win when the opportunity is smallest, what happens when the strategy attempts to reduce its position size as the market moves adversely?
Alternatively, what happens if it takes a pass on all the small winners and scales into positions? Yes, it will scale into losers, but it should also make resulting winners bigger. The question then becomes how to decide the rate of scaling and when to bail out of losers.
Thank you, Francis! A new blog series is born. Now that I’ve decided to scale into trades, I need to choose how and when to do it.
Nothing insightful or special jumped to mind. I’m a visual person, so I spent the better part of this afternoon creating the little chart in Excel using NinjaTrader. What starts out as a simple project always grows on itself. It took nearly 4 hours to get the information and formatting correct.

The graphs displays the percent distance of the price from the SMA against frequency (i.e., how often is the price this far from the 200 SMA?)
I care about scaling into trades as the price moves further from the 200 SMA. My instinct from looking at the graph above says I should focus on the inflection point. The curve forms a nice bend around 0.3% away from the SMA. Maybe I can start buying at the inflection point until I get to 0.6% or so.
What do you think I should do?
After-thoughts
This series eventually led to a profitable trading strategy. If you’d like to read through the journey, then I suggest reading the articles sequentially
Selecting an appropriate time frame
A research plan
An annoying surprise in the initial backtests
An attempt at range trading
Range trading results
The moving average envelope scalper
Hi,
I don’t have programming skills even if I understand some concepts. For me, this time frame is too short for this ema or this pair is too volatile. Also, I prefer to use an indicator like Laguerre Filter to get less whipesaws for a strategy of this type.
JC
Thanks for weighing in!
The EMAs (50 and 200 are good pairs) create tunnels during hard trends between the MAs and the pice.
It is these channels that you need to recognize early in their development. This involves a lot of basic theory in terms of how the MAs move in relation to the price and to each pother. The MACD tries to get in on this but it has short comings. Price action and shrap inflections are the usual precursors to a channel. There are varying degrees of channels smal medium large, however if you cna draw enev or take a small loss of 9 pips on the small channels that are hard to filter nad get 30 pips on the latger ones with a safety buffer of pips at the bottom end then you can be safe. So there oyu have a basic theory and if you put the MAs I mentioned above and look for price move ment (an iron cross of the 50 and a good separation between the price and the 50 MA ten oyu have the basics. The formulas are not that hard but if oyu have the basic concept you should be good. Study theses 2 MAs and how the price operates in relation to these and you will find a way to see the precursors and formulas require dto do ht etrade robot (EA). Good luck it is harder than it sounds.
Shaun,
The above description does not indicate the time frame being utilized, only the use of the 200MA. I agree with the above comment. Never had much success with only one indicator. Usually need two or more to filter out the noise.
Aaron
Hey Aaron,
Thanks for the comment. I’ll turn to filters as the final step for polishing the strategy.
Many posters pointed out that I left out the time frame. The above data was created using M1 charts. Before everyone has a heart attack at the idea of trading M1 charts, I’ll explain why it’s not as crazy as it sounds.
For scaling in a grid type of methodology can be used set so that it has a trailing stop and as you a new trade the previous one has had a StopLock, stop loss set to break even or better. Now you have only the new trade that can go negative. As you repeat this process you can have a percent trailing stop…which can vary by the position you picked it up on the chart. If the position is close to the MA then you may give it a different magic number and then treat it slightly different than a farther away trade.
Generally, in range it would be better to have short TP values and in Trend larger TP values with the scaling. For the range I would suggest not scaling as you don’t really expect it to go anywhere.
Also, in the range you will want to bias towards the MA or center of price action. In trend you want to bias outward so that you profit from a directional move.
Nice,
It seems to me the farther you get form the SMA the more likely it is to return back across the SMA. Entering a trade at the inflection point seems to be a good place but one must understand the trend first. If you have a trend you can trade against it but the bid should be less as the whip will bring you back faster and farther. Trading with the trend you could wager more and possibly win more.
Agreed Robert, but how to quantify the trend to where that value synchs with the signal. It’s kinda like what setting will locate a momo-diverge at a turn.
Hi Shaun
In a sitaution like this I usually look for percentage sepration away from the MA. If the big players are hunting the MA then two or three bounces are common while they shake the market. Its common for the swings to be similar in size. If you compare the range of price above the MA to that below on reversal and then on the reversal to the move above they are similar. Watching the range in price relative to the highs and lows around prominate MA’s will often minimise shake outs and false signals
Cheers
Leon
Hi Shaun,
I am primarily a manual price action trader and as a result I think I might have an interesting perpective on this issue. The price action described is common in low liquidity markets. This is likely to occur during off peak hours such as after 3PM east coast USA time when North America and Europe are closed and Asia has yet to open. This can also occur on days where ther is very little news driving price action and/or just before a major holiday.
Since I use my EA primarily as an advanced order entry program I have addressed all of the above scenarios using time. I can manually input what time I want the EA to trade and when to stop trading. I then look at the news realeases and bank holidays and set the EA accordingly.
I also address this issue a second way. I give the EA a directional bias by having it reference trend either through the Awsome oscillator and the simple moving average. Price action trading below the MVA gives the EA a short bias and trading above gives it a long bias. This eliminates most of the whipsaw effect. Lately, I have come to believe that referencing the MVA or the AO on a larger time frame chart than the one being traded might yield better results.
John L
I agree with your statement of starting at the inflection point. Because if you only trade between 0.3% and 0.6%, It should in theory increase win size and percent and minimize losses.
Hi Shaun,
What is your preferred time frame with this strategy? Also have you established any pip targets that you would like to hit?
Thanks,
Chris
I doubt that I’ll use any specific pip targets, at least initially. I typically prefer to keep my strategies 100% defined by market conditions.
You did not mention the TF you are using…Maybe looking at lower TF and another SMA would help with scale in opportunities. If all TF line up, why not jump in again? Makes for boring manual trading staring at screens.
Hello, in terms of scaling in. The best way I’ve found is to do it once the math is on your side. I.e if you scale in when you are only a few pips into profit, you kill the chances of the trade becoming successful too early and if you double up, you half your profit thus placing the under pressure too early. The best number, or should I say the most sensible is to add when you are at least 20 pips into profit and you have a mini retracement to hide behide. So for exmaple, if price just fly straight up to +20, however you haven’t got a mini swing to hide behind, then it might be an idea to wait until you get that swing, then you can logically trail your stop and lift the stop to break even plus profit without killing the trade too early. If this doesn’t happen until the trade is up +30 etc then so be it, it just means you have an even larger buffer which is never a bad thing. Yes the likelyhood of the trade continuing gets less as the trade advances, but even so it’s still better in my opinion. You are also adding once the trade has pulled back, which is also a plus. If you just use a plucked number out of the skype to add, then often times you’ll add just as it starts to pullback making the trade top heavy right at the wrong point. So by waiting for a mini swing before you add coupled with the math on your side when you do it, i.e minimum +20 at least, then you have a fighting chance. You can look to add again, should the trade continue in that fashion, edging the new stop up to the lows/highs of the most recent swing etc etc. I’d love to know what effect that has positive or negatively on a trading system too, so will be interesting if you look into the idea further. The question is, does adding kill the overall profitability of a system? or does it incrrease it. Because there will be times when you add and get stopped out for a break even when you could of taken 20 pips on 1 lot for example but instead you took nothing. You didn’t lose it’s worth mentioning, but you didn’t win either. obviously the system has to move the stop to at least break even after it adds so you are never in danger of becoming top heavy. Just my 10 cence worth. Best of luck 🙂
Thanks, Mark. I really like the scaling ideas. You’ve given me something clever to think over.
Hi Shaun, good good. Looking forward to hearing about it. Sorry about all the spelling mistakes lol I just read that back, I wrote it on the move apologies. Thanks. Mark.
That is a simple conclusion from the work already done. Your time & effort in charting and thinking. Now you can front test this for a month with as many possible micro trades on various pairs to see how to filter more noise and make the strategy more accurate.
I prefer to stay even simpler and don’t use SMA’s in my current strategies. Also not being a programmer is a disadvantage. I see the logic behind this though and it’s worth checking out further. I just personally don’t prefer this line of thinking (SMA being the main force behind any strategy)
Wishing you well!
Hi Shaun,
In my view, the 200 SMA works best on the higher time frames like the 4HR or Daily charts where there are less whipsaws. Very often, it is used as a directional bias instead of a entry signal.
To avoid whipsaws on the lower time frames, and even take advantage of it, perhaps you can use Renko charts instead of time based charts. Now, the 200SMA can be used as the leading signal indicator, with the additional of several faster MA.
As per your original strategy rules, when the Reno bar closed beyond the 200 SMA and subsequently reverses, you can scale into multiple trades every time the Renko bar closes beyond the the additional series of MA.
That’s my 2 cents worth, hope it is of help.
Cheers,
Derrick
Derrick, agree with your comments. I find that counter-trend swings are a great entry when I’m in a defined trend…on the 1 hour, when the 18 period linear weighted on close MA is above the 60 period exponential MA (on close) and price closes above the 18MA and the 18MA is above the 60MA, then by my eye we’re in a long trend (LT) and vice versa, if price < 18 < 60, then I'm in a short trend…now, once that is established (and this doesn't work perfectly, but its pretty darn good), I have established a series of rules that are similar to yours Shaun, where if I'm in a long trend, I'll go long if the price closes at or below the 18 on a bear bar etc, going counter to that move, but with the trend etc…and only with the trend…there are plenty of trades out there and I've learned life is easier for me when I just stick with the rule(s). I looked at your SMA distance chart and candidly, I think its a crap shoot…very appealing and have messed around with that before and been unsuccessful in finding the magic spot on that curve…there might be one, but there are enough other frictions that it never works out quite as grand as hoped for…hope this helps.
A few questions:
1. Is this 1 min bars?
2. Does the price chart display the rules you will follow? ie will you buy if price closes below the 200sma and reverse to a short on the first close above the 200sma? And to be clear you then would have bought both 2 and 3 bars earlier than the indicated buy bar given the buy criteria was met?
3. Are you thinking that on top of the initial rules you would only like to buy if the close is between 0.3% and 0.6% away from the 200 sma? If so, you would then like some rules to scale in such as 1 lot at 0.3%, 1 at 0.4% etc?
4. Will you only make decisions intra-bar or on the close of a bar?
5. I take it 0.3% represents about 30 pips for the EURUSD?
I’m sure I will have a few more…
1. Yes
2. Yes, the chart displays the rules. Entry is on the close of the marked bars.
3. I’ll be using scaling rules between boundaries. I’ll use micro entries for finer detail rather than 1 or 2 individual trades.
4. On bar close
5. Yes. 0.3% * 1.3 (current EUR/USD) is 39 pips.
Ok. Great.
So probability of a win is 66% or 33%?
How may pips is average win? average loss?
The probability is 33% winners/66% losers if you use this as a trending breakout strategy. If you trade is as a range, it’s 66% winners / 33% losers.
I don’t know the average pips, but it doesn’t matter. You don’t make money either way.
I think average pips are important because you’d only want cost (spread and slippage) to be small as a % of $ expectancy per trade. If you are buying 0.3% under the SMA and selling 0.3% above the SMA then this is 78 pips from your estimate above. That should be ok given spread and slippage will be about 2 pips.
I don’t think there is an edge in directly exploiting the frequency graph you have posted.
I always come back to (Avg win x % Win) -(Avg Loss x % Loss) x Number of trades.
This strategy looks to be altering the frequency of trades and therefore the win loss ratio. I think you need to work on getting bigger winners and/or smaller losers. If you can do that then maybe you won’t want to decrease the trade frequency. What I mean is that I’d rather make $50, 5000 times than $1000, 10 times, regardless of the other performance stats.
For the mean reversion, giving it more room to revert and/or locking in the reversion quicker is what I would explore.
For the trend following, giving it less room at the start perhaps without a profit target is what I would explore.
Also, in either case you are ‘catching a falling knife’ by buying the pull-back so I’d also look for some short and/or long trend bias change.
I tried something similar a while back using Bollinger Bands (Same SD concept). Sell at upper bollinger band, buy at lower, etc. However, to take trend out of the picture, I added an ADX indicator stating that if ADX barrier > value = no trade. The ADX trend value was a bit laggy though. Also, in regards to scaling, I had a second trade lot traded AND/IF (optional) at SMA middle line.
From my experience with these, the end of bar trading tends to be your worst enemy. By the time the bar is finished 30% of the trade is lost = greater risk for remaining.
I put aside the EA due to problems with stoploss. To be worked on later.
Would be happy for you to take a look at 1step sow or code if you wish.
On a second point in regards to scaling, I have also previously tried scaling in trades by using a lower timeframe indicator, say stochastic, rsi, dm+/dm-, etc
Would be willing to explain further if needed.
Also, very much agree on the Laguerre Filter above. Have been looking to include this in my arsenal as well. Further more you may use the lower time frame LaguerreRSI as a scale in.
What do the MACD volumes look like at the same point. If the bars are not increasing or decreasing greatly at the same time, your chances are the market will turn. If you use the MACD indicator (I use it at 6,13,9) with your crossover stragety it may help.
seems to be the Costanza theory of investing.
A very clever description! I had to search for what it meant.
If you’re wonky like I am, this article is really good on trading against public sentiment: http://bettingagainstmyself.com/2010/10/14/costanza-theory-betting-against-yourself-in-the-nfl/
Your system has a set expectancy and you are trying to maximize the returns from that expectancy. To maximize returns I think you need to trade at the ideal opening position size (probably around 2-3% for system that is accurate roughly 60% of the time). Anything less or more and returns will suffer, theoretically anyway. Thus, if you intend to scale into trades by reducing your ideal initial position size and then adding to it, I would expect that would reduce gains overall, even if this gains more on the occasional large moves. However, if you know that you also have a positive expectancy for the scaled trades, independent of the first trade (i.e, you are trading two separate systems together), then scaling could work with the proper position sizing (or so I am guessing).
Hi,
Well your approach is interesting as it provides a visible continuum to a dilemma. As you know I made an attempt to navigate between two dangerous coasts: a trailing stop too small that gets the trade whipsawed and a take profit too optimistic that never got the trade filled. The problem is that when data are plotted with all different pairs on these two variables, no continuity graph can be drawn, therefore there is no way to optimize the trade-offs. But you seem to have obtained a graphic representation of your dilemma with which you can attempt to optimize your results.
Jean-Francois
Shaun, I personally like your simple strategy using the moving average. However, the MA is arbitrary and completely under your control. If you don’t want the “price to float around the moving average” just switch to a larger moving average. And of course a Buy signal can easily switch to a Sell signal just by changing the MA. So why not make a ‘dynamic’ moving average that adjusts in scope (large or small) and offset (up or down) adapting to current price action. I say this would be a good starting place for your MA based strategy.
The congestion around the MA occurs regardless of the period used. I’m all ears if you have suggestions on how to make the MA period dynamic.
I don’t mean to bog down this conversation with discussion on the MA when you originally asked about ‘scaling strategies’. But what I mean to say is, if for example the 200 MA is changed to a 400 MA the moving average line would be of course less curved, more flat. And could even drop below the congestion in your example above, thereby indicating a Sell signal.
Hi Shaun,
I’m thinking that you need the input from a lower frequency time frame for the trade entry to make sense. IOW, something like a swing-length probability indicator (from the HTF).
Later,
Scott
p.s. good exercise here!
Hi Shaun,
I think you could do something interesting here with Parrondo’s paradox. http://en.wikipedia.org/wiki/Parrondo's_paradox
http://seneca.fis.ucm.es/parr/GAMES/Paradox%20in%20Game%20Theory%20Losing%20Strategy%20That%20Wins.htm
Have the value between changed done on Account Balance or on value/derivative of current price of a currency.
So you have one that can win 50% of the time and one that can win 66% of the time – then use them as a ratchet. This rachet would need to be modelled on the appropriate currency movement. This way your using a mathematical advantage.
Cheers,
andrew
Those are excellent links. I just spent the first hour of my morning reading through the links and getting lost in their further reading. You’ve definitely given me something to think about.
Hi Shaun,
I thought you would like that – I am working on a mathematical advantage. We could work on this together outside of your strategy if you would like. I am getting closer to determining which loosing strategies help the most.
With your questions on MA. I find a number of important determining factors:
– I find your choice of currency is very important. Some blast through a support line and some hit a support line like clock work and then again some are erratic either way.
– I find the 5min 80 or 100 SMA is my base for movement of price. I prefer this lagged price as I am after getting into a trend movement.
– I then compare the SMA to my custom price filter (my own version of a minimal lagging MA) and if after x number of bars it goes x pips away from the SMA then I am in. I find this leads to about 5 opportunities a day that need further checks.
– If price spends too much of the time going across the SMA n number of candles then I wait or do a parrondo’s like trade.
– When I am right I can get 20-200 pips, when I am wrong I loose on average 20 pips. Loss can be a lot larger if there is a large spike in the market and you cannot exit mid-bar. (news)
Not a method I would use personally as I prefer to go with the prevailing trend, not what may happen. Too much of a hit and miss for me. With regards to money management, I guess I would be looking for some further confirmation (another indicator?) before I loaded up on the trade. Maybe go in small initially when your rules advise you do so, keeping in mind that the market could continue against you for sometime yet. When the reversal is confirmed by a 2nd or 3rd indicator/patter/pivot etc, then it may be an option to add to your position size then. There is no easy solution as there are way too many variables, including the use of stops, targets, trailling stops etc.
I have just started a thread on another board discussing being in the market at all times using 2x indicators for buy and sell signals, which can form a sequence of trades using position sizes based on the fib sequence. I know Shaun thoughts on martingale and the like, but if you have a system that gives numerous buy and sell signals before the market gets away from you, then there shouldn’t be any reason to get too concerned.
With the above system based on a single MA, I think you would get the same results just tossing a coin and keeping your money management rules the same. It is an interesting topic with no real right or wrong answer, but at the end of the day as long as you make a profit with as little stress (drawdown) as possible, then you have a winner. Cheers. Jim
Hi Shaun, long time.
Personally IMO using MA’s will always be behind the eight ball in so many ways, and I do not use them, the fat lady has already sung by the time a MA gives any worthwhile signal.
Another point, having so many interested in using the same system once complete really aligns with your blog about the same EA placing the same trade all at the same time, so I am not quite sure of your goal here with this project.
Keep up the good work though.
Conway
I find it helpful to watch how far the price is from the MA. I call this ‘price tension’. And in what manner the price has moved away from the MA. In this way the MA is not a lagging indicator. — I still think Shaun’s simple approach is good.