Showing posts with label forex charts. Show all posts
Showing posts with label forex charts. Show all posts

Sunday, October 12, 2008

MetaTrader 4 Forex Backtesting F.A.Q.

I decided to write up this little tutorial, because backtesting different forex systems comes up very often in threads on this forum. There seems to be a lot of confusion about reliability issues and how to go about achieving the most accurate possible results. I am not a programming or forex trading guru, but I believe I can provide a helpful little FAQ on backtesting using MT4.
Good backtesting is important when considering a forex system-trading approach, because you want to have some idea of the feasibility of your idea before you go live with it [at least I do]. If you're backtesting with a 50% model quality, eh... you can't really be sure what's going on. If you have a 90% modeling quality, you can have more confidence on how your forex system actually would have performed.


+=========================+
MCBoogs' MT4 Backtesting FAQ v1.0
+=========================+

Contents:
- Section 1: Is MT4 Backtesting Reliable?
- Section 2: Downloading/Importing/Converting 1M Data
- Section 3: Configuring the Backtester
- Section 4: Other Issues


Section 1: Is MT4 Backtesting Reliable?

This question often gets pretty heated and people even get to the point of flaming each other about it. Backtesting in MT4 can be reliable, but its reliability is contingent upon the data you are backtesting on. Demo account data that is streamed in through a demo account forex broker has gaps, holes, and is basically not suitable for testing.
When backtesting, you want to use the EVERY TICK MODEL and have accurate 1M data to get the most accurate test possible. The forex 1M data is important, because the EVERY TICK MODEL uses whatever the smallest available timeframe available is and "fakes" the movement of price within the smallest available bars. Having 1M data allows for the fractal interpolation within bars to occurs only within the very narrow range of forex 1M bars.
The easiest [and only] solution to this is to use good 1M data. The most complete data you can get [at least for free] is from Alpari's Databank. They have data in MT native format, on the 1M timeframe back through mid 2004. However, setting up the data for use requires some doing.



Section 2: Downloading/Importing/Converting 1M Data

(1) You need to modify MT4 to allow for more bars. Go into the Tools Menu, then go to Options [or just hit C+O]. Go into the charts tab and put in 9999999999999 for bars in history. MT4 will default to whatever it's maximum is.

[Note: The reason MT4 has a limited forex bar count to begin with is because more bars (particularly when used in backtesting models) means MT4 is going to eat up more HD space.]

(2) Download the 1M data from Alpari's Databank in whatever forex currency[ies] you're going to test on.

(3) Import the data into MT4 using the History Center. Go to Tools => History Center [or push F2]. Make sure you import it in proper forex currency and in the M1 timeframe. You don't want EUR/USD data being important into USD/CAD for instance.

(4) Convert the data using the period converter script included in MT4 [you only have 1M bars right now]. You have to open offline forex charts to do this.
-Go to the File Menu, then Open Offline, select the 1M data of the currency you need to convert. A chart will pop up with that data.
-Then drag & drop the period_converter script onto the offline forex chart. The ExtPeriod Multiplier int that you can modify is the multiplier you are applying to the chart. So making it 5, will convert 1M data into 5M data.
-For simplicity's sake, you need to run the period converter with the following integers to get all the backtesting timeframes: 5,15,30,60,240, and 1440.

[NOTE: you can also convert 1M data to timeframes not native to MT4 if you want to do some forex indicator analysis or something on another timeframe.]

Congratulations, you have now imported and converted data into MT4. Now, for the sake of illustrating one of my earlier points, open up a currency you have imported data on. Look at the difference in the bars from the downloaded data as opposed to data streamed in from a Demo broker [So, if you downloaded 1M data from July 04 to August 05, look at the forex chart at August 05's end and September 05's beginning]. You will notice that the bars (on every time frime if you have converted them properly) from your downloaded time period will be more complete.




Section 3: Configuring the Backtester

Now that you've succesfully imported complete data, there are a few more things you need to do to run a reliable backtest.

(1) Check the recalculate option the next time you run a backtest, because you need the backtester to utilize your shiny new happy data (which it won't do unless you tell it). Anytime you import new data, you need to recalculate (I recalculate every few tests just to feel safe, maybe its a reflection of internal confidence problems, but that's for another FAQ).

(2) Check the use date option and set the date range only over a time period where you have good reliable data. This way you're only backtesting the good stuff. It will be reflected in the modeling quality percentage.

(3) Make sure the model is set to EVERY TICK. If you're not, all this hard work we just did was for nothing. I addressed why we do this earlier in the FAQ.



Section 4: Other Issues

MT4 is a work in progress, sometimes there are strange bugs that crop up in backtesting. However, usually when you think you have a bug on your hands, there is something wrong with your code. I can't emphasize enough how important debugging is. If you have problems, check your code first because it's probably the problem. If you really think you have a legit bug on your hands, post it to the MT4 forex forums.
Because you are not actually backtesting on every tick that happened [you are dealing with an interpolation on 1M data], it is still not a perfect reproduction of what actually happened in the markets. Because of this, 1M and 5M forex scalping EAs that get in and out of trades really quickly will run into some problems just because of this limitation. The longer timeframe you are trading on, the less likely your testing is to be hampered by this.
Well, that's all I can think of now. I read this over, I think I made everything clear and have the steps outlined correctly. If you notive a mistake, let me know, and I'll correct it in my next version of the MT4 Backtesting FAQ.


Acknowledgements:
I learned most of what I know about MT4 and forex trading in general from these forums and others like it. Thanks to all the people who contribute that have provided me with useful tidbits of information. There are too many names [and some of them are weird, have lots of numbers in them, etc.] to list, but a serious thanks to all the forex Strategy Builder contributors out there.
Best of luck in the markets everyone.

EuroX2 - Forex Automated trading

Tuesday, October 7, 2008

Forex Trading - ATCF forex trading System




ATCF forex trading System

“Adaptive forex method of posteriority for tendency and tradable circle”. This forex trading system created on basis of modern technologies of spectrum forex analysis of markets consisted of necessity of the set of forex indicators synthesized with the help of the digital filter, necessary for professional analysis forex trading of market.
At this forex trading system I work on real account in forex broker Alpari from September 2003.
The forex trading system represents a set of forex indicators for Metatrader. They are very simply build into point-of-sale terminal and join to any forex charts by clicking one button.

The set of forex indicators are below on the picture. So:

FATL (Fast Adaptive Trend Line) “fast” adaptive trend line turns out with use of digital filter of low frequency (the brown line on the price diagram).
SATL (Slow Adaptive Trend Line) “slow” adaptive trend line turns out with the help of digital filter of low frequency of the other order (the blue line on the price diagram).
Analogues FATL and SATL among famous technical instruments do not exist.


RFTL - Reference Fast Trend Line (the red line).

RSTL - Reference Slow Trend Line (the blue line).

RBCI (Range Bound Channel Index) limited on the stripe channel index calculated with the help of band filter (the second indicator below).

FTLM (Fast Trend Line Momentum) and STLM (Slow Trend Line Momentum) show the rate of change (downfall or advance) of FATL and SATL (the most lower indicator in the window, green and red lines).

PCCI - Perfect Commodity Channel Index (the third indicator below).

So – the main principles are the following:

- to sell only in the direction of dominating tendency the direction of which is determined by “slow” adaptive trend line SATL;
- to include the dynamic characteristics of “fast” and “slow” trend represented by forex indicators FTLM and STLM;
- to use information about that in what region of values (neutral, outbided, oversold, local maximum or local minimum) the sum of dominating market circle is situated (RBCI index);
- to consider forex trading signals of forex trading oscillators secondary in cases when forex trend indicators testify to pronounced bearish or bullish tendencies;
- to consider forex trading signals of forex trading oscillators basic in cases when trend indicators give warning of absence pronounced tendency; to use flex forex trading system of protective stop-order based on the statement of RBCI, PCCI indexes and values of “fast” forex market fluctuation.

The main rules of interpretation indicated above instruments are the following;
- growing SATL line testify to bullish forex trading trend on the forex trading market;
- the point of the beginning of turn bearish forex trend is considered the point of local minimum SATL;
- the point of the end of the turn of bearish forex trend is considered the point in which the sign STML changed from minus into plus;
- the falling SATL line testify to bearish trend on the forex trading market;
- the point of the beginning of the turn bullish forex trend is considered the point of local maximum SATL;
- the point of the end of the turn bullish forex trend is considered the point in which the sign STLM changed from “+” into “-“;
- close to the horizontal form SATL testify to the neutral tendency.

STLM interpretation demands a special attention.

- positive STLM value testifies to bullish trend and negative – bearish tendency. --STLM is a forward forex trading indicator;
- the local minimum STLM is always precede the local minimum SATL;
- the local maximum STLM is always precede the local maximum SATL;
- the achievement of STLM of its extreme points is necessary but is a insufficient condition of achievement of curve SATL of the top or bottom;
- the growing STLM at the growing SATL testifies to acceleration of bullish forex trading trend;
- the horizontal and the positive STLM at the growing SATL testify to established bullish forex trading trend;
- the bigger absolute value of STLM the bigger potential forex bullish trend has;
- the falling STLM at the falling SATL testifies to acceleration of bearish forex trend;
- the horizontal and the positive STLM at the growing SATL testify to the established bearish forex trend;
- the bigger absolute value of STLM the bigger potential bearish trend has;
- the growing “fast” trend line FATL at the falling “slow” line SATL testify to the strong bearish trend on the forex trading market;
- the growing line FATL at the falling line SATL testify either to bullish correction at the bearish trend or to the forex trading consolidation;
- the falling line FATL at the growing line SATL testify either to the bearish correction at the bullish forex trend or to the consolidation;
- the beginning or the renewal the achievement in the one direction of the lines FATL and SATL signal either about the turn of the tendency or about the end of correction and renewal the achievement of prices in the direction of SATL.

PCCI. It is an forex trading indicator showing the degree of the discrepancy with the mathematical waiting price. In other words, if it bigger than 1it is necessary to wait the correction down or to suppose at the damages of the other forex trading indicators. In any case it is need to strain. If PCCI less than 1 then accordingly vice versa.

In general I think that this forex trading indicator must be considering only on the forex trading, it is really informative there. On the rest time-frames is unlikely. On my opinion less than on the 4-hour forex charts there is no sense to look. If STLM, FTLM are going into the one side it is better do not play against them.
If STLM directs to the up (down) we play only up (down). We add at the fast forex trading indicators FTLM, RBCI from the extreme position to the down (up).



More Forex Trading Searches:


forex opportunity inversion en forex managed forex forex killer forex market forex signals forex autopilot

Download MP3 Forex 1 Hrs Strategy

The 4 Hour MOMENTUM TUNNEL FOREX TRADING METHOD

THE 4 HOUR MOMENTUM TUNNEL FOREX METHOD

Step 1.
Create a weekly chart [bar or candle] of a forex currency pair. On this forex chart overlay a 21 EMA [(H + L)/2], and a 5 SMA [(H + L)/2]. Note that the 21 period is an exponential moving average and the 5 period is a forex simple moving average.

Now, look at the difference between the two. As a forex market rises over time on the weekly forex chart, the 5 will rise faster relative to the 21. As the market goes down, the 5 will lose faster relative to the 21. The difference, in forex pips between the two, measures relative momentum of the forex market in real time. Each week, as long as the number of pips keeps rising [SMA 5 – EMA 21] from the previous week, the forex market continues in a bull run. Once a bull run loses forex pips [SMA 5 – EMA 21] from the previous week, it forex signals a medium-term top in the market. Conversely, once a bear run loses pips [EMA 21 – SMA 5] from the previous week, it forex signals a medium-term bottom in the forex market.

This now gives us [with only one week lag] a positive probabilistic model in determining which side [long or short] to initiate forex trades in a defined time period. We are identifying forex market momentum.

Step 2.
Create a 4 hour forex chart [bar or candle] of the same forex currency pair. On this chart overlay a 55 SMA [(H + L)/2], and an 8 SMA [Close only].

Now, look at the difference between the two on your 4 hour forex chart. Since we are using different types of MA’s and a shorter time period with a relatively longer period, the two will cross many times. We call these forex MOMENTUM tunnels.

So, we now take a look at the weekly forex chart again and determine that we are in a bull run. We then take a look at the 4 hour forex chart. We now know that we are looking to long the forex market, and that short positions will not be taken because they have been predetermined to be low probability events for large forex profits.

We now are looking for the 8 SMA to move lower through the 55 SMA. When it does, we carefully watch and notice when the SLOPE of the 8 SMA changes from negative to positive. It will do this when the 8 SMA stops losing value in one 4 hour bar and gains in the next. This is the 4 hour bar to initiate new long positions with 3 units [remember: units are whatever trading size you can handle. When you trade bigger, just adjust the size of the unit, not the number of units]. Stops can be placed using forex technicals [support/res/trendline] of the most recent 4 hour bars.

Assuming the forex market starts to go up, we stay long until 1) at some point in time the 8 SMA changes slope from positive to negative, at which point we exit the entire 3 unit forex trade, 2) the market moves up, there is no slope change, and goes to the 144 or 233 fib number from the 55 SMA line, where 1 unit is taken off, 3) the market moves up to the next fib number [233 or 377], again with no slope change, and the 2nd unit is booked.

Let’s now assume that the weekly chart determines we are in a bear run. We will now be looking to initiate new short positions only.

We are looking for the 8 SMA to move higher through the 55 SMA. When it does, we carefully watch and notice when the SLOPE of the 8 SMA changes from positive to negative. It will do this when the 8 SMA stops gaining value in one 4 hour bar and loses in the next. This is the 4 hour bar to initiate new short positions with 3 units. Again, stop placement depends on forex technicals of the most recent 4 hour bars.

Assuming the forex market starts to go down, we stay short until 1) at some point in time the 8 SMA changes slope from negative to positive, at which point we exit the entire 3 unit forex trade, 2) the forex market moves down, there is no slope change, and goes to the 144 or 233 fib number from the 55 SMA line, where 1 unit is taken off, 3) the market moves down to the next fib number [233 or 377], again with no slope change, and the 2nd unit is booked.

There will be times when the slopes will change and the 8 SMA will not be above/below the 55 SMA line. In these circumstances we use only 1 ½ units to initiate a trade with the same rules above.

We are implementing this new 4 hour forex method with only 2 filters. The first is on the weekly forex chart. If the difference between the 21 EMA and the 5 EMA is > 500 pips, then the forex pip difference from the prior week must change by more than 10 pips, or just go lower over 2 consecutive weeks, to signal a trend change.

The second filter is on the 4 hour forex chart. If the 8 SMA and the 55 SMA and the forex market price are all within 50 pips or so of each other, we go to forex technicals [breakout] to continue the trade. We do this because, at this juncture, you are more likely to get the 8 SMA jumping up and down 2 or 3 pips every few bars, thus generating a false trade forex signal. It doesn’t happen very often, but when it does, using this filter can save us money, and the forex market isn’t really moving anywhere anyway. Therefore, a breakout of the techs makes sense to initiate a trade, if it’s in the direction you are supposed to be forex trading.

If you now go ahead and make the charts and take a cursory look at the weekly, you should be amazed. The weekly criteria hits every single turn in the forex market within a couple of weeks. The fact of the matter is that the weekly difference of the MA’s TRENDS. It doesn’t change gaining/losing unless the forex trend changes.

The 4 hour chart is equally powerful. A more careful look at the 4 hour will show large 4 hour bar spikes that often change the slope of the 8 SMA. The reason we chose the 8 SMA with close only, is so that we can better estimate in the next 4 hour bar period the price needed to change the slope before the period is over. Many times this will give us a huge profit advantage over waiting until the period is over.

II. IV. FOREX ANALYSIS

The following spreadsheet gives a rough idea of what kind of profitability you are looking at using the forex 4 Hour Momentum Tunnel Method. It is very important to realize what assumptions we used in calculating these numbers. The criteria was as follows:
1) 1) Any trade that looked like less than 100 pips profit we totally ignored,
2) 2) When taking forex profits we ignored fib numbers from the market price and instead used the 8 SMA line if it hit a fib number. We did this because it was much easier to calculate and took far less time than analyzing each bar on every forex chart with every forex pair. Note though, that this REDUCES profitability tremendously over time. The market is much more likely to hit fib numbers than the 8 SMA.
3) 3) Any forex trade that looked like a scratch or a loss, we treated as a loss, and
4) 4) After we summed up all the periods we DOUBLED the losses,
5) 5) We used 3 units on most trades, except 1 ½ units on forex trades where the 8 SMA changed slope and did not cross the 55 SMA. This forex trading signal is somewhat less powerful than the original, so we reduced size accordingly.

III. V. FOREX RISK MODELS

I could write a book on risk models, and it could easily be 500 pages and sell for $100. There are as many models, along with their variations, as there are wannabe forex traders in the world. Instead of going through conservative and aggressive scenarios, I decided just to write about the model we will initially employ. I am not suggesting you use it: I am simply presenting it for your forex information. You must come up with your own risk model.

Unit value: 1 unit = 500,000 base forex currency vs. $US
Trade Size: 3 units per currency forex pair, except 1 ½ units when 4 hour chart filter kicks in.
Filters: Only the 2 mentioned earlier in the file
Stops: Will be based on technicals off of 4 hour forex charts.
Pairs traded: Initially only GBP/USD.
Options: Yes, will write [sell put or call] premium opposite forex trend off of weekly forex chart with 1unit, with trend change triggering covering of positions. We will sell out-of-the-money option [depending on signal, sell calls for bear forex signal – sell puts for bull signal] premium with expiration of 6 – 8 weeks, and look to cover 2 – 3 weeks from expiration at approximately a third of selling price.
Other: May not take off entire position at slight change in slope of 8 SMA on the 4 hour chart. Most likely scenario is to take partial forex profit, with stop based on technicals for remaining position.

IV. VI. WHERE DO WE GO FROM HERE?

I hope most of you reading this file can see how adaptable and flexible this forex method can be to your forex trading style. Even if you choose to trade shorter timeframes, this method can keep you on the right side of the forex market. It should confirm other types of analysis as well. When I sit back and think, I can see a host of scenarios some people will envision and implement. By all means, make the necessary changes to fit your trading style. This is not a one size fits all forex trading method. All anyone should care about is making money, and we think this will definitely help you in that objective.

For newbies to forex, or more conservative forex traders, you can scale back and cherry-pick the best trades. Simply use the model as your forex guide, and take the guesswork and emotion out of forex trading. You will always be buying dips in a bull run, and selling rallies in a bear run, to initiate new positions. You are letting the forex market tell you when it has had its little contra-trend rally/break. That, in essence, is what a MOMENTUM tunnel is all about. It creates a visual space for you to see these contra-trend opportunities as they are being created. When they turn, you can pounce on the forex trade, and now it’s time to continue the medium-term trend. You’re not going to hit every one perfect, but you will definitely get your share if you stay patient and wait for the optimum time. Even if you screw up the entry, the trend will probably make the forex trade a profitable one.

I hope you can see why forex trading MOMENTUM tunnels [4 hour] are better than trading PRICE tunnels [1 hour]. You will have less losing forex trades, and there is no chop around the MOMENTUM tunnel. If the forex market continues to go against the trend, within a very short period of time you will only have 2, possibly 3 losing forex trades before the weekly trend would change. This is a very acceptable tradeoff for the new information being given to you by the forex market: i.e. a weekly trend change. At least for us, this means closing old option positions [at just the right time], and creating new ones [at just the right time].

Remember the old forex trading proverb: price = information. That’s exactly what’s happening when you get a trend change from the weekly forex charts. Of course, remember that there is a lag of 1 week from knowing when the high or low reading comes, because you won’t know until Friday’s close if last week’s reading was the high/low or not.

Let me just add, that forex MOMENTUM tunnels should work particularly well with other financial markets. Stock indices, oil, and interest rates should trade very profitably with the new method. Some of the forex currency crosses [eur/jpy, eur/gbp, eur/chf, eur/cad], in theory, should also work well. Vegas Jr. is going to look at these particular crosses in a few weeks to check them out, so I’ll withhold my opinions on them until he is finished.

More Forex Scalping Systems

Download AUDIO MP3 Forex 4 hrs Trading Methods