Saturday 24 December 2011

How to make 100% in 4 weeks whilst risking your house ...

On Friday afternoon Manila time, Watcher reached 100% over its November 21st starting balance. Market has been characterized by unverifiable news (rumour) causing it to briefly kick up, then to settle back down to its support level around 1.30. This is also a major psychological level. From here, there is up and there is the June 2010 level of around 1.20, then quickly down to September 2001 levels of 0.85. Scary! news of good Spanish bond sales bely the fact that Spain cannot repay its debts, there just simply isn't the margin in its budget. An interesting comparison of national debt per capita shows the US in a surprisingly strong position over the majority of European nations.



On another note, HSBC moots AUD falling to 0.93c from its current parity level, so that's another medium to long opportunity to watch out for.

Monday 19 December 2011

How to make 85% in 3 weeks whilst risking your house ...


EURUSD price action has been very predictable over the last week. I predicted the drop to 1.302 (roughly where it is at time of writing) on the 13th, and can now see the "faux" moves the market makes(paticularly in NY session) again and again.

Trading grid is easy, but it has one big drawback. If the trend goes against you, you will lose your shirt. I have added many features to Watcher to help prevent this, but the major change has been moving from a microtrend logic to trying to follow the "major" trend. Placing pending orders when the price is further from the grid point also helps to avoid them triggering soon after placement.Its that simple.

Over on StockTwits, I also receive some great insight and tips from other traders. Kudos to @JuanLobato for his recognition of the bearish EURUSD M1 triple top. Seems obvious in hindsight, but while others are looking to the esoteric, Juan was the only one to tweet this:


StockTwits is invaluable for determining "why did it do that" as news comes in a very timely fashion


Finally, an extract from the broker report last week. I show this to demonstrate the significant pattern of ratcheting Watcher has made since trading of this version began. Watcher is (at time of writing) at 85.76% profit since 12st November.


Happy holidays to all!

Sunday 11 December 2011

111211 - Week In Pictures

Watcher, my grid trading program, continues to survive the markets after 3 weeks of trading. The account now stands at $7560 (equity) showing a net profit of 51.2% since Nov 21st. Balance is at $8110, with open PL (usually negative given the nature of the app) at $(550). Free margin is at 1260%, with 150:1 leverage. The EA has complete control, closing all open positions when a certain percentage increase of equity has been achieved. Experience is showing that it is giving away some potential profit, as price continues in a favorable direction, but this is not always guaranteed, since the killer price action for grid trading is a low-volataility move away from the trend which the app is trying to follow.



From the fundamentals side, the short-only strategy for EURUSD has been a bit of a no-brainer. Global bank coordination to increase liquidity has had no effect on the pair, and this weeks meeting of European finance ministers failing to agree on anything that will solve the debt crisis in the short to medium term only serves to increase concerns regarding the future of the EURO.

There was a false breakout of the (slightly bearish) triangle of consolidation on the 9th which set the limits of the European session.

False Breakout

From the technical side, my studies of support and resistance around both price and volume see key turning pivots at the 1.345 and 1.328 point. I found the heat maps I was using last week to be a bit garish for day-to-day viewing, so have removed the colors and just marked the lines of significant change.



In order to monitor the trend, I use daily, weekly and monthly long-range charts:





Sunday 4 December 2011

111204 - The Week In Pictures

After being up 22% on the week last week with the new version of Watcher, it was only to be expected that this week would be less, possibly even finishing with account equity being lower, as we accumulate more losing positions.
 
On Wednesday central banks coordinated to reduce cost of liquidity swaps by 50 basis points. However, the
Euribor-OIS 3-month spread, the rate at which Euro-zone banks lend unsecured funds to one another, closed at its yearly high. "For context, the last time the Euribor-OIS 3-month spread was this elevated and in an uptrend was in September 2008, right after Lehman Brothers went under".

US Non-farm payroll numbers turned out slightly positive, but the end of the week dollar rally (at expense of the Euro) was probably due to long positions being closed prior to the weekend. Hardly surprising given the 100 pip gap at the week's open (though this was a positive gap). With the Euro debt situation worsening (though see here) it seems like the market doesn't know which way to go.


Watcher closed a significant number of trades both at mid-week and at the close, finishing up an additional 12% (now 34% for the 2 weeks). Drawdown towards the 500% margin level was experienced, but this level was not breached. At one point, only 7 trades were opened, down from the week maximum of 17. Losing positions are less than 10% of equity at the close.

Looking at the heatmap, this is showing a shift in zones to a higher level (1.345 to 1.354) from the previous zone (1.328 to 1.34), with price now resting at the top of the original zone, as per my Wednesday prediction on StockTwits.



The long term view as shown by weekly chart (support lines in Green, Resistance lines in Red) is still negative.

Saturday 26 November 2011

111126 - The Week in Pictures

The end of the Euro?

Betting down the Euro has been a pretty safe bet this week. On Friday last, I predicted a fall in the EURUSD from 1.34 to 1.32. Looking at the chart, the support/resistance lines are clear, 1.34,1.32 (strangely not a big support at the round number at 1.33),1.29, 1.26 and then straight down to 1.19.

The main issues of when and how to take the trade are moot if one uses a grid trading program. An updated version of Watcher, my MT4 grid-trading app, can be configured to trade uni-directionally, and "ratchet" in profits when net asset value (NAV) exceeds the starting balance by a user-configurable percentage.Switching off long trades, and using a ratchet of +3.5% resulted in a remarkable profit of 22% on the week.

The new Watcher version again uses my proprietary trading libraries, snippets of which I have shared and reused time and time again.

Check out the screen print below for more details:

Wednesday 9 November 2011

Now that really ticks me off (Why testing with tick data can be 99% wrong!)

Dontcha just hate it when you spend the weekend back-testing your latest software, only to get disappointing results when you forward test the next week. Where did I go wrong? How can this be happening?

One often mooted reason is the data used for the back-test. If the data is not representative of the live environment, our test results are not likely to be reflecting anything near reality.

Of course, there is the argument that back-testing is intrinsically useless because the future does not reflect the past. Well, a brazillion (large number) folks would disagree. I include among those any trader that uses a support or resistance point, Fibonacci projection or similar in their strategy. What else do these demonstrate but market memory? I digress ...

The list of problems with data includes:

Difference between demo and live: Even if you recorded tick data yourself from a demo server, it may not reflect what is happening on the same broker's live server. Big and frequent differences point to the need to look for a new broker.

Data not reflecting "market" liquidity provider sentiment: Foreign Exchange is a huge market. Retail brokers only have a (usually small) slice. Their quotes will reflect that small share, plus their own spreads to reflect their trading position (after all the majority are actively trading against you). I don't want to reiterate the list of broker "dirty tricks" in this article. Dump a months worth of M1 data, come back a month later and look at the historic data currently shown. You will often find peaks/troughs disappear. These are artificially jacked quotes designed to knockout trade stop losses.

Data gaps: Wow! look at that hugely profitable renko trade! Unfortunately the untradeable stream of bricks produced by my chart generator were entirely due to the gaps in the data I used.

Data granularity: Using 1 minute closes to test a scalping system may not be the optimal method, especially if your system artificially generates ticks based on the Open, High, Low and Close of that bar. Metatrader, for example, uses a technique called fractal interpolation to generate fake ticks from the summary bar data.

Data obtained from a different broker: It goes without saying that testing with data from a different broker has its problems, results depending entirely on the correlation between them and prices from the target broker.

Applications requiring volume as a key parameter: Some providers dont provide volume at all with their data (e.g. Gain Capital). Some provide bid and ask volume separately (e.g. Dukascopy). It is questionable in many cases whether the volume numbers are representative of anything.

It's all in the percentages

Bwa ha ha ha! Sorry, let me pick myself up from the floor and dust myself off. There is sooooo much BS talked about 99% vs 25% tick data that I have to expose this right away. I refer to the test summary report MT4 produces when doing back-testing. If you use fractal interpolation, the percentage will be low, like 20 to 25%, right? But if you have tested with good quality data, the percentage will be high, like 99%, right? WRONG! The 25% figure is a number that the strategy tester in MT4 writes into the tick data file. The 99% figure is a number that the PROGRAM that generated the data writes into the tick data file. Simple as that. In version 406 of MT4, it is a double value written to  bytes 232 to 239 of the file. Any reprobate could fake the "quality" of data used in their testing using a very simple program.

Warning note: MT4 tick data DOES change sometimes from build to build. Please ensure you are using tick data generated for your build, especially if you purchase it.

Solution

There are several solutions to the issues mentioned above, and whichever you take will depend on the type of testing you want to do, whether you are scalping or working on longer time-frames, using time-based or price-based charts.

Some very nice scripts are freely available for downloading, and given time, one can become very proficient at using them. One problem for me is that they usually run very slowly, very frustrating for me if I want to generate a tick data set for several currencies and time-frames on the fly. Being time-conscious, I had to bite the bullet and spend some time, firstly deciding what approach suited me, and then implementing a system. The beauty of porting to a more modern environment such as VB/Java/C++ allows me, as a programmer, to revisit all of the programmer decisions that must have been made multiple times by the various implementers. e.g. Once you move out of MQL4, you need to implement your own StrToTime function, which is fun! As I mentioned previously, quick access to representative source data is important to me, so using Dukascopy with its wacky interface is largely out of the question. My choice of data provider allows me to download in bulk, on the fly, in a matter of minutes. My new system allows me to quickly convert this into a tick data file with 99% quality (or is it 100%?), (big smile .....). BTW, did I mention it can also generate renko tick data?

Monday 3 October 2011

Expert Advisor development process

PT1 - The donkey work, formulating the manual strategy.


   The expectation of what a forex robot, or Expert Advisor, will do largely depends on the experience of the individual using it. If you feel that an EA is appropriate to trade your strategy, then you will have a better chance of success. If you have not traded the strategy manually, then you are at best guessing as to the probability of its potential success or failure.

   It is useful to follow the thought process behind a strategy, test it out manually and then see whether or not it would be advantageous to create an automatic system.

   I wrote the following article in order to describe the full development process with the following major steps:

1. Identifying the opportunity
2. Calculating entry and exit points
3. Money management

   The pictures I display were created using indicators that I have developed for my own purposes. Though I am a commercial developer, I explain exactly how the same results can be obtained for free.

Identifying the opportunity

   For the example strategy, I have chosen a simple mean reversion system. In one shape or another, mean reversion forms the basis of the majority of systems seeking to profit from currency moves (and also those systems that profit from prices that stagnate!). So let me first explain in simple terms what mean reversion is:

   There is a tendency for a price series to follow a general trend. Within that general trend, there will be minor trends. The tendency for the price to follow the general trend, whilst exhibiting minor variations, is called mean reversion. More technical/official explanations can be found here and here. Note that the first link (a more mathematical treatise) provides a clue as to how we will formulate our strategy ("regression to the mean").

   If prices regress to the mean price, then, if we measure the distance a price is from its recent mean, we can calculate the potential profit we could achieve if we took a trade right now, and, following our trade entry, the price nicely reverted to its mean price. In order to identify the opportunity, we would need only to look at a currency pair, and see how far, right now, the price is distant from its mean.

   We can calculate the mean (over our chosen time period), and then apply some simple arithmetic. If the price is above the mean this would indicate a possible future tendency for the price to fall. If the price is below the mean, this would indicate a possible future tendency for the price to increase. The distance between the price and the mean shows us the potential profit.

   Although I can't claim to have seen and/or used all the commercially available trading platforms, I would make a (small) bet that all of them have the capability to display moving averages. A simple moving average is suitable for our purposes. Since we are going to be testing this strategy manually, I have chosen to use a daily timeframe, set up the trade, and then come back the next day to see if I need to make any adjustments.

   In the following diagram, I show a recent daily EURUSD chart with a 20 period (one trading month) simple moving average. This is entirely suitable for our purposes and we could stop here and trade the signals so generated as they have been traded since the 1970s (despite it statistically NOT being a causal phenomenon!).

EURUSD1 with SMA(20)
   I think there is a better way; remembering the clue we had before in the mean reversion definition, it is also possible to use a different mechanism for this type of trading. I refer to linear regression. Linear regression is a way of finding the "straightest line between 2 points". Choose the mid of a bar at the beginning of a period, the mid of a bar at the end of a period, draw a line between them and you have roughly what we need (again, for a more in depth perspective, see here and here. Unlike the simple moving average, this can filter out some of the minor moves that occur in the chosen period (i.e. the simple moving average will be irregular, the regression line will be straight - linear). We can see how far off the mean the price moves, allowing us to weigh up exactly which currencies are currently suitable for us to trade. If the regression line slopes upwards (trend for the period is up), and the price is currently below the mean, this provides the setup for a long trade. If the regression line slopes downwards (trend for the period is down), and the price is above the mean, this would indicate the possibility of taking a short position.

   If we add a fixed amount to each side of the regression line and draw two more lines, we can more clearly see what and where the minor trend is, and predict more clearly where it could go next. If we see the price bouncing along a fixed "regression channel", we might conclude that, if the price is just below the upper line, a downwards reversal is imminent. The next picture shows the Metatrader4 built in Linear regression channel indicator. The picture after that shows an adapted channel indicator, which moves out the upper and lower lines so that they just touch the current maximum highs and lows of all the bars in the channel. This allows us to see more clearly which bars defined the limits of the actual channel, rather than the usual regression plus average daily range that MT4 gives us.


EURUSD1 with Linear Regression channel, take profit and stop loss
EURUSD1 with adjusted Linear Regression channel, take profit and stop loss
 Calculating entry and exit points

   An obvious entry point is entry at market when we identify the opportunity. We have a choice of take profit points. We could exit once the price crosses the regression line (reversion to the mean will have completed), exit half the position in anticpation of a further move, or add to our position on a definite cross of the centre line. For illustration purposes, I choose the easier (and nearer point of the regression line). Drawing a horizontal line and noting the price where where the regression line is on the last bar gives us our take profit (TP) point. For stop loss (SL), if the price moves outside the near channel boundary, then we have a breakout of the channel and our directional bet is jeopardised. Other possible SL points are at the high/low of the previous bar, or high/low of a bar at some point in the period where we think we won't get stopped out unnecessarily.We draw another horizontal line and note the price at that point.


Money management

"I spent almost all of my money on women and alcohol, the rest I just wasted - George Best"

   We have all the information we need to make the trade, except how much do we bet? I created a simple blotter (trade list) in Excel, and created a formula for calculating the volume as follows:

=MAX(MIN_LOT,(RiskPC*Balance)/(ABS(OpenPrice-StopLoss)/TickSize*TickValue))

   I use a percentage of my balance, and divide this by the maximum adverse price deviation I will allow, and then divide again by the pip cost. We now have the volume, stop loss, take profit, and can now take the trade.

   I also use this blotter to document my thinking behind each trade, and the result, so I don't make the same stupid mistake twice!

Below are some actual trades. I display the ADX(2) in each one to confirm my understanding of the trend strength.


CHFJPY with LRC (19) to eliminate outlier candle
GBPJPY with LRC(20) and Opportunity Indicator (See part2)
USDCHF with LRC(19) eliminating outlier candle


PT2 - Automating the process.

In PT2, I will be describing how to identify the trading opportunities for every available currency pair, and outlining the EA design.

Thursday 4 August 2011

Home, home on the Renko ....

EURUSD M1 Chart with Renko Bricks
In the following discussion, some of the points I make refer to the majority of Renko chart implementations made, including my own, using the Metatrader 4 platform. In some other systems, some of the limitations I describe in the caveats section CAN be overcome.

Caveat emptor!

Possibly the best (though in my opinion still not complete) description of Renko bars can be found in a (small) chapter of "Beyond Candlesticks" by Steve Nison. Renko (the name is thought to be from the Japanese word for bricks - Renga) charts show price movement away from a point, the bricks being drawn only when a certain price move has been made, not merely documenting the price change after a fixed time period, as with regular charts.

To avoid confusing myself and the reader, I refer to  the source (regular) chart components as "candles", and the output (Renko) components as "bricks".

Figure 1 below shows a EURUSD M1 chart (top) with the corresponding Renko chart (bottom). Here you can see the clean angular movement of price, which allows for easy identification of the (minor) trend. Also, notice the difference in timescale, the Renko chart having fewer bricks than the source has candles.

EURUSD M1 Source Chart
5 Pip EURUSD Renko Chart
Renko charts are traditionally drawn as follows.

1. Pick a base price (Nison does not say how or give any clue as to which to pick). [see Note 1]

2. If a future close (Nison used daily stock closes) touches or exceeds (base price + boxsize), draw an up brick. If a future close touches or exceeds (base price - boxsize), draw a down brick. In my Renko charts, I use red for down and green for up. Traditionally white and hollow bricks have been used respectively.

3. Once the first brick is drawn, record the high (HI) and low (LO) of that brick.

4. For subsequent candles, draw a new brick when the future close touches or exceeds (HI +boxsize) or (LO - boxsize). [see note 2]

One side effect of this is that when price oscillates within 2 range boundaries, alternate up and down bricks are not drawn. Price "noise" is thus eliminated.

In forex, we have easy access to tick-by-tick data for the latest candle, and so may wish to enhance the traditional Renko bricks by monitoring prices on a tick basis, and optionally (sometimes essentially) adding the highs and lows of the preceding period as per the source chart (See the section on Wicks).

With historic data, we have already lost irretrievable information, (being the tick sequence) and so we may partition our drawing algorithm into 2 distinct parts:

Instructions 2 to 4 above are repeated for all historic candles. Once we have processed all our historic information, we can continue processing realtime data tick by tick. For each new tick, check the Bid price against the previous HI and LO, and draw bricks as before.

There are a few caveats to using Renko:

Quantisation noise

 (Where I indicate "soft" in the next paragraph I am referring to any stop loss or take profit that is managed by the client, rather than the broker's server. My position is that showing the broker your stops in a dealer-desk situation is like showing your hand in a poker game).

Quantisation noise refers to the information lost when data is sampled, and then attributed an arbitrary level (in our case we take a price move and our output can only ever be on a box boundary). This has implications for example when applying a (soft) trailing stop. The price may move against us by a shade less than the boxsize, and we will never know, since a new Renko brick is only drawn when price moves by the boxsize or more. A (soft) take profit which is not set to a boundary point will be triggered at a different price (i.e. the next boundary). A (soft) stop loss which is not set to a boundary point will also be triggered at a different price. If our money management strategy depends on the stop level being accurate, we may be risking a larger percentage of our equity than we had anticipated.


Volume

It is impossible (someone please contact me if I am wrong, I would love to hear from you) to accurately attribute volume to a Renko brick which is sourced from historic data, unless a Renko bar mapped 1:1 to a source bar. Some assumptions need to be made. For this reason, using any kind of volume indicator on a Renko chart may not give the desired results. [see note 3] Live bricks (those drawn after generator has processed all the historic information) are different, and volume can be attributed accurately. In any system where the volume/time relationship is important, beware that this relationship disappears with Renko, since bricks all have potentially different durations.

Timestamp

For historic data, when the price touches or crosses a box boundary the timing of the crossing is unknown. We can only be accurate to within the chart resolution (i.e. Metatrader 4 has minimum resolution of 1 minute). We only have the opening time of the historic bar [see note 4]. Again, Live bricks constructed from tick-by-tick data can be given accurate timestamps, since we know to the tick at which point the touch or cross was made.

Wicks

Wicks are interesting, since they can be displayed on the bricks and indicate (hard) stop triggers. Whilst I prefer "soft" stops, the gaming problem doesn't exist with ECN brokers, does it? Displaying the Renko bars on the main chart (as per the introductory diagram, also provides its challenges, but is invaluable in dtermining what happened in some scenarios.

Engulfing bars

A common "programmer decision" is to firstly look at each historic candle high. If the high has breached a boundary, then one or more up output bricks are drawn, else, if the low has breached a boundary, then one or more down bricks are drawn. Look at your Renko chart. Do you see "impossible bricks"? (The wick of a down brick is more than 2 bricks higher than its open, or the wick of an up brick is more than 2 bricks lower than its open). This is a direct result of the programmer decision made above and can be resolved as follows: If the close of the current bar is less than the open (we would draw a down brick as per the previous algorithm) we first look to see if the source bar had a high that would indicate we need to draw some "up" bricks first, since these must have occurred at some point before the down close. Similarly where the close is greater than the open, we draw any "down" bricks first. Note that we still cannot be certain that this was the case, since we cannot know the time sequence of the highs and lows within a single source candle boundary.

Notes

[1] The choice I made was to pick the oldest candle that contains a "boundary", and use that boundary as the base price. To calculate boundary prices, start from 0 and repeatedly add the boxsize. e.g. High=1.4222, Low=1.4211, box-size=0.0015: We count 0.0000, 0.0015, 0.0030, 0.0045, ..., 1.4205, 1.4220. Base price is now 1.4220 (In practice we use quotient * box-size). Had the first candle contained 2 or more boundaries, I could have immediately started drawing some Renko bars, although I would have to make some assumption as to which boundary occurred first in time, possibly using Open and Close price to disambiguate.

[2] Most existing software uses "exceeds" but not "touches". Drawing new bars when price touches a boundary results in surprisingly more output bars being drawn.

[3] Currently I assign volume of 0 to all my historic Renko bars.

[4] Currently I assign the bar opening time to the first Renko bar generated from the source data, and add 1 second if I need to generate another.

Saturday 16 July 2011

What has all this got to do with SCUBA diving?

In a previous life, I took up SCUBA diving at the behest of a friend who was an instructor, looking for new pupils to induct into his world. As time passed by, I became more confident, became an instructor myself, but then started to get a little bit bored with fish watching.

Now SCUBA diving, treated with respect, is not at all dangerous. Technical diving, however, using mixed gases to go deeper and stay longer, requires (a bit) more respect, and at least high-school physics to appreciate the potentially deleterious effects on the human body.

As a computer programmer by training and profession, I decided to write my own decompression  software, in order to understand a little more about what was actually happening in the diving computer I wore on my wrist. This handy little device told me how long I had been underwater, what my maximum depth was, and bleeped at me angrily in those times where I didn't obey its guidance as to how fast my ascent from depth should have been.

I was shocked and amazed by 2 discoveries. Firstly, the dive computer was a bit of a woos! I could use a considerably more aggressive dive profile and still not die! With the expense of the helium in the gas that I was breathing, this was good news. This was no doubt due to our litigous society. No company wants to get sued because their computer should only be used by a 24 year old marine commando who had the use of a nearby decompression chamber!

The second discovery was that there were so many programmer decisions to be made when constructing the software. As the various body tissues release the nasty bends-inducing nitrogen gas, the software instructs the user to move to a higher level in the water and stay there for a certain length of time. 3 meter depth levels are selected for ease of use, and times usually rounded up to the next 5 minute boundary. Safety and useability are entirely entrusted to the programmer, even within the user's desired operating parameters (I would not like to leave the dive site in an ambulance).

In writing forex software for clients (an even longer, deeper voyage of discovery) it never ceases to amaze me when mission critical systems are designed with no forethought to operational safety. For every new area, indicator type, execution strategy, I look for clues in the software that other folks have written. I am eternally grateful to all who have published their works. No matter how simple, no matter how uninformed. These provide the mechanism by which thoughts are provoked about safety. What happens if the context thread is busy and the trade never gets executed? what does the system do next? What happens if there are big gaps in the historic data, this data being used to determine the volume of the next trade?

I once owned a diving computer that flashed the display twice when the (internally sealed) battery was about to die. Unfortunately, this was nowhere in the manual. Without a backup system, and the experience to cope with the situation, the dive on which I experienced this feature could have been disastrous. Rather like losing your connection when you need to close a trade, and have the price move against you rapidly ....

Sunday 24 April 2011

110423 - The Week In Pictures (Fractal Edition)

Introduction to trading with fractals

As far as forex is concerned, the accepted meaning of a fractal is a price pattern which repeats (with different magnitude) in higher or lower time-frames. In Elliot wave theory, impulse (advancing in the direction of the major trend) waves, and corrective waves (against the trend) are understood to occur in every increasing magnitude once noise is separated out. To me, this is a bit like reading tea-leaves, I often see what I am looking for, which may or may not predict the future. Fractal (Chaos) practitioners will look for these different magnitude repetitions, and use one to predict what will happen (or understand what is happening) in the other. Trades are entered/exited accordingly. This reinforces my theory that the best traders are those that have a lot of experience and a good feeling for the charts.

My interest was provoked by the recognition that the standard MT4 fractal indicator repainted. I try to avoid such indicators, especially where this repainting leads to later prints differing from earlier ones. Often, this repainting cannot be seen unless one watches the chart closely either live/demo and tick-by-tick. I always perform a quick code read to determine whether such repainting will occur, so that I have a better understanding of whether it is due to necessity, or laziness on the part of the original programmer.

For my personal use, I now only use my own NonRepaintingFractal and NonRepaintingFractalHisto indicators. All of the below charts use these.

The fractal (rather than the fractal pattern) itself is formed by two or more higher lows ("support fractal") or lower highs ("resistance fractal") on each side of a particular bar closing price.

Support fractal

(Note that there appears to be a missing candle to the left of the fractal. This is in fact a "doji" candle of which the wicks are lost due to the colour scheme used. I explain the other lines below.)

If we identify these fractals, and draw a histogram of the latest support and resistance fractals, it looks like this:


(Can you identify the support fractal from the first picture?) From the left of the chart, we can see the price declining, until it reaches our support fractal, and then it starts to rise again. See that the resistance fractals step down nicely with the price fall, then the support fractals step UP nicely with the rally. By nicely, I mean that there is little or no interruption in that all successive resistance fractals are lower than each other, and all successive support fractals are (generally) higher than each other.

So what is this showing us? How can we use this to trade?

What we have to this point is, at the very least, a mechanism for determining where to place stops. We will use the support fractal values for a BUY trade and the resistance fractal values for a SELL. Now all that is missing is major trend determination (trade with the trend) and, most importantly, trade entry timing to avoid chop (those periods when the price just meanders without taking a general direction).

For the trend determination, I use my LinearRegressionChannel indicator (Yellow parallel lines with magenta centre line). This is a modified LRC which adjusts the channel to "hug" the price series, allowing one to see where price is likely to bounce off or break-through (actually widening the channel). On a H1 chart, this indicator is used to show the hourly/daily/weekly trend (since on  my screen anyway, a H1 chart covers the whole week). I use an input of 120 hours. We can see the whole month trend by just switching charts to the H4 timeframe (since 4 weeks = 1 month) and similarly switching to D1 gives 6 month trend.

As for trade entry timing, in the above and all following charts I show some techniques from the Bill Williams' Chaos method. The AO (Awesome Oscillator) is the difference between the 5 period moving average and the 34 period moving average (MA5 - MA34), red bars show declines, green show price increases. We consider whether or not to trade based on where the zero line is crossed.

The red, green and blue indicator lines in the chart window are the Alligator indicator. This is supposed to show periods where the "Alligator" is eating and periods when it is sleeping, and was apparently derived by computer analysis.

I tend to use the times where the price has bounced off the LRC, blue is above red which is above green (SELL) or blue is below red which is below green (BUY), following an AO cross.

This technique is useful for those pairs where strong/long trends occur, since the trade is entered  following clear establishment of the new trend. Stops are placed at (or offset slightly from) the most recent fractal value.
As the fractal levels step, so the stops are moved.
Whenever monitoring multiple pairs, we don't want to be continually switching charts and timeframes, so I use my AwesomeAlarm indicator to Alert me when the Awesome Oscillator crosses. It also draws historic vertical lines in red (short opportunity) or green (long opportunity) for sake of clarity.

I took the opportunity this week to assess the suitability of this method for the usual currency pairs.


AUDCAD shows good mid-week opportunity with lots of chop on each side,fractal steps not well formed

AUDJPY showing a nice trend reversal, no-trend periods are quite clear,fractal steps well formed

AUDUSD showing very clear trend reversal, chop periods easy to recognise, well formed fractal steps

CADCHF shows some small midweek opportunity, lots of chop otherwise,fractal steps not well formed

CADJPY showing clear reversal, low chop,  fractal steps not well formed

CHFJPY shows good reversal, low chop, fractal steps could be better

EURCHF shows good reversal, clear chop, nice fractal steps

EURGBP shows nice reversal, low chop, nice fractal steps

EURJPY shows clear reversal, low chop, good but steep changing fractal values


GBPCHF lots of clear chop, good but steep fractal steps

GBPJPY good reversal, clear chop, good fractal steps

GBPUSD Good reversal, clear chop,good support fractal steps, nice!

USDCAD very nice mid-week short opportunity

USDCHF nice short opportunity

USDJPY 2 good short opportunities, clear chop, nice fractal steps

Summary: I will continue to look at this system but would probably stick to the majors.

Saturday 16 April 2011

Plagiarism, The Sincerest Form of Flattery?

I get some strange requests! Actually, due to the way in which we all think, most requests to ourselves results in some form of counter-questions such as Why? What for?, and in my case How Much (big grin!). Forex, and in particular technical analysis, is a diverse sphere of interest, so big that knowledge of all the techniques and studies is beyond the limit of my memory. Following each customer request therefore comes a period of research/review, call it what you will, so that I can better understand the customer's problem. Now, sometimes there may be a language problem (which i see as my problem since I am not effectively communicating with my client), but generally one party is at a different level of understanding than the other, so I must make amends to get on the same level.

I firmly believe that there are not many original ideas in any subject, and that most innovations are a rehash of a previous work, maybe with a different bent. Only by sharing our original work I believe can we grow at anywhere near an acceptable pace.

Passing this work off as one's own, however, transcends, in my very humble opinion, even straightforward copying. It diminishes the reputation of both the original writer (who gets no credit or reward) and that of the plagiarist, who, once found out, has any credibility as an original artist, destroyed.

Given the availability of modern net-based delivery systems, and also the nature of the media to be copied, it is relatively simple to pass off a previous work as one's own. If ever I am asked to construct a forex robot/indicator/script, my very first course of action is to search the massive archives for something similar which already exists. If such a work exists, I can then inform the client that a free work is available (saving them time and money) or offer them a newly created work of my own device. If a client comes to me with a work which they want changing, I first investigate as thoroughly as possible the existing copyright notices in the current work, if any, and steer clear of anything that looks like its been wrongly obtained or copied.

So whats the point of this article? To show I am a goody two shoes? Nope (though I am - bigger grin). I want folks to use that great free internet firstly to understand what it is they really want, then to ensure no similar free work is available that does exactly what they want. And lastly, if you do find a commercial enterprise selling a work that has been clearly copied from someone else, remind others through whatever mechanism you see fit how they are being ripped off!

Saturday 9 April 2011

110409 - The Week In Pictures

A nice relaxing weeks holiday, now back to work .....

I've been researching some new methods. Whilst Watcher provides many points of interest, grid trading is a bit like watching paint dry! Luckily, my fantastic customers keep supplying me with new areas of interest, and some of the spin-offs from this (outside of what they have paid me for, of course!) keep me going in more ways than one. I have the utmost admiration for those folks who have been in the same job for many years, I often think it's a matter of making the job interesting each day.

I am a big fan of ZigZag, but very conscious of the fact that this indicator (like almost all other indicators) can only tell you were the price has been. ZigZag needs to experience a user-definable point change before it can consider whether price has Zigged or Zagged. I was unaware (shame on me) until recently that the Fractal indicator supplied with MT4, and I guess widely used, is repainting. In my defense, m'lud, I have never used this indicator myself, so probably would never have known. It's particularly surprising then, given the highly simple nature of fractals, that any such indicator should repaint. So basing a trade entry on Fractals.ex4 would either get you in on the trade early (the attraction) or get you in early on a false signal.

Lets define what I mean by a fractal. In this context, a fractal is a low or high point, generally indicated by a bar with 2 higher or lower candles on each side. So a down (support) fractal is a low bar, with two higher lows on each side. An up (resistance) fractal, is a high bar, with two lower highs on each side. Terminology may differ depending on the author. These are a useful indication of turning points, and also handy indications of where to place stops.

An additional use for me is to identify gross trend. Funnily enough, Watcher is counter-trend, but that's another story! So I have reviewed this weeks chart using a non-repainting fractal histogram indicator, comparing that with the Smoothed RSI Inverse Fisher Transform indicator. I assess each chart's suitability for range (grid) trading or trend (swing) trading. My manual analysis is now nicely reduced to assessing whether the fractal histogram is "stepping" up or down in nice even chunks, or not. Easy, no?

AUDCAD showing some nice steps in midweek, ranging elsewhere

AUDCHF Mainly ranging

Lovely mid-week stepping action from AUDJPY

AUDUSD again stepping in mid-week, is there a pattern here?

Remember we are looking for a number of clear steps, absent in CADCHF

CADJPY showing nice mid-week profit opportunities

CHFJPY stepping nicely for almost the first half of the week

EURCHF ranging, with very "blocky" fractals on the histogram

EURGBP showing 2 periods of stepping following a range at the start of the week

GBPCHF largely ranging, a staple gridding pair

2 very nice selling opportunities seen here in USDCAD

Choppy USDCHF with some late week stepping

USDJPY showing some early to mid-week stepping

In summary, I can see this becoming a complimentary strategy to Watcher, which tends not to accrue during such price action. Switching watcher off early is an option, but the idea in gridding is to accrue profit to overcome the drawdown suffered when a significant trend emerges.