Follow up on cycle detection, if only by sheer curiosity: can cycles help us detect the next turning point?
Read these 2 articles "Cycle Detection" and "Cycle Detection - Update" if you need assistance with reading this indicator.
Note the usual caveat: cycles are seldom stable, hence any pivot point detection must be supported by other indicators.
Wednesday, November 28, 2007
Tuesday, November 27, 2007
Cycle detection - Update
On Nov 18th, a cycle detection indicator was applied to the SPY daily chart, and a cycle with a period of 72 bars appeared to fit prices nicely. Despite caution must always be exercised as cycles are generally very short-lived, about 2 weeks have passed now and it will be interesting to see whether we are right or not over the next few days...
For interest's sake, let's also take a look at cycles with RUT.
For interest's sake, let's also take a look at cycles with RUT.
Monday, November 26, 2007
This time I'm going to make you work a bit...
Yes, i thought it would be a good idea to suggest that some of you, users on this TS-T-T, who are comfortable with EasyLanguage to work on a possible interesting addition to the ToolSet.
Two short articles were posted recently to explain how to retrieve pivot calculations from the DLL memory: API Part 1 and API Part 2. Pivot prices and indices (number of bars backs from current bar) can indeed be easily loaded in EasyLanguage arrays, and used to detect interesting patterns. RetrievePivotInfo for instance calculates Fibonacci levels automatically based on specific criteria for the inital swing leg.
There are at least 2 directions which would be interesting to explore at this junction. One is the search for harmonic patterns such as described on HarmonicTrader.com (you may want to google it up for more details). Those patterns are not frequent, but are very reliable. The existing Fib code in RetrievePivotInfo should give you pointers.
The other direction is the (esoteric) Gann's Square of Nine. WD Gann published numerous books and courses but quite intelligently remained very secretive about the core of his technique, explaining part of his following to this day, over 50 years after his death. I am admittedly no Gann expert, but it is certainly worth investigating. After all Murrey Math lines are also "Gann derivatives" and prove to be often correct.
I here provide a Square of Nine spreadsheet, which contains simple formulas to check whether pivot prices or dates fall on the Cardinal or Ordinal Crosses.
Thanks in advance for your contributions always most welcome.
bv
Two short articles were posted recently to explain how to retrieve pivot calculations from the DLL memory: API Part 1 and API Part 2. Pivot prices and indices (number of bars backs from current bar) can indeed be easily loaded in EasyLanguage arrays, and used to detect interesting patterns. RetrievePivotInfo for instance calculates Fibonacci levels automatically based on specific criteria for the inital swing leg.
There are at least 2 directions which would be interesting to explore at this junction. One is the search for harmonic patterns such as described on HarmonicTrader.com (you may want to google it up for more details). Those patterns are not frequent, but are very reliable. The existing Fib code in RetrievePivotInfo should give you pointers.
The other direction is the (esoteric) Gann's Square of Nine. WD Gann published numerous books and courses but quite intelligently remained very secretive about the core of his technique, explaining part of his following to this day, over 50 years after his death. I am admittedly no Gann expert, but it is certainly worth investigating. After all Murrey Math lines are also "Gann derivatives" and prove to be often correct.
I here provide a Square of Nine spreadsheet, which contains simple formulas to check whether pivot prices or dates fall on the Cardinal or Ordinal Crosses.
Thanks in advance for your contributions always most welcome.
bv
Thursday, November 22, 2007
Introduction on the TS-T-T (update)
The technique outlined below is suitable for discretionary traders. It is based on a fairly complex data analysis which has been translated into a set of proprietary tools. Before describing these tools, we feel it is important to have these first guidelines in mind, gathered along nearly 15 years of experience:
1) Most indicators, either custom made or built in trading platforms, do calculate one or several mathematical outputs at each bar. One may also (correctly) say that prices are noisy, chaotic in nature, which obviously make "market reading" rather difficult. However, in my opinion, the problem is elsewhere... Indeed, most of the time, there is simply nothing to read in the market, not necessarily noise, but just irrelevant useless information. To be quite pragmatic about it, let's say that buying and selling are essentially discrete decision points, the rest is 'vacuity' which should be handled by money management, i.e. keeping an eye on your position.Trading should therefore always inherently remain dependent on an event driven technique. In other words, if you wish to crunch large amount of numbers in any crude or sophisticated way, irrespective of the rare salient events where effective decision making is only sensible, well... you might just be wasting your time... and LOTS of so-called trading gurus are quite willing to take you for a ride along the meanders of the never ending quest of the Holy Grail... (note: LOTS is still a huge understatement...)
2) Any sound decision can only make sense in perspective or context, unless you stick to quick scalping or to the simplest reversal strategy, assuming you get your pivot calculations right too.The best way to represent context is to work in a multi-time frame environment (2, 3 or even 4 time frames). It seems obvious that a move in your time frame of choice, determined by indicators lining up nicely either long or short, can only show strength if supported by a similar set-up in a higher time frame. Choice of adequate time frames may however not always be easy, and one could only hope for a trading platform in the future which would have adaptive bar intervals.For synch purposes, time frames will often be in multiples like 1, 2, 4, 8 minutes. In addition, some will prefer finding confirmation from 2 or more higher time frames. Others may find more suitable to balance their time frame analysis with one higher and one lower time frame. It is likely that using a conservative rule base over 4 time frames can reduce trading ambiguity to next to zero. The trader's risk adverseness is key here as he/she will have to devise a rule set based on indicators confirming each other on different time frames making trading as comfortable as possible.
3) There are always times of congestion, relative market inactivity, which will inevitably affect indicator calculations. One way to reduce such impact on indicator reading is to opt for tick charts or volume charts, or alternative market representations like Renko charts. Congestion on a time frame should indicate going higher or lower. Most traders will try and go to a lower time frame to detect waves or cycles he/she can trade. It is however on the contrary often recommended to go higher, or even better go both higher for context, and lower for trading points.
4)Markets are highly dynamic. Prices are chaotic, non stationary etc... Still, this is no reason to try and throw everything but the kitchen sink into your favorite trading platform. Do not forget to still be able to fully understand the method you are trying to put together... You are the trader... don't ever forget this subtle point. Successful traders always know the finest details in trading calculations. Do not underestimate 2 things however: stats will be in most cases wrong as they do imply stationarity that is just not there. Secondly, many many 'market cycles' gurus will find cycles in a market that cannot produce any stable cycles. One way to put it is that if you look hard enough, and with a bit of faith, you'll always find what you are looking for. It is a common mental process distortion.
5) Markets are chaotic, and contain fractal features. Once you have found a sound technique, it should work the same on another set of time frames, as well as on other financial instruments. This is the 'acid test'. Many models just fit one instrument on a single time frame, and are bound to fail sooner or later. There may of course be some adjustments needed (not more than a few degrees of freedom if possible) to adapt from one instrument to the next, but not more than that.
6) I personally do not use astrology, lunar cycles, solar eruptions etc... I am not going to debate Darwinism, the Big Bang or other esoteric sources either. Some say trading is more art than science too... Scientists like me would rather say there is still some unexplained fuzziness in markets, a LOT of unknown stuff in Nature, and that's much better that way... we, humans are so big headed already... so please stay humble...
These forewords may sound like vague generalities, and there are admittedly many ways to spoil a cat (I love cats to i had to twist that cruel expression a bit), but they can be a crucial time saver to you in the end, and most important may prevent you from wandering around lots of trading costly dead-ends...
Essential Tools
1) A prerequisite to trading in my opinion is some knowledge of Fibonacci numbers, and in that respect, I can for instance recommend reading Jo DiNapoli's books. Most traders calculate Fib retracement and expansion numbers. There is more to it, and I may write about it at some point, although there is already ample literature on the Internet. Be careful though not to be too 'trigger-happy', Fib is still no panacea. It also fails!
2) Another very interesting calculation tool is the Murray Math Lines algorithms. It is still a proprietary algorithm, I believe, but it has however been mimicked and rewritten for most platforms nowadays. We of course have our own. A *FREE* VBA version of the algorithm is freely available on a MS Excel spreadsheet.
3) Adaptive indicators which calculate OK in a multi-time frame environment, such as stochastic indicators. Stochastics have that annoying tendancy to respond to a fairly narrow bandwidth. Try and make them as adaptive as you can, and when they lose efficiency, just jump time frames.
4) Get yourself a good pivot algorithm. It may at first look like just another display method for swing analysis, but there is more under the bonnet... Pivot sequences (in 2 or more time frames) can be used to derive waves, and can be used with advanced artificial intelligence algorithms to detect the next pivot hence patterns with sometimes very high probability. We use a numbering scheme (pivot classification somewhat remotely inspired by Clyde Lee).
ForeTrade - November 2007
1) Most indicators, either custom made or built in trading platforms, do calculate one or several mathematical outputs at each bar. One may also (correctly) say that prices are noisy, chaotic in nature, which obviously make "market reading" rather difficult. However, in my opinion, the problem is elsewhere... Indeed, most of the time, there is simply nothing to read in the market, not necessarily noise, but just irrelevant useless information. To be quite pragmatic about it, let's say that buying and selling are essentially discrete decision points, the rest is 'vacuity' which should be handled by money management, i.e. keeping an eye on your position.Trading should therefore always inherently remain dependent on an event driven technique. In other words, if you wish to crunch large amount of numbers in any crude or sophisticated way, irrespective of the rare salient events where effective decision making is only sensible, well... you might just be wasting your time... and LOTS of so-called trading gurus are quite willing to take you for a ride along the meanders of the never ending quest of the Holy Grail... (note: LOTS is still a huge understatement...)
2) Any sound decision can only make sense in perspective or context, unless you stick to quick scalping or to the simplest reversal strategy, assuming you get your pivot calculations right too.The best way to represent context is to work in a multi-time frame environment (2, 3 or even 4 time frames). It seems obvious that a move in your time frame of choice, determined by indicators lining up nicely either long or short, can only show strength if supported by a similar set-up in a higher time frame. Choice of adequate time frames may however not always be easy, and one could only hope for a trading platform in the future which would have adaptive bar intervals.For synch purposes, time frames will often be in multiples like 1, 2, 4, 8 minutes. In addition, some will prefer finding confirmation from 2 or more higher time frames. Others may find more suitable to balance their time frame analysis with one higher and one lower time frame. It is likely that using a conservative rule base over 4 time frames can reduce trading ambiguity to next to zero. The trader's risk adverseness is key here as he/she will have to devise a rule set based on indicators confirming each other on different time frames making trading as comfortable as possible.
3) There are always times of congestion, relative market inactivity, which will inevitably affect indicator calculations. One way to reduce such impact on indicator reading is to opt for tick charts or volume charts, or alternative market representations like Renko charts. Congestion on a time frame should indicate going higher or lower. Most traders will try and go to a lower time frame to detect waves or cycles he/she can trade. It is however on the contrary often recommended to go higher, or even better go both higher for context, and lower for trading points.
4)Markets are highly dynamic. Prices are chaotic, non stationary etc... Still, this is no reason to try and throw everything but the kitchen sink into your favorite trading platform. Do not forget to still be able to fully understand the method you are trying to put together... You are the trader... don't ever forget this subtle point. Successful traders always know the finest details in trading calculations. Do not underestimate 2 things however: stats will be in most cases wrong as they do imply stationarity that is just not there. Secondly, many many 'market cycles' gurus will find cycles in a market that cannot produce any stable cycles. One way to put it is that if you look hard enough, and with a bit of faith, you'll always find what you are looking for. It is a common mental process distortion.
5) Markets are chaotic, and contain fractal features. Once you have found a sound technique, it should work the same on another set of time frames, as well as on other financial instruments. This is the 'acid test'. Many models just fit one instrument on a single time frame, and are bound to fail sooner or later. There may of course be some adjustments needed (not more than a few degrees of freedom if possible) to adapt from one instrument to the next, but not more than that.
6) I personally do not use astrology, lunar cycles, solar eruptions etc... I am not going to debate Darwinism, the Big Bang or other esoteric sources either. Some say trading is more art than science too... Scientists like me would rather say there is still some unexplained fuzziness in markets, a LOT of unknown stuff in Nature, and that's much better that way... we, humans are so big headed already... so please stay humble...
These forewords may sound like vague generalities, and there are admittedly many ways to spoil a cat (I love cats to i had to twist that cruel expression a bit), but they can be a crucial time saver to you in the end, and most important may prevent you from wandering around lots of trading costly dead-ends...
Essential Tools
1) A prerequisite to trading in my opinion is some knowledge of Fibonacci numbers, and in that respect, I can for instance recommend reading Jo DiNapoli's books. Most traders calculate Fib retracement and expansion numbers. There is more to it, and I may write about it at some point, although there is already ample literature on the Internet. Be careful though not to be too 'trigger-happy', Fib is still no panacea. It also fails!
2) Another very interesting calculation tool is the Murray Math Lines algorithms. It is still a proprietary algorithm, I believe, but it has however been mimicked and rewritten for most platforms nowadays. We of course have our own. A *FREE* VBA version of the algorithm is freely available on a MS Excel spreadsheet.
3) Adaptive indicators which calculate OK in a multi-time frame environment, such as stochastic indicators. Stochastics have that annoying tendancy to respond to a fairly narrow bandwidth. Try and make them as adaptive as you can, and when they lose efficiency, just jump time frames.
4) Get yourself a good pivot algorithm. It may at first look like just another display method for swing analysis, but there is more under the bonnet... Pivot sequences (in 2 or more time frames) can be used to derive waves, and can be used with advanced artificial intelligence algorithms to detect the next pivot hence patterns with sometimes very high probability. We use a numbering scheme (pivot classification somewhat remotely inspired by Clyde Lee).
ForeTrade - November 2007
Wednesday, November 21, 2007
MTFS Pulse indicator
Another little goodie in our toolset is the MTFS_Pulse indicator.
It is not often displayed to avoid clutter, but some users may find it interesting. The logic behind it is quite simple. This adaptive StoK indicator is processed through a filter to bring about turning points in the indicator. (It does not use the complex StoK indicator in the DLL, so it is basically a *free* indicator).
How to use it?
The aggressive trader will look at the white or the brown line whereas the more conservative one will follow the slower green line.
Let's have a look at the various events shown on this screenshot:
(1) White line (WL) turning south. Do we go short? Nope! Never trade against the dominant trend given by the Swing indicator.
(2) Green Line (GL) now also turning south. Swing also turned down: one can sell on the first red bar. It is a sure winner as we are also selling on a strong MM resistance level.
(3) WL turning up. Do we buy? Nope! Main direction is still down, but we know we could think of taking profits.
(4) When WL turned north, cashing in on the short would be in order if not done before. When all 3 lines turn up, and Swing also shows a turnaround, it is time to go long.
(5) What do we do here? The conservative trader may want to take profits. After all, we are again on a strong resistance level. Going short? No way! Swing is still up.
(6) This is a typical "return to the trend" pattern (similar to the bell shape pattern in MTFS). If we have exited early, this is a good time to get back into the market.
(7) Do we sell? Do we go short? NO! Swing is still up. Now again the conservative trader may want to take profit on the first weakening signs (red bar)
(8) Time to go short? Absolutely! Here the more agressive trader will be of course rewarded.
One could now stay short or take profits when the WL starts moving up.
Reading the MTFS indicator
The published market snapshots on the other blog do not necessarily express clrealy the way a chart must be read.
In this case, if we take a look at yesterday's snapshot, and focus primarily on MTFS, we can see the MTFS lines on the 60mins hovering around low levels without crossing: it is a sign of a congestion with a lower bias. This figure hardly ever works the other way around as bear and bull patterns do not quite match in a mirror. The market is not 'symmetrical'.
The daily MTFS is even clearer: DOWN! No crossing and a negative gradient indicating a support must be found lower. Yet if one believes a MM and/or Fib level is rock solid or if significance level is not that great, one may be a little less bearish and opt for rather anticipating a congestion or a trading range.
On the weekly chart, which does not look the easiest to read, one can see a very early crossover of MTFS lines indicating also that what ever happens will be at least a little bearish.
Obviously all the other tools will confirm this scenario, but we here see that MTFS is read by its overall shape, its behaviour, and by its lines crossing
Tuesday, November 20, 2007
Using Entropy to detect turning points (2)
Here is another example of Entropy interpretation, this time in conjunction with other indicators.
As a reminder, Entropy measures how 'orderly' energy accumulates and dissipates. When energy accumulates, it may have to go against current movement until prices start changing directions. One can also see prices reacting like a coil spring stores and releases energy, hence price reaction can sometimes be sudden when compressed. Again, one must be very cautious to pay attention to those discrete times (events) when the indicator really carries information, and simply ignore the rest. There are so many traders trying to read some information when their favourite indicator does not contain any...
Let's have a look at a few events described on the above charts:
Event (1)
Entropy has bottomed and LEntBin is very low and this clearly confirms there is a reversal potential here. Swing is still down but one should prepare for a long after pivot 1.
Event (2)
This is a minor event. Entropy is crossing over 0. It is likely Swing indicator is about to turn up at this time. This confirms an upward potential, yet MTFS is not great yet. One can choose to enter or to wait. Since we are sitting on a strong MM support, one can maybe wait that the support is tested again (as often), but one can also try and enter immediately.
Event (3)
Entropy is peaking momentarily, yet one does not trade against the Swing indicator, so this event is simply ignored.
Event (4)
Swing is firmly engaged upward, MTFS is showing white line separation: if not long yet, it is about time to enter!
Event (5)
Like event (3), this event is ignored, but at the same time, we wee energy dissipating fairly quickly. This up move may not last too long.
Event (6)
Same as (3) and (5), the bull run is probably going to end soon. Let's prepare in case Swing and MTFS turn around...
Event (7)
One should have entered short when Swing has turned firmly south and MTFS lines have now crossed. If not short yet, Entropy crossing below 0 is one more confirmation it is time to enter a short trade.
We then see that Entropy seems to have found a trough, and RUT is close to a strong support again. MTFS is still fairly bearish, but nothing wrong with taking profits...
Monday, November 19, 2007
Using Entropy to detect turning points
Let's have a look at Entropy to detect/confirm turning points. We have 3 interesting different pivot situations here.
On Pivot 1, Entropy reaches a peak. LEntBin below confirms it is a significant peak (Bin = 4). Knowing we have this turnaround on a strong MM resistance level, we can happily go short.
On Pivot 2, we have a trough in Entropy. One could the same way as on Pivot 1 just go long, yet the Entropy bottom is not very 'deep' so one might want to take a chance (and be right this time), but one should generally wait for confirmation on crossover for safety.
Before Pivot 3, we have a peak in Entropy and incidently a weakening of MTFS (white line crossing over), which both preempt the next swing when accumulated energy finally dissipates. In this case, using Entropy peak is way too early, and waiting for crossover is way too late. One must only be prepared, and use the bar colour, the swing, and MM levels to confirm pivot. The MM level here was the well-known stall level ahead of the strong 2250 resistance level.
Retrieving Calculations (API) - Part 2
The Swing indicator is a very central indicator in the toolset. Like most of the indicators, it writes data in the appropriate segment of the DLL to be used either through the API or to be used in EasyLanguage.
For instance, the no-lag smoothed data series is recorded in an array which can be retrieved back from the DLL using:
RetrieveLagPrices (EasyLanguage)
BV_RetrieveLagPrices (VC++)
Same for swings with:
RetrieveSegPrices (EasyLanguage)
BV_RetrieveSegPrices (VC++)
For the time being, the EasyLanguage indicator only save the retrieved data to file, but all sorts of calculations can be done. In Part 1, we have shown how to calculate Fibonacci retracement and expansions.
The EL indicators are obviously not code protected, and are very simple to understand. They identify which is the calling chart using a common symbol identification (symbol + bartype + interval + TF multiplier). A loop is then used to extract prices individually.
For instance, the no-lag smoothed data series is recorded in an array which can be retrieved back from the DLL using:
RetrieveLagPrices (EasyLanguage)
BV_RetrieveLagPrices (VC++)
Same for swings with:
RetrieveSegPrices (EasyLanguage)
BV_RetrieveSegPrices (VC++)
For the time being, the EasyLanguage indicator only save the retrieved data to file, but all sorts of calculations can be done. In Part 1, we have shown how to calculate Fibonacci retracement and expansions.
The EL indicators are obviously not code protected, and are very simple to understand. They identify which is the calling chart using a common symbol identification (symbol + bartype + interval + TF multiplier). A loop is then used to extract prices individually.
Sunday, November 18, 2007
Cycle detection
On some occasions, cycle detection which should always be done cautiously for reasons of non-stationarity, seems to be valid at a particular point in time. In this instance, the error level is close to our optimal Lag128 algorithm's error level. We then check dominant cycles (F1 and F2) both in periods and amplitude. F1 seems to have a reasonable amplitude relative to all other frequencies in the spectrum, and F2 can be considered as noise (no amplitude). There is virtually never more than 1 or 2 dominant frequencies in the L-S spectrum.
The usual caveat has been repeated over and over: there is no reason to believe the dominant cycle (period of 72 bars) will last very long. So we will only maybe project it for a short while using a phase advance mechanism, and confirm it with other indicators such as support/resistance levels, entropy, MTFS lines etc.
Answer in about 2 to 3 weeks...
Swing indicator - a deeper look...
-- THIS IS AN ADVANCED TOPIC ---
The 2 snapshots above give the 3 available algorithms showing good potential in capturing market dynamics by way of a no-lag realtime smoothing algorithm. Our Swing indicator uses the Lag128 algorithm, despite Lag128T being 'theoretically' the most accurate one statistically. One possible reason is stats are often simply wrong when it comes to time series. One could debate about this non-stationarity, fat-tail distributions etc, but that is besides this topic and could be a little difficult to grasp. In any case, the two calculations may sometimes come pretty close. I would certainly prefer Lag128T to be as good as Lag128, as it calculates much much faster.
Obviously the optimised algorithm in Lag128 has been tweaked for time series, in particular to favour a low error level on the most recent bars (in other words, mistakes should rather belong to the past and be ignored). Insisting on a good model over recent bars provides far better patterns overall.
The last algorithm LombSin is very very processing intensive and should be used with caution. It goes further than the other 2 in extracting salient cycles along with the phase, thus allowing a price projection over a few bars. That would seem great if only such cycles had any chance to 'survive' over time. A lot of serious physicists will indeed tell you that cycles are very elusive or show you an instantaneous picture of what cycles have just looked like, and have no predictive value whatsoever. I would tend to agree.
However, i have noticed that when the LombSin error level falls close to the Lag128 error level (which is close to optimal), one can fit cycles correctly and predict at least a few bars ahead. Having said that, one may also just as well get that information from other indicators (MM, Fib etc) in our toolset.
Retrieving Calculations (API)
A number of accessors are available in the API to retrieve various calculations done by indicators and other analysis techniques. The most commonly used are :
BV_RetrievePivotsPrices
BV_RetrievePivotsIdx
To extract pivot info from the DLL after the Swing indicator calculates realtime pivots.
The API allows retrieving such info in a separate C++ program, but it is also possible to do the same within the TradeStation environment. Two sample indicators exist for that purpose:
RetrievePivotPrices
RetrievePivotInfo
The first one is very simple as it only prints pivots prices (normalised or original prices) in the TS debug window (View menu then "EasyLanguage Output Bar").
The second one (which can be improved) goes a little further and tries to calculate Fibonacci retracement and expansion levels when possible. A distinct leg is necessary to calculate retracement levels (38.2%, 50%, 61.8%), and a second leg i.e. a 3rd pivot is needed to calculate expansion levels (also called COP, OP and XOP levels). COP is a 61.8% expansion, OP a 100% expansion, and XOP a 161.8% expansion. Levels are plotted on the right hand side of the screen (L1 to L5). One shall recognise that:
L2 = Fib COP,
L3 = Fib OP,
L4 = Fib XOP.
BV_RetrievePivotsPrices
BV_RetrievePivotsIdx
To extract pivot info from the DLL after the Swing indicator calculates realtime pivots.
The API allows retrieving such info in a separate C++ program, but it is also possible to do the same within the TradeStation environment. Two sample indicators exist for that purpose:
RetrievePivotPrices
RetrievePivotInfo
The first one is very simple as it only prints pivots prices (normalised or original prices) in the TS debug window (View menu then "EasyLanguage Output Bar").
The second one (which can be improved) goes a little further and tries to calculate Fibonacci retracement and expansion levels when possible. A distinct leg is necessary to calculate retracement levels (38.2%, 50%, 61.8%), and a second leg i.e. a 3rd pivot is needed to calculate expansion levels (also called COP, OP and XOP levels). COP is a 61.8% expansion, OP a 100% expansion, and XOP a 161.8% expansion. Levels are plotted on the right hand side of the screen (L1 to L5). One shall recognise that:
L2 = Fib COP,
L3 = Fib OP,
L4 = Fib XOP.
Saturday, November 17, 2007
Standard Settings
Here are the settings used in the StandardSet analysis group.
1) The AdLag64StoK_MTF a.k.a. MTFS is the smoothed version of the AdStoK_MTF (which is also the regular MTFS indicator). Smoothing is done through superimposition of the regular MTFS with its self-memory variation. The mix is hard-coded.
The settings do not need to be changed at all, but some users may feel more at ease with a number of bars of 8 (faster), or 24 (slower). The acceleration (adaptation to changes in volatility) is sometimes more difficult to set, so it is best leaving it unchanged. Accel values generally range from 0 to 0.5, but double adaptiveness is optimal around 0.2 to 0.25.
2) AdStoK_MTF : as above
3) HA_ModPB colour paintbars: leave unchanged
4) HHLL_tl HighestHighs-LowestLows trend lines: use only with intraday data
5) LombEntropy (calculates a Lomb-Scargle spectrum then uses dominant cycle to calculate Entropy): no change, except a Time Frame Multiplier which should be left unchanged. A time frame multiplier of 2 or 3 may detect longer cycles, but this is generally irrelevant.
6) MM (MM lines): leave unchanged
7) MM target calculated on level breakout. No change needed (display code not optimised)
8) RegisterSymbol : no parameter, but this indicator is ESEENTIAL to proper use of the DLL, and must always be placed before the Swing2 indicator
9) Swing2: automatic pivot detection. TFmult must be 1, 2 or 3 (cf previous post "Common mistake with Swing2")
The StandardSet analysis group be can applied automatically on new charts. Please note that since some calculations are computing intensive, there have been (rare)occasions of sync problems. In such case, the indicator that would not plot correctly needs to be turned off and on again.
A common mistake with Swing2 indicator
This indicator purposely does not use "automatic barsback" calculation. The reason is that TS goes through the code to find which setting is appropriate when loading the chart. As this indicator is fairly computing intensive and as the number of bars is known (multiple of 128 bars), it is up to the user to set this parameter properly.
This setting never changes, and can (and should) be saved in an Analysis Group once for all.
By default, the indicator uses a TF multiplier of 1 (128 bars), so only change it to a number over 256 for TFm = 2 or over 384 for TFm = 3. The indicator will not return an error code if there are not enough bars on your chart, and will just cancel calculations.
As a reminder, SD is the Search Depth parameter (0 for default, 1 for refined in most cases), and Fuzzy Neighbourhood allows finding fuzzy pivots, 1 being 'crisp' and the parameter being generally up to 3 or 4 max.
This setting never changes, and can (and should) be saved in an Analysis Group once for all.
By default, the indicator uses a TF multiplier of 1 (128 bars), so only change it to a number over 256 for TFm = 2 or over 384 for TFm = 3. The indicator will not return an error code if there are not enough bars on your chart, and will just cancel calculations.
As a reminder, SD is the Search Depth parameter (0 for default, 1 for refined in most cases), and Fuzzy Neighbourhood allows finding fuzzy pivots, 1 being 'crisp' and the parameter being generally up to 3 or 4 max.
Monday, November 5, 2007
Some thoughts...
Who uses this indicator toolset?
The technique outlined in this blog, in its current version, is suitable for discretionary traders. An API is available and other tools can be developed inside or outside TradeStation. Some of those tools may be published or sold separately at some point, but it is for the time being more important to me to deliver interesting analysis tools, independent on each and everyone's trading strategy and money management.
How did this technique come about?
Well, 15 years of experience, system development, trading have certainly helped me eliminate a few dead ends, hence a few guidelines here given, which may suprise a few 'dogmatic' traders, shaped by most trading tools commercially available... including TradeStation.
Most indicators, either custom made or built in trading platforms, do calculate one or several mathematical outputs at each bar. One may also (correctly) say that prices are noisy, chaotic in nature, which obviously make "market reading" rather difficult. However, in my opinion, the problem is elsewhere... Indeed, most of the time, there is simply nothing to read in the market, and more pragmatically, buying and selling are essentially discrete decision points. This simply means that trading is inherently dependent on an event driven technique. In other words, if you wish to crunch large amount of numbers in any crude or sophisticated way, irrespective of the rare salient events where effective decision making is only sensible, well... you might just be wasting your time... and LOTS of so-called trading gurus are quite willing to take you for a ride along the meanders of the never ending quest of the Holy Grail...
Any sound decision can only make sense in perspective or context, unless you stick to quick scalping or to the simplest reversal strategy, assuming you get your pivot calculations right too.The best way to represent context is to work in a multi-time frame environment (2, 3 or even 4 time frames). It seems obvious that a move in your time frame of choice, determined by indicators lining up nicely either long or short, can only show strength if supported by a similar set-up in a higher time frame. Choice of adequate time frames may however not always be easy. For synch purposes, time frames will often be in multiples like 1, 2, 4, 8 minutes. In addition, some will prefer finding confirmation from 2 or more higher time frames. Others may find more suitable to balance their time frame analysis with one higher and one lower time frame. It is likely that using a conservative rule base over 4 time frames can reduce trading ambiguity to next to zero.
There are always times of congestion, relative market inactivity, which will inevitably affect indicator calculations. One way to reduce such impact on indicator reading is to opt for tick charts or volume charts, or alternative market representations like Renko charts.
Markets are highly dynamic. Prices are chaotic, non stationary etc... Still, this is no reason to try and throw everything but the kitchen sink into your favorite trading platform. Do not forget to still be able to fully understand the method you are trying to put together... You are the trader... don't ever forget this subtle point. Successful traders always know the finest details in trading calculations.
Markets are chaotic, and contain fractal features. Once you have found a sound technique, it should work the same on another set of time frames, as well as on other financial instruments. This is the 'acid test'. Many models just fit one instrument on a single time frame, and are bound to fail sooner or later. There may of course be some adjustments needed (not more than a few degrees of freedom if possible) to adapt from one instrument to the next, but not more than that.
More to come soon... and comments welcome as always...
bv
The technique outlined in this blog, in its current version, is suitable for discretionary traders. An API is available and other tools can be developed inside or outside TradeStation. Some of those tools may be published or sold separately at some point, but it is for the time being more important to me to deliver interesting analysis tools, independent on each and everyone's trading strategy and money management.
How did this technique come about?
Well, 15 years of experience, system development, trading have certainly helped me eliminate a few dead ends, hence a few guidelines here given, which may suprise a few 'dogmatic' traders, shaped by most trading tools commercially available... including TradeStation.
Most indicators, either custom made or built in trading platforms, do calculate one or several mathematical outputs at each bar. One may also (correctly) say that prices are noisy, chaotic in nature, which obviously make "market reading" rather difficult. However, in my opinion, the problem is elsewhere... Indeed, most of the time, there is simply nothing to read in the market, and more pragmatically, buying and selling are essentially discrete decision points. This simply means that trading is inherently dependent on an event driven technique. In other words, if you wish to crunch large amount of numbers in any crude or sophisticated way, irrespective of the rare salient events where effective decision making is only sensible, well... you might just be wasting your time... and LOTS of so-called trading gurus are quite willing to take you for a ride along the meanders of the never ending quest of the Holy Grail...
Any sound decision can only make sense in perspective or context, unless you stick to quick scalping or to the simplest reversal strategy, assuming you get your pivot calculations right too.The best way to represent context is to work in a multi-time frame environment (2, 3 or even 4 time frames). It seems obvious that a move in your time frame of choice, determined by indicators lining up nicely either long or short, can only show strength if supported by a similar set-up in a higher time frame. Choice of adequate time frames may however not always be easy. For synch purposes, time frames will often be in multiples like 1, 2, 4, 8 minutes. In addition, some will prefer finding confirmation from 2 or more higher time frames. Others may find more suitable to balance their time frame analysis with one higher and one lower time frame. It is likely that using a conservative rule base over 4 time frames can reduce trading ambiguity to next to zero.
There are always times of congestion, relative market inactivity, which will inevitably affect indicator calculations. One way to reduce such impact on indicator reading is to opt for tick charts or volume charts, or alternative market representations like Renko charts.
Markets are highly dynamic. Prices are chaotic, non stationary etc... Still, this is no reason to try and throw everything but the kitchen sink into your favorite trading platform. Do not forget to still be able to fully understand the method you are trying to put together... You are the trader... don't ever forget this subtle point. Successful traders always know the finest details in trading calculations.
Markets are chaotic, and contain fractal features. Once you have found a sound technique, it should work the same on another set of time frames, as well as on other financial instruments. This is the 'acid test'. Many models just fit one instrument on a single time frame, and are bound to fail sooner or later. There may of course be some adjustments needed (not more than a few degrees of freedom if possible) to adapt from one instrument to the next, but not more than that.
More to come soon... and comments welcome as always...
bv
Saturday, November 3, 2007
MurreyMath - Gann ... More details
This article was previously included within a RUT commented chart on the Market Snapshot blog.
MM Line Interpretation
Murrey Math is a trading system for all equities. This includes stocks, bonds, futures (index, commodities, and currencies), and options. The main assumption in Murrey Math is that all markets behave in the same manner (i.e. all markets are traded by a mob and hence have similar characteristics.). The Murrey Math trading system is primarily based upon the observations made by W.D. Gann in the first half of the 20th century. While Gann was purported to be a brilliant trader in any market his techniques have been regarded as complex and difficult to implement. The great contribution of Murrey Math (T. H. Murrey) was the creation of a system of geometry that can be used to describe market price movements in time. This geometry facilitates the use of Gann's trading techniques.
The Murrey Math trading system is composed of two main components; the geometry used to gauge the price movements of a given market and a set of rules that are based upon Gann and Japanese candlestick formations. The Murrey Math system is not a crystal ball, but when implemented properly, it can have predictive capabilities. Because the Murrey Math rules are tied to the Murrey Math geometry, a trader can expect certain pre-defined behaviours in price movement. By recognizing these behaviours, a trader has greatly improved odds of being on the correct side of a trade. The overriding principle of the Murrey Math trading system is to recognize the trend of a market, trade with the trend, and exit the trade quickly with a profit (since trends are fleeting). In short, "No one ever went broke taking a profit".
The Murrey Math geometry mentioned above is "elegant in its simplicity". Murrey describes it by saying, "This is a perfect mathematical fractal trading system". An understanding of the concept of a fractal is important in understanding the foundation of Murrey Math. For readers interested in knowing more about fractals I would recommend the first 100 pages of the book,"The Science of Fractal Images" edited by Heinz-Otto Peitgen and Dietmar Saupe. The book was published by Springer-Verlag, copyright 1988. An in depth understanding of fractals requires more than "8'th grade math", but an in depth understanding is not necessary (just looking at the diagrams can be useful).
The size (scale) of basic geometric shapes are characterized by one or two parameters. The scale of a circle is specified by its diameter, the scale of a square is given by the length of one of its sides, and the scale of a triangle is specified by the length of its three sides. In contrast, a fractal is a self similar shape that is independent of scale or scaling. Fractals are often constructed by repeating a process recursively over and over.
The next question, of course is, "What does a fractal have to do with trading in equity markets?" Imagine if someone presented you with a collection of price-time charts of many different equities and indices from many different markets. Each of these charts has been drawn using different time scales. Some are intraday, some are daily, and some are weekly. None of these charts, however, is labelled. Without labels, could you or anyone else distinguish a daily chart of the Dow from a weekly chart of IBM, or from an intraday chart of wheat prices. Not very likely. All of these charts, while not identical, appear to have the same general appearance. Within a given time period the price moves some amount, then reverses direction and retraces some of its prior movement. So, no matter what price-time scales we use for our charts they all look pretty much the same (just like a fractal). The "sameness" of these various charts can be formally characterized mathematically (but this requires more that 8th grade math and is left as an exercise to the interested reader).
Gann was a proponent of "the squaring of price and time", and the use of trend lines and various geometric angles to study price-time behavior.Gann also divided price action into eighths. Gann then assigned certain importance to markets moving along trendlines of some given angle. Gann also assigned importance to price retracements that were some multiple of one eighth of some prior price movement. For example, Gann referred to movement along the 45 degree line on a price-time chart as being significant. He also assigned great significance to 50% retracements in the price of a commodity. The question is, "A 45 degree angle measured relative to what?" "A 50% retracement relative to what prior price?"
These angle or retracement measurements are made relative to Gann's square of price and time. Gann's square acted as a coordinate system or reference frame from which price movement could be measured. The problem is that as the price of a commodity changes in time, so must the reference frame we are using to gauge it. How should the square of price and time (the reference frame) be changed so that angles and retracements are measured consistently?
This question is one of the key frustrations in trying to implement Gann's methods. One could argue that Gann recognized the fractal nature of market prices changing in time. Gann's squaring of price and time, however, did not provide an objective way of quantifying these market price movements. If one could construct a consistent reference frame that allowed price movement to be measured objectively at all price-time scales, then one could implement Gann's methods more effectively.
This is exactly what Murrey Math has accomplished.For more details, it is recommended to study Murrey Math literature etc (http://www.murreymath.com/)
Here below is a short description extracted from a document published a few years ago by Tim Kruzel , which since seems to have disappeared from the face of the WWW.·
MM Line Interpretation
Murrey Math is a trading system for all equities. This includes stocks, bonds, futures (index, commodities, and currencies), and options. The main assumption in Murrey Math is that all markets behave in the same manner (i.e. all markets are traded by a mob and hence have similar characteristics.). The Murrey Math trading system is primarily based upon the observations made by W.D. Gann in the first half of the 20th century. While Gann was purported to be a brilliant trader in any market his techniques have been regarded as complex and difficult to implement. The great contribution of Murrey Math (T. H. Murrey) was the creation of a system of geometry that can be used to describe market price movements in time. This geometry facilitates the use of Gann's trading techniques.
The Murrey Math trading system is composed of two main components; the geometry used to gauge the price movements of a given market and a set of rules that are based upon Gann and Japanese candlestick formations. The Murrey Math system is not a crystal ball, but when implemented properly, it can have predictive capabilities. Because the Murrey Math rules are tied to the Murrey Math geometry, a trader can expect certain pre-defined behaviours in price movement. By recognizing these behaviours, a trader has greatly improved odds of being on the correct side of a trade. The overriding principle of the Murrey Math trading system is to recognize the trend of a market, trade with the trend, and exit the trade quickly with a profit (since trends are fleeting). In short, "No one ever went broke taking a profit".
The Murrey Math geometry mentioned above is "elegant in its simplicity". Murrey describes it by saying, "This is a perfect mathematical fractal trading system". An understanding of the concept of a fractal is important in understanding the foundation of Murrey Math. For readers interested in knowing more about fractals I would recommend the first 100 pages of the book,"The Science of Fractal Images" edited by Heinz-Otto Peitgen and Dietmar Saupe. The book was published by Springer-Verlag, copyright 1988. An in depth understanding of fractals requires more than "8'th grade math", but an in depth understanding is not necessary (just looking at the diagrams can be useful).
The size (scale) of basic geometric shapes are characterized by one or two parameters. The scale of a circle is specified by its diameter, the scale of a square is given by the length of one of its sides, and the scale of a triangle is specified by the length of its three sides. In contrast, a fractal is a self similar shape that is independent of scale or scaling. Fractals are often constructed by repeating a process recursively over and over.
The next question, of course is, "What does a fractal have to do with trading in equity markets?" Imagine if someone presented you with a collection of price-time charts of many different equities and indices from many different markets. Each of these charts has been drawn using different time scales. Some are intraday, some are daily, and some are weekly. None of these charts, however, is labelled. Without labels, could you or anyone else distinguish a daily chart of the Dow from a weekly chart of IBM, or from an intraday chart of wheat prices. Not very likely. All of these charts, while not identical, appear to have the same general appearance. Within a given time period the price moves some amount, then reverses direction and retraces some of its prior movement. So, no matter what price-time scales we use for our charts they all look pretty much the same (just like a fractal). The "sameness" of these various charts can be formally characterized mathematically (but this requires more that 8th grade math and is left as an exercise to the interested reader).
Gann was a proponent of "the squaring of price and time", and the use of trend lines and various geometric angles to study price-time behavior.Gann also divided price action into eighths. Gann then assigned certain importance to markets moving along trendlines of some given angle. Gann also assigned importance to price retracements that were some multiple of one eighth of some prior price movement. For example, Gann referred to movement along the 45 degree line on a price-time chart as being significant. He also assigned great significance to 50% retracements in the price of a commodity. The question is, "A 45 degree angle measured relative to what?" "A 50% retracement relative to what prior price?"
These angle or retracement measurements are made relative to Gann's square of price and time. Gann's square acted as a coordinate system or reference frame from which price movement could be measured. The problem is that as the price of a commodity changes in time, so must the reference frame we are using to gauge it. How should the square of price and time (the reference frame) be changed so that angles and retracements are measured consistently?
This question is one of the key frustrations in trying to implement Gann's methods. One could argue that Gann recognized the fractal nature of market prices changing in time. Gann's squaring of price and time, however, did not provide an objective way of quantifying these market price movements. If one could construct a consistent reference frame that allowed price movement to be measured objectively at all price-time scales, then one could implement Gann's methods more effectively.
This is exactly what Murrey Math has accomplished.For more details, it is recommended to study Murrey Math literature etc (http://www.murreymath.com/)
Here below is a short description extracted from a document published a few years ago by Tim Kruzel , which since seems to have disappeared from the face of the WWW.·
Commented chart (audio soundtrack)
Here is a commented audio soundtrack (8m25s) to complement the Oct 21st SPY chart.
Please note that these indicators can be used unchanged on various symbols and time frames. The technique was designed to remain as simple as possible so that decision making remains quick and as unambiguous as possible. It must also be noted that all indicators feed an API allowing developers to build their own rule set to contribute to even easier decision making.
The audio/MP3 file (~8MB) can be downloaded here.
The purpose is to teach traders how simple it can be to read charts using this TradeStation technique. The purpose of the commented charts published on Market Snapshot is to develop a 3 to 5 bar outlook, mostly at daily level. One therefore tries to estimate where the market is going about 1 week ahead. Since this was done on Oct 21st, I here also include the chart dates Oct 24th, which confirms the retracement scenario (it was admittedly easy).
Please note that these indicators can be used unchanged on various symbols and time frames. The technique was designed to remain as simple as possible so that decision making remains quick and as unambiguous as possible. It must also be noted that all indicators feed an API allowing developers to build their own rule set to contribute to even easier decision making.
Indicator Interpretation - Snapshot 1
Commented Snapshot taken on RUT Aug 21st (60mins chart).
The technique is described as a discretionary trading method. However each and every piece of information feeds into the data segment of the custom DLL and can be used in C++ app using our API.
As an aside, please note that all indicators but the AdStoK have no parameters and adapt well to most if not all symbols and time frames. The AdStoK may also lose its last one or two parameters in a future release, which are in any case hardly ever modified in the current version of the indicator.
Edit: AdStoK has been renamed MTFS (Multi Time Frame Stochastic), and a significance level has now been added to better assess the pertinence of calculations at a given time frame.
Detecting market direction without the Swing indicator
MM technique short description on RUT - Daily Chart
Upper Magenta Dotted Line - Ultimate Resistance
These lines are the hardest to penetrate on the way up, and provide the greatest resistance. (Prices sometimes never make it through these lines).·
Upper Grey Line - Weak, Stall and Reverse (not displayed – halfway line)
This line is weak. If prices however run up too far too fast, and if they stall at this line they will reverse down fast. If prices do not stall at this line they will move up to the Upper Magenta Dotted line.·
Upper White Dots - Pivot, Reverse (displayed when prices come close)
This line is second only to the Central Yellow dotted line in its ability to force prices to reverse. This is true whether prices are moving up or down.·
Upper Trading Range Level (not displayed – halfway line)
The prices of all entities will spend 40% of the time moving between the Upper Green line and Lower Green line. If prices move above the Upper Green line and stay above it for 10 to 12 bars, the entity is said to be selling at a premium to what one wants to pay for it and prices will tend to stay above this line in the "premium area". If, however, prices fall below the Upper Green line then they will tend to fall further looking for support at a lower level.·
Central Yellow Dots - Major Support/Resistance Pivot Point
This line provides the greatest amount of support and resistance. This line has the greatest support when prices are above it and the greatest resistance when prices are below it. This price level is the best level to sell and buy against.·
Lower Trading Range Level (not displayed – halfway line)
If prices are below this line and moving upwards, this line is difficult to penetrate. If prices penetrate above this line and stay above this line for 10 to 12 bars then prices will stay above this line and spend 40% of the time moving between this line and the Upper Green line.·
Lower White Dots - Pivot, Reverse (displayed when prices come close)
This line is second only to the Central Blue line in its ability to force prices to reverse. This is true whether prices are moving up or down.·
Lower Grey Line - Weak, Stall and Reverse (not displayed – halfway line)
This line is weak. If prices however run down too far too fast, and if they stall at this line they will reverse up fast. If prices do not stall at this line they will move down to the Lower Cyan Dotted line.·
Lower Cyan Dotted Line - Ultimate Support
These lines are the hardest to penetrate on the way down and provide the greatest support. (Prices sometimes never make it through these lines).
Indicator Interpretation - Entropy
The Swing Indicator - Part 2
The Swing Indicator
We here have 3 adaptive Swing indicators applied to QQQQ 5 mins, declined in 3 different lengths or Time Frame Multipliers.The shortest Swing is the white line, calculated over 128 bars. The second one is the yellow line, which with a TF multiplier of 2 calculates swings over 256 bars. The third one is the green line with a TF multiplier of 3.
The Swing indicator also has a Search Depth parameter. In most cases, the default setting (0) will suffice. However, in certain circumstances like a strong bull run, the indicator will obviously 'keep it simple' and bring about a straight line. The user may want to search longer for less obvious waves with a Search Depth parameter set to 1. The plot colour is then a little darker.
Since the indicator focuses on a fixed number of bars, the oldest leg is always incomplete. A future version may be implemented to draw all swings since bar 1, or give the user more flexibility in choosing the number of bars. It is not a technical difficulty, but rather a speed compromise which led to the current design. The Swing indicator indeed uses a proprietary Genetic Algorithm to detect pivot points, and can sometimes be computing intensive particularly on low time frames if a number of charts are open simultaneously.
An additional indicator can be added to the chart to retrieve pivot points and calculate Fib retracement and expansions automatically when swing legs show the right characteristics. Please note that communication between indicators, in this particular instance, the swing indicator writing pivot points in shared memory later retrieved by the Fib calculation. The same principle can be applied outside TradeStation, i.e. pivot information can be used in a VC++ program via the API.More details on the API will be posted soon on a separate site. Contact me for details.
Subscribe to:
Posts (Atom)