Bob's MTF LWMA System

G’day to you all. I learnt about this beast called the Forex Market about year ago and have become a bit obsessed with it. After a year of research, practice, trial and error I think I am finally getting to know her well enough to take her on. I have been testing a strategy for the last couple of weeks in my demo account that looks promising. So I thought why not offer it up for review by my peers and critiquing by my seniors. As any newbie can testify, it’s easy to find information out there; it’s a lot harder to get feedback. I claim nothing new here, just (hopefully) a fresh perspective of what’s available to anyone online and for that reason I simply call this system “Bob’s Multi-Time Frame LWMA System”.

There are three parts to my offering, first is this brief introduction to my system. The second is a script which I have developed to identify when the markets are trending in favour of my trade system and I would like to hear how others might trade using this script. The third is my trading system itself that I have been trialling. I work with moving averages. A piece of advice I was given early on was find an indicator and learn it, live it, love it. All indicators at the end of the day are nothing more than a visual representation of a mathematic relationship between price and time. This system was developed with LWMA’s applied to the Weighted Close Price as I like the response to the here and now of market conditions without allowing market noise to penetrate the effectiveness of the system. Hope you all enjoy and I look forward to your comments.

1 Like

I believe heavily in momentum. And in the market it’s no different. When the markets have momentum we call it a bull or bear market and under these conditions there are opportunities to make pips. I think the biggest challenges to anyone trading by the “Trend is your friend” philosophy are first indentifying a trend and secondly when the trend will end. It takes effort to change momentum therefore ending a trend and I believe that it is possible to track and identify when this is happening. I use multiple time-frame (MTF) analysis of Linear Weighted Moving Averages (LWMA) applied to the Weighted Closed Price to do this. On each of the Daily, 4Hr, 1Hr and 15Min Charts, I monitor a Primary (Fast) LWMA and Secondary (Slow) LWMA. Naturally when the FMA is greater than the SMA we say the market is rising and vice versa for a falling market. When all the charts are in unison I consider the markets to have sufficient momentum to continue to rise or fall and only then do I start to look for trade opportunities.

Now this monitoring of charts is complex so I have developed a Script to do this for me. I run it on and work in the 5min charts but it also works on the 1min and 15min charts. Here are some screenshots;

Rising Market


Falling Market


Makes things pretty clear, here’s the link, download it for your-self;

Bobs MTF LWMA Trend Filter.zip (6.68 KB)

You will be able to change the parameters of each MA but be warned, slight changes in numeric value can and will change the indicators performance. Here are my settings for EURJP, USDJPY and GBPJPY

                            EURJPY  	USDJPY GBPJPY

Primary_Long_15min_Filter 4 3 6
Secondary_Long_15min_Filter 15 11 13
Primary_Long_1hr_Filter 6 3 5
Secondary_Long_1hr_Filter 21 13 19
Primary_Long_4hr_Filter 7 3 3
Secondary_Long_4hr_Filter 15 9 9
Primary_Long_Daily_Filter 5 7 4
Secondary_Long_Daily_Filter 19 13 17

Primary_Short_15min_Filter 7 8 4
Secondary_Short_15min_Filter11 13 15
Primary_Short_1hr_Filter 3 5 3
Secondary_Short_1hr_Filter 13 9 9
Primary_Short_4hr_Filter 7 4 3
Secondary_Short_4hr_Filter 21 9 9
Primary_Short_Daily_Filter 3 5 3
Secondary_Short_Daily_Filter 9 17 9

I have worked primarily with JPY pairs and they seem very promising. I have done some work with the majors and again the results look promising. Also each pair has its own natural vibration level or what is probably known more as market noise therefore settings that work well for one pair may not be so successful with another. Likewise, settings for a rising market are different to that during a falling market. The script also has a variable visual indicator level which is preset at 65 LWMA. This allows you to adjust visually where the indicator is displayed on the chart. Finally, these settings are optimised for my trading system in the next post so may not work as well as a trade filter for other systems. Optimizing these settings is long time consuming work and at this time I only feel confidant offering these three pairs.

What I am really interested in is how others might use the script I made to enter and exit the market as well as how they might manage their order. This is how I’m doing it and I look forward to your comments.

As I stated earlier, I run the script on the 5min chart as this is where I look for my entry signals. Again all MA’s are Linear Weighted and applied to the Weighted Close price. What I’m simply looking for is a temporary loss in market momentum - a retracement to occur. In a rising market we will see the price pull back off a recent high and is characterized by a FMA falling below a SMA. Then recovery and the price starts to rise again. I’m looking to jump on board as soon as the market indicates so I’m now watching the Bid price. When the Bid price crosses above what I’ll call the Entry MA I enter the trade. Just keeping it simple as they say. In summary trade conditions are meet when:

  1. MTF LWMA Trend Filter Script indicates a rising market,
  2. FMA is less than the SMA and
  3. The Bid price is greater than the Entry MA.

Here is an example of a Long trade on the chart;


The system is just opposite for sell entry points in a falling market. However instead of using the Bid Price we use the Ask Price to determine our entry point. Here’s an example of a Short Trade;


To manage the trade I’m using 0.2 of a lot per $10 000 of available equity at leverage of 200:1 and use a Stop Loss and Take Profit. Again because of the natural vibrations (noise) level of each pair SL and TP values are different, likewise for long and short positions. I also restrict open trades to just one open trade at any time in each direction. Here are the values I have optimised for these pairs.

                            EURJPY  	USDJPY	GBPJPY

Long_Entry_LWMA 13 11 3
Long_FMA 7 3 13
Long_SMA 19 27 21
Long_Stoploss 60 30 75
Long_TakeProfit 75 50 75

Short_Entry_LWMA 3 11 3
Short_FMA 9 3 13
Short_SMA 17 29 15
Short_Stoploss 65 50 30
Short_TakeProfit 25 60 25

Again, I have developed a script to do the hard work for me and here’s the link;

Bobs MTF LWMA Trend Filter with Trade Alert.zip (8.6 KB)

Hers a screenshot during a rising market;


And one from a falling market


Now I personally don’t work with this script, I have developed an EA to assist my trading but my skills at programming are limited so I won’t offer this out in a public forum at this time. The script is just my EA minus the ability to place a trade. However having the EA allows me to monitor and collect data on several pairs at once during forward testing and facilitates back testing. The settings I have offered are the three pairs I have concentrated on. Other pairs include AUSJPY, NZDJPY, CHFJPY, EURUSD, AUSUSD, NZDUSD and GBPUSD. Results look good but I have yet to examine the effects of spread, swap etc on the system and returns for some pairs don’t look as good or have larger drawdown than others.

Talking of returns what does the system return? Well preliminary testing looks to be around 10 to 20% on each pair per month keeping drawdown in single figures (8 to 9%) however back testing results suggest that if one is prepared to increase risk then returns could be much greater. Myself personally I would rather trade multiple currencies and small risk that throw all my faith in just one pair. Also please remember that I have only just recently refined this system and subjected it to testing in a demo account during the past couple of weeks. Optimising the systems is very time consuming and for all I know these setting could flop in the next few months and the system fail. I certainly hope not. Hope you all enjoy.

OK, so after reading my post I realized that the settings for the scripts have not transferred well and ain’t easy to read so I have put them in table form and you can download them here

Bob’s MTF LWMA Script Settings.zip (10.2 KB)

G’day all. Thought I would share a back test result I have just completed on the CHFJPY pair. Now please don’t hit me up about quality of results on back testing, I know the argument. I’m just demonstrating the potential of this system.

CHFJPY


StrategyTester.zip (4.11 KB)

AUSJPY


StrategyTester AUSJPY.zip (5.23 KB)

G’day again. So I’m working hard getting this system working and it raises a question. So far it looks like it has potential on at least 10 pairs. What is the best risk management for it. Is a bloke best trading just 1 pair and applying a 1% risk factor? or two pairs at 0.5% risk, 5 pairs at 0.2% risk or 10 pairs at 0.1% risk. Look forward to your feedback

G’Day again my friends. Thought I would add a bit more to my logic today. In my orginal post I stated that “All indicators at the end of the day are nothing more than a visual representation of a mathematic relationship between price and time”. Well I just what to demonstrate why I work with LWMA‘s. On the two charts below I have set up my FMA (green) and SMA (red). Settings are 3 and 5 on the daily, 3 and 24 on the 4hr chart. Also you have the beloved Heiken Ashi Smoothed (HAS) candles at the standard default settings of 2,6,3,2. Finally Japanese Candles for all you price action fans. Have a good look at the charts and compare the three.

AUSJPY Daily Chart


AUSJPY 4Hr Chart


My system is a trend following system so I need to first identify a trend, get on that trend then exit quickly when the trend ends. I do this of the daily chart. Now note on every occasion the MA cross occurs 1, 2, 3, and even 4 bars (therefore days) before the HAS indicator changes. Note particularly around 21st to 30th of June. Any trader following HAS candles looking for short signals would have had damage occur to their balances. Price action doesn’t show much. Maybe astute PA people might have detected that a trend reversal was coming around the 20th but it still might of been around the 24th before they started looking for long signals. Whereas my MA cross occurs on the 22nd and I’m ready to go long.
Now we look at the 4hr chart. I focussed in on August as a resistance level was set during this month. My SMA is now 24 and we see that both the MA cross and HAS change occur exactly on the same bar. They both gather and interpret different data generated by the relationship between price and time but the visual result is exactly the same. If I shorten the SMA period it would generator early signals as the daily chart but then I’m opening risk by introduction market noise. Similarly the HAS can be made more sensitive by using say a 2,3,3,2 combo but it to introduces market noise. And that is where the balancing act occurs. Any indicator has to have its parameters set so that market noise is kept to an acceptable minimum yet sensitive enough so that opportunities don’t slip by. As I’m using MTF analysis both the daily and 4hr chart must show rising trend in order for trade conditions to be met.
Know I got no idea how you PA fans would of traded during the month of August but Back testing results for my system suggest that a return of 57.8% was possible


Aug2013 AUDJPY.zip (2.92 KB)

Now none of us believe in back testing results but if the script is capable of generating 10 – 15% a month and over several pairs its worth investigating I think. More importantly if the potential for a 50+% return from the trend filter script does exist then someone much cleverer than me should be able to figure it out

Hi Bob, I would like to further look into this system, but this script doesn’t seem to work at least for me, as it just loads and unloads inmediately and doesn’t draw anything in the charts nor it keeps active looking for a setup.

If you attach the mq4 file with the code, I could try and fix this.

Anyway, the system doesn’t look very complex (technically speaking, I guess you’ve tested for long time, so thanks for sharing) One thing I would like to ask is why your MA’s and take profit are different for shorts and longs?? Are there just backtest optimizations or you use this values for live trading?

Good morning Averied. Just want to answer your queries. The difference in values between pairs exist because each pair has its own natural vibration level. Forex people probably call it market noise. It exist because each pair has its on pool of investors and therefore mass and is finite (defined) in value. How they enter and exit the market is reflected in each pair and leaves a traceable pattern. Don’t you love us humans, no matter what we do we leave evidence behind of what that action was and therefore an indicator of future actions.

The values I have given are optimized but not for maximum profit. They are optimized to meet money management strategies. Lets face facts, there are as many ways to pick entry and exit points as there are traders. We love to debate which way is better. Nobody talks about how they manage a trade. Here’s my philosophy. Statistics rule and statistical speaking that if I placed a trade right now it is just as equally likely that it will rise 5, 10, 50 or 100 pips as it would fall by the same. If we traded at 1:1 risk and only traded long we would break even. However in real life some nasty beast could spread prevents this from occurring. However if I developed a trade alert that could pick 3 out of 5 right at 1:1 risk, risking 1% per trade then I would have made 1%. Place 1 trade a day and that equates to 1% a week. Do that on 5 pairs thats 20% a month. I’m happy if I can do half that in real life. So I have targeted in around 40 to 60 pips mark as a TP level. The value just depends on the natural vibration of the pair. This seems to keep trades averaging around 1 trade per day and keeps the effects of spread and swap to a minimum. It keeps my risk ratio at least at 1:1 and seems to be striking at 75% win ratio.

I’m also trying to keep draw down to a minimum. No point running a profitable EA with 20% draw down over 5 pairs. Eventually the markets will turn and in one foul event wipe out an account. I would be happy if I can get this system down to about 5% per pair but at the moment it looks like 10-15% which makes me uncomfortable running it on multiple pairs.

As for the script not working bro, all I can suggest is that even though I call it a script, I have only ever loaded it on a chart as an EA so maybe it has to be loaded as an EA. Hope that helps. I will contact you about this my friend so please check your message box. All the best bro.

Bob pay attention to your backtesting. It seems to me it’s completely faulty. Too many errors on your backtesting. If the EA is the same you submitted to robopip, j made some tests with it and starting from 20130101 till now the result is you completly loose your account. Pay attention to the percentage on the upper right corner, you have N/A so the results are of no use.
If you need help for backtesting let me know.
The Graal is too far from us

Thank you for your interest in my system and EA. Your observation is spot on. Firstly I have to say I am no programmer. I use EA generation software to map out trade logic and generate working EA’s. As well as not being a programmer I am also not some international forex hedge fund with a team of analysts, technicians programmers etc so quickly figured out to analyse the shear volume of data the tick chart produces I would need some help and this is what these EA’s allow me to do.

Your observations are correct, the results I get in back testing are not able to be duplicated in a demo account. I believe the theory behind the system is sound, I just got to figure out the values. So my job is to figure out why. Now my robot uses current bar analysis and bid/ask price to enter/exit trades. Now we know there is a big difference generated tick data of mt4 strategy tester and live feed data. Combine that with the fact I’m also using multi time frame analysis, my robot can and does throw up false entry signals in a demo. Almost at the rate of 3 to 1.These trades are turning into losing trades and that’s no good. However trades being made when conditions are right are winning and that’s good. So I might have to look at how I analyse the markets. Maybe I have to look at previous bar values or close value for my signals. Maybe a cobination. Maybe I turn to the 1min chart for entry signals. Maybe look for another confirmation signal from the market.What effect is spread having? But there are other problems. Take a look at this chart


Its today’s trade on the USDJPY 5min chart. As you can see it has selected the trade as planned and come close oh so close to closing a winner. But what happened. If you take a closer look at where it placed its TP, 96.937, significantly below a price resistance level @97.00. Another factor any robot needs to take in. So that’s my job this weekend. To go through the results I got this week and try to figure out how I could do it better.

Another observation has been that even though the robot open trades on false signals it is capable of being run on many pairs and because of currency correlation many trades can be open at once the net result being the floating profit can be 2 3, and even 5% of current balance. Maybe I need to factor in floating balance and close all trades if say 2% is reach.

So many variables to examine which is why I am only at the start of my journey.

Here my trade log for the week.

Trade Results Week ending 4th Oct 2013.zip (2.47 KB)

Of those trades losses of $8002 where because of false signals so that puts me up $1217 straight away. Of the floating trades only the USDJPY and NZDJPY opened under trade conditions and have a floating profit of $475 so if I closed out right now that’s a week profit of $1692 and on a balance of $36 000 that’s 4.7% and I think that’s quite acceptable.

Finally I don’t believe in back testing long term time periods. I’m looking to optimize for the here and now of market conditions so each weekend I sit down and run back tests for the past 13 weeks to set up next weeks values

Ultimately I’m looking to develop a manual trading system so for the moment I need/run my EA for data collection and analysis. If by doing that I am able to turn my manual system into a fully fledge robot my journey might come to the end and I can say I found my holy grail. For now, my journey has a long way to go and I warmly invite anyone who wishes to join me.

Agreat weekend to you all :59:

In my humble opinion you need backtest too.
The backtest is usefull when you must test for the first time the EA or for the changes you made to your EA otherwise you need a lot of time to figure out what’s happening.
If in the backtest you already fail, you have no need to put into a demo account, but you can start changing it without losing time.
This is my approach as a programmer, but you know, it’s purely mine.
A good weekend to you too.
Bye to all.

G’day to you all. So I took on board what old mate ek24 shared, had a busy weekend (drove the missus nuts!) and have come up with the following. Now nothing about the system has changed. I still use the same trend filter to identify a trend. I still use a LWMA retracement pattern to identify trades signals. Still using a SL and TP. But what I did was build a new bot that only analyses the market at the open of each new bar on the 5min chart. With a bit of luck that should eliminate false signals being generated mid bar and get a reproducible result on my demo this week. Only time will tell.

Now because of the threads I have been involved in I will offer this EA for anyone game enough to try it. Its for the 5min chart and has been optimized for the USDJPY pair. Also here are my results from back testing, Oct 2011 to Today. Please note the modelling quality for those following that argument. I learnt alot this weekend lol.

Now I think 274% return over two years and that it seem to hold its own during a large stagnate period speaks potential.

BOB’s USDJPY Bot Build 4.0.zip (11.9 KB)


USDJPY Oct 2011 to Current Strategy Tester.zip (11 KB)

As I have stated before to me back testing is mapping for potential. The reason I use EA’s is data analysis and my grail is a manual trading system. When you run a back test there are many many trades that turn from winning to losing trades. And we are all familiar with the phase “never let a wining trade turn into a losing trade”. That just tells me that I have a very solid entry strategy but my exit strategy of SL and TP is basically crap. So please anyone that can develop an exit strategy I’m sure we are all keen to hear from you.

Hi, Bob, in the result of backtesting i note that the EA open a trade in buy and then a trade in sell without closing the first trade. Is it normal? I mean it is the normal behavior and you are hedging the trade (in this case you should remember that not all the brokers allows hedging) or you don’t want your EA doing this?
To clear what i’m saying below there is an excerpt from your strategy tester:

Time Type Order Size Price S / L T / P Profit Balance

13 2011.11.23 00:20 sell 7 0.10 76.967 77.517 76.417
14 2011.11.23 04:35 buy 8 0.10 77.034 76.584 77.884
15 2011.11.23 16:07 s/l 7 0.10 77.517 77.517 76.417 -70.95 990.80
16 2011.11.28 14:08 t/p 8 0.10 77.884 76.584 77.884 108.49 1099.29

In this case if you close the order 7 at the enter of number 8 you’ll not lose 48pips of the stop loss.
But i don’t know well your strategy, so i don’t know, but for me, if i have an entry point in my strategy i’ll ensure to close the old trade if it’s not in the same direction.
I hope this will help,
Bye to all.

G’day to you Bro, to make the answer simple, is it normal? Yes and No !!! LOL. Bro this is completely normal for a robot and it comes down to trade logic during programming and the nature of MA’s. It looks for a trend first and then a particular retracemnt pattern over 5 time frames by confirming whether a FMA is greater than or less than the a SMA. The logic is explained in my first couple of posts. To the robot it is a binary decision, it either is or isn’t. Doesn’t matter if that’s a point, a pip or 100 pips it’s all the same to the bot. Now MA’s are a great indicator (like most) in a trending market but as soon as the markets turn flat they fail (like most). In each time frame you are monitoring 2,3 or 4 different MA’s and in a flat market multiple MA’s start to intertwine. And that is what’s happening here with is bot. It is analysing the market on every tick to confirm this relationship. Each tick is a fresh calculation and if these MA’s intertwine just right it only takes a single point movement to confirm all trade conditions meet and it enters a trade. This, to me, is a failing and possible fatal flaw in the robot.

But, as I make a point of saying, robots to me are about data collection to develop a manual system. So would this be normal in my manual system? No way. I’m with you one trade at a time, so exit the first trade immediately and enter the new trade at your on risk. My observation during back testing would suggest that it would actually be better to skip that signal as well and wait for a new one.

But I hope to have solved this issue with the USDJPY Bot Build 4.0 which you can download from a couple of posts up. Instead of analysing every tick it only analysis’s the market once at the opening of each new bar. I’ve built it to use on the 5min chart but suppose it could be used on the 1min or 15min chart.

And even as I write this I am modifying the robot more with a day filter. Bro, beware of trades Sunday and Monday. Markets seems radical on these days. Fridays might pay to close out any trades in Profit. Bro, the grail is still far. Hope this answers some questions.

Is this your new home bob, do I subscribe here or elsewhere!

Naaa bro. This is an old dead thread that shows my mistakes when I first started out wrestling with the beast know as forex.

It was bumped by that stupid duck System X thinking my skin was thinner than his and Nica had to clean it up.

To all newbies reading this thread, this is a very good example of what not to do. We take ownership of our mistakes, learn what we can from them and move on.

2 Likes