Trend Strength/Momentum indicator
Forums › ProRealTime English forum › ProBuilder support › Trend Strength/Momentum indicator
- This topic has 7 replies, 3 voices, and was last updated 5 years ago by FabiusMor.
-
-
01/13/2020 at 1:09 PM #116631
Good afternoon everybody,
i’m trying to code an indicator that measure the strength of the trend (or momentum) of a given stock or ETF.
The inspiration for this indicator is from a company who makes trading researches and trading systems based on this measure. I’ve put together some quotes from their website to try to better understand how the indicator is calculated:
1- We use a special calculation of a trend strength that improves on the simple concepts of 6 to 12 month percent change used by IBD and James O’Shaughnessy. The trend strength indicator measures the price momentum over multiple time frames to be more responsive to changes in momentum than a basic percent change measure.
2- Our ETF models use a similar concept to the price change over a given period, however we have added some refinements. The actual trend strength indicator calculation uses proprietarily weighted returns from multiple time frames including six months. These custom weightings end up feeding a lot more data into the calculation then a simple one-period price change and by that measure it can smooth out some of the distortions from other methods of calculation it.
3- The trend strength indicator is also a “diminishing” value, meaning that if an ETF made a big up move and then went sideways for a few months, you would see the initial score rise with the up move and then slowly fade back to zero or go negative if the ETF started moving back down.
4- The trend strength indicator functions differently than oscillators like relative strength. The calculation looks at a series of different return periods with custom weightings for each.
5- The trend strength indicator is an indicator for momentum. It looks at different periods over the last several months and custom weights them to give a momentum score.
6- In term of the persistence of trend, the blend between 3 and 6 months performance (measured with ROC) is probably the best indication of what is most likely to persist.
In the attached PICTURE-1 you can see the trend strength measure represented as a line for the stock ADSK, the picture is taken from their website.
I used that representation to try to model my own calculation. I’ve tryed several combination of timeframes and weightings. The following code is the one which gives the most similar result:
<pre class=”lang:probuilder decode:true crayon-selected” title=”trendstrength”>mw=ROC[5](close)
m1=ROC[28](close)
m3=ROC[68](close)
m6=ROC[131](close)
zer=0trendstrength= (m6*0.2)+(m3*0.4)+(m1*0.2)+(mw*0.2)
return (trendstrength) coloured (0,70,250) style(line,2), (zer) coloured (0,0,0) style(line,1)
In attached PICTURE-2 you can see the comparison between my indicator and the original one. Even if it’s similar, the difference is evident.I’ve also tried to use different ways to measure momentum such as the one described in this topic https://www.prorealcode.com/prorealtime-indicators/relative-strength-rank-indicator/ but the results are not similar to the original.
Can someone help me understand how to calculate it correctly?
Thank you and have a nice day!
Fabius
01/13/2020 at 1:51 PM #116642Sorry, i made an error putting the code in the post and can’t edit it anymore. Here’s the code:
trend strength123456789mw=ROC[5](close)m1=ROC[28](close)m3=ROC[68](close)m6=ROC[131](close)zer=0trendstrength= (m6*0.2)+(m3*0.4)+(m1*0.2)+(mw*0.2)return (trendstrength) coloured (0,70,250) style(line,2), (zer) coloured (0,0,0) style(line,1)01/13/2020 at 1:53 PM #116643Since PRoBuilder does not currently support multiple time frames, I think whatever calculation you may try they will never match.
Moreover, coding is tied to numbers, to compare something you have to use the exact same settings and values.
Once ProBuilder supports MTF (maybe this year?!) and the settings are the same, results should match.
1 user thanked author for this post.
01/13/2020 at 2:09 PM #116645I could be wrong, but I think that when they say “multiple timeframes” they mean “multiple lookback periods“. I believe that their calculation could be the result of multiple lookback periods (like 6 months, 3 months, 1 month and maybe 1 even week) combined together.
01/13/2020 at 2:27 PM #116651I have no idea, it could be.
Anyway, when you have to deal with proprietary undisclosed software you can only guess settings, thus achieving reasults that may be close to theirs, still not matching!
1 user thanked author for this post.
01/13/2020 at 2:35 PM #116652You are totally right! Probably i’ll never get the same results.
By the way I just wanted to ask help to the community because i thoght that probably the calculation is made trough a method that i don’t know due to my lack of experience and maybe someone could know.
Anyway thank you Roberto!
01/13/2020 at 4:22 PM #116667This is just a revisit of dual/multiple momentum strategy. What you have done with your code is most likely what they have done with their own indicator, but since you can’t know what are the “weights” they use (are they dynamical?), it is somehow difficult to get the exact same result. By the way, maybe your indicator is better than their own! 😉
1 user thanked author for this post.
01/13/2020 at 10:04 PM #116701Thank you for your nice words Nicolas. 🙂
I think you got the point: weights might be dynamical. That’s something that came to my mind while making tests with a lot of different weights but no combination was fitting the picture in every part. But i’ll keep my calculation, don’t want to over complicate the thing.
Have a nice day!
-
AuthorPosts
Find exclusive trading pro-tools on