Custom TRIX indicator
Forums › ProRealTime English forum › ProBuilder support › Custom TRIX indicator
- This topic has 5 replies, 4 voices, and was last updated 3 years ago by robertogozzi.
Tagged: trix
-
-
08/07/2021 at 9:54 PM #174885
I have found that TRIX indicator gives interesting results for entry positions, possible turning points in the market.
I searched the forums but couldn’t find the code for TRIX so I coded it.
The results seems identical to the built in TRIX indicator, however it gives you the option to use different types of Moving Averages. I have found that Time Series gives interesting results with either Zero Line Crossing (how the indicator is intended to be used, I believe) or when the direction of the indicator changes:
//Bull
c1 = cTRIX[1] < cTRIX[2] and cTRIX > cTRIX[1]
//Bear
c2 =cTRIX[1] > cTRIX[2] and cTRIX < cTRIX[1]
If you end up using (or already using?) this indicator in your strategies it would be great if you like to share how.
Reference for PRT Moving Averages (‘Type’ variable in the cTRIX indicator)
0 = SMA
1 = EMA
2 = WMA
3 = Wilder
4 = Triangular
5 = End point
6 = Time series
7 = Hull (PRT v11 only)
8 = ZeroLag (PRT v11 only)
1 user thanked author for this post.
08/07/2021 at 10:05 PM #174889Ah… sorry moderators of PRC, this should have been posted in ProBuilder. It’s my first attempt to make an indicator and the fact that I spend most of my time in the ProOrder section of this forum, I totally forgot that it should have been posted in a different section. I can’t see how I can move it over so would appreciate if you can do so, if necessary.
08/07/2021 at 10:33 PM #17489508/16/2021 at 1:30 PM #17546408/16/2021 at 8:01 PM #175491Hi Nicolas,
Yes, I noticed that too but I wanted to add the ability to change type of MA. There is no way to do this with the built in TRIX indicator, is there? Perhaps it’s not longer a TRIX once MA is changed but I’m getting interresting results with Times Series Average applied to this instead of EMA.
08/17/2021 at 1:43 AM #175501There you go:
12345678910111213141516171819202122232425// TRIX indicator custom//// Periods = 15// AvgType = 1 //type of MA// SignalP = 9// SignalT = 1 //type of MAsrc = closePeriods = max(2,min(999,Periods))AvgType = max(0,min(6,AvgType))SignalP = max(2,min(999,SignalP))SignalT = max(0,min(6,SignalT))//IF BarIndex > Periods THENMA1 = Average[Periods,AvgType](src)MA2 = Average[Periods,AvgType](MA1)MA3 = Average[Periods,AvgType](MA2)MyTrix = ((MA3 - MA3[1]) / MA3[1]) * 100IF BarIndex > (Periods + SignalP) THENSignal = Average[SignalP,SignalT](MyTrix)ENDIFELSEMyTrix = 1Signal = 1ENDIFRETURN MyTrix AS "Trix",Signal AS "Signal"1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on