Registered User Joined: 12/28/2010 Posts: 33
|
How do I create a formula that seeks divergence of momentum compared to price? Like if price is going up I want to be able to run a scan to find stocks where the momentum is going down. And vice versa Thanks
|
|
 Administration
Joined: 9/30/2004 Posts: 9,187
|
You could scan for those conditions. Click on Price and then Create Condition and set the condition to Moving Up Smart, then click Scan/Sort and click the Scan target on the workspace.
Repeat for Momentum, but select Moving Down Smart, and append the Momentum condition to the same scan.
Try setting the period on each condtion to the same period you're using for Momentum.
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
So there is no way to create one formula for that?
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
StockGuy's solution is easy to implement and very efficient to run.
Indicators, Sorting & Scanning
That said, we can possibly help you create a formula depending on your particular unambiguous objective definition of a divergence.
I can't replicate a Moving Up Smart or Moving Down Smart, but we could look for Net Changes, Linear Regression Slopes or both to be in opposite directions. Doing so would require knowing your Momentum settings, the period over which you wish to test for a divergence and if you want to use Net Change, Linear Regression Slope or both.
Using Linear Regression vs Classical Peaks/Valleys for Divergence Analysis
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
I would like two separate formulas using both Net Change and Linear Regression Slope to determine which works best for me. My momentum is set at 1 using daily bars. Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Over what period are you looking for the divergence (the period of the Net Change and Linear Regression)?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
YES
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is not a yes or no question. It is asking for period (a number of bars over which you are looking for a divergence).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
I would say the net change of 2 bars
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Looking for a 2-Period Net Change results in pretty much no difference than a Linear Regression Slope over the same period of time (a 3-Period Linear Regression Slope) as they would always return the same result.
A 1-Period Momentum is just:
100 * C / C1
You can determine if the 2-Period Net Change in Momentum is positive or negative without the 100 * at the front however. For example, the 2-Period Net Change in a 1-Period Momentum would be positive if:
C / C1 > C2 / C3
So a divergence would exist based on a 2-Period Net Change definition if:
C / C1 > C2 / C3 AND C < C2
Or if:
C / C1 < C2 / C3 AND C > C2
A combined formula which would check for either type of divergence could be written as:
(C / C1 > C2 / C3 AND C < C2) OR (C / C1 < C2 / C3 AND C > C2)
But could be shortened to:
SGN(C / C1 - C2 / C3) * SGN(C - C2) = -1
PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
Thanks
|
|
Registered User Joined: 1/27/2012 Posts: 4
|
QUOTE (alessandro monti) Hi to all members, my name is Alessandro from Italy, about a year I am interested in the market forex.Ho started reading the material available on the internet, then I started reading some books, Dave Landry.Jeff Cooper, Connors, and Candelstick analisi.today have stopped to read the chapter breakout volatility Connors, Connors uses an indicator of volatility with historical double ratio 100 / 6.100 / 10, and an average volatility of 50% to 100. From what I understand is that when the volatility of short drops below 50% of the value of clicks a warning signal for a setup and an eventual return of volatility to its values medi.Ad today my difficulties in order to test this strategy is that I can build an indicator like that, here in Italy trader gives me no help and no one knows where to find an indicator to indicate the genere.La my operating platform MetaTrader4 is the BASIC language MQL. Some of you are willing to help me?
Forgive my English
Sincerely.
Alessandro Monti
forgive me, I went to the ball 5 times after I posted forgive me. Bruce you can help me?
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There is a reply to your post in the HELP ME PLEASE! topic directing you to the Historical Volatility (HV) topic where Historical Volatility and related formulas for TC2000 created in the Personal Criteria Formula Language are discussed.
That said, MetaTrader4 is not one of our products. You would probably be better off asking the question in a MetaTrader related forum as I am not even remotely familiar with MetaTrader4 and cannot help you with third party products.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
I want the formula to express momentum diverging from the price. Meaning if price is selling off the momentum is rising And vice versa How can I do that
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
My Friday, January 27, 2012 1:48:05 PM ET reply explains how to do just that over a a period of 2-Bars. If you want something for a longer period, you would need to specify the number of bars over which you want to search for a divergence.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
Yeah I did those and it gave me stocks with momentum moving in the same direction as price
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
Please send me a formula for a 3 bar period on a 2 day chart Thanks
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
QUOTE (STOCKAFELLA) Yeah I did those and it gave me stocks with momentum moving in the same direction as price
C / C1 > C2 / C3 AND C < C2 definitely only returns true when the 1-Period Momentum is down over 2-Bars and Price is up over those same two bars.
C / C1 < C2 / C3 AND C > C2 definitely only returns true when the 1-Period Momentum is up over 2-Bars and Price is down over those same two bars.
(C / C1 > C2 / C3 AND C < C2) OR (C / C1 < C2 / C3 AND C > C2) definitely only returns true when the 1-Period Momentum has the opposite net change from price over two bars. The same is true of SGN(C / C1 - C2 / C3) * SGN(C - C2) = -1 (which returns the exact same symbols).
If the formula results don't match your chart, then something is different. The Net Change is being checked over something besides 2-Bars, the Period of the Momentum indicator isn't 1, the Chart isn't scrolled all the way to the right, the Time Frame of the Condition Formula isn't set to the same Time Frame of the Chart or some other discrepancy exists with the chart, its settings or interpretation.
QUOTE (STOCKAFELLA) Please send me a formula for a 3 bar period on a 2 day chart
You can adjust the Time Frame of the Condition Formula when you create it, edit it or use it in TC2000 version 12. So the same formula will work on a 1-Day Chart as a 2-Day Chart, you just need to set the Time Frame of the Condition Formula to match your desired chart Time Frame.
A Net Change of 3-Bars covers the same period as a 4-Period Linear Regression Slope and is the first point at which the Net Change and Linear Regression Slope might disagree.
A Condition Formula for a positive 3-Period Net Change in a 1-Period Momentum with a negative 3-Period Net Change in price would be:
C / C1 > C3 / C4 AND C < C3
A Condition Formula for a positive 4-Period Linear Regression Slope in a 1-Period Momentum with a negative 4-Period Linear Regression Slope in price would be:
3 * (C / C1 - C3 / C4) + C1 / C2 > C2 / C3 AND 3 * (C - C3) + C1 < C2
Combining these results in:
C / C1 > C3 / C4 AND C < C3 AND 3 * (C / C1 - C3 / C4) + C1 / C2 > C2 / C3 AND 3 * (C - C3) + C1 < C2
A Condition Formula for a negative 3-Period Net Change in a 1-Period Momentum with a positive 3-Period Net Change in price would be:
C / C1 < C3 / C4 AND C > C3
A Condition Formula for a negative 4-Period Linear Regression Slope in a 1-Period Momentum with a positive 4-Period Linear Regression Slope in price would be:
3 * (C / C1 - C3 / C4) + C1 / C2 < C2 / C3 AND 3 * (C - C3) + C1 > C2
Combining these results in:
C / C1 < C3 / C4 AND C > C3 AND 3 * (C / C1 - C3 / C4) + C1 / C2 < C2 / C3 AND 3 * (C - C3) + C1 > C2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/28/2010 Posts: 33
|
Thanks a lot Bruce. This was very helpful
|
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
|
Guest-1 |