Momentum Divergence Trading System
Posted: Sun Dec 25, 2016 12:50 am
Hi all,
This is another trading system I built that uses my custom implementation of momentum divergence detection. I'm not using this to trade live but instead am using this as a sub-system in the Livermore MVS I shared earlier. I'm sharing it in this format so you can see the benefit of including this as a sub-system in your own ATS. If you run this on an @ES#C chart, you will see it has a very high average trade value which means that although it does not give a lot of signals, when it does, it is usually pretty accurate at identifying large movements. Note: as we have been in a bullish market, it does a much better job at identifying bullish momentum divergence.
Here is the backtesting code: http://www.wave59.com/library/scriptdetail.asp?id=179
There are two things that are unique about this momentum divergence detection algorithm.
The first is it determines when to check for momentum divergence by identifying the "kicker" candlestick pattern using a regular expression. Once it identifies the kicker pattern, it stores the information, including momentum value for that bar and then begins to search through previously identified kicker patterns and compares their momentum values.
The second is that as it is searching through previously identified kicker patterns and comparing momentum values, it will continue doing so until
a. The low of the bullish kicker pattern is lower than the most recently identified bullish kicker pattern
b. The high of the bearish kicker pattern is higher than the most recently identified bearish kicker pattern
This means the momentum divergence detection is first looking for smaller momentum divergence occurrences and if it does not find any that fit the criteria, will continue searching for larger momentum divergence occurrences until it hits the max number of bars to look back for divergence which you provide as input.
This algorithm will work for other time frames, futures, etc. but you will have to adjust the input parameters until the detection is what you are looking for. The comments in the code describe all of the inputs.
Also, if you break this out into a function to be used in one of your systems, you will need to include the regex on the indicator level and then pass the information to the function as I cannot get regex to work inside of a function without an error.
Attached is a screenshot explaining what it is doing on the chart as well as backtesting results.
This is another trading system I built that uses my custom implementation of momentum divergence detection. I'm not using this to trade live but instead am using this as a sub-system in the Livermore MVS I shared earlier. I'm sharing it in this format so you can see the benefit of including this as a sub-system in your own ATS. If you run this on an @ES#C chart, you will see it has a very high average trade value which means that although it does not give a lot of signals, when it does, it is usually pretty accurate at identifying large movements. Note: as we have been in a bullish market, it does a much better job at identifying bullish momentum divergence.
Here is the backtesting code: http://www.wave59.com/library/scriptdetail.asp?id=179
There are two things that are unique about this momentum divergence detection algorithm.
The first is it determines when to check for momentum divergence by identifying the "kicker" candlestick pattern using a regular expression. Once it identifies the kicker pattern, it stores the information, including momentum value for that bar and then begins to search through previously identified kicker patterns and compares their momentum values.
The second is that as it is searching through previously identified kicker patterns and comparing momentum values, it will continue doing so until
a. The low of the bullish kicker pattern is lower than the most recently identified bullish kicker pattern
b. The high of the bearish kicker pattern is higher than the most recently identified bearish kicker pattern
This means the momentum divergence detection is first looking for smaller momentum divergence occurrences and if it does not find any that fit the criteria, will continue searching for larger momentum divergence occurrences until it hits the max number of bars to look back for divergence which you provide as input.
This algorithm will work for other time frames, futures, etc. but you will have to adjust the input parameters until the detection is what you are looking for. The comments in the code describe all of the inputs.
Also, if you break this out into a function to be used in one of your systems, you will need to include the regex on the indicator level and then pass the information to the function as I cannot get regex to work inside of a function without an error.
Attached is a screenshot explaining what it is doing on the chart as well as backtesting results.