gopala Posted December 15, 2010 Report Share Posted December 15, 2010 Been fooling around with "Trend continuation factor" indicator by M.H. Pee and somehow I could not find the "original" indicator for mt4 (the non-smoothed one) so, here it is (along with the original article by M.H.Pee about the way it should be calculated and used). One T3 smoothed version of it can be found here : Trend continuation factor2 - MQL4 Code Base but it recalculates all the bars so I decided to post a new smoothed version too http://img32.imageshack.us/img32/5199/tcf1.gif hxxp://www.megaupload.com/?d=AXW1BYP5 ------------------------------------------------------------------ --------------------------------------------------------------------- the smoothed one look good in historical chart -- for currency with good big fluctuation whatever it is called, it may be a good visual indicator for trend or range or rebound (have to do live trade test first -- to know how far it will be smoothed) but definitely need some EMA line for ENTRY -- otherwise, screws ~ the bottom indicator (see the left part is WRONG -- while after flattering in the middle -- RIGHT part is correct ) http://img256.imageshack.us/img256/4614/tci2smoothedgoodtrendin.jpg -------------------------------------------------------------------- M.H.Pee has done some other great work on trend indicators over the years, which were published in S&C Magazine. If you do a search on traders.com web site will turn up 6 to 7 articles on his trend indicators. I have most of them but will need to scan some older editions of S&C to post them. Let me know if you would like them. -------------------------------------------------------------------- I do recommend that people read that document of how to use trend detection index, since it is not about two lines crossing. http://img29.imageshack.us/img29/923/tdi3.gif hxxp://www.megaupload.com/?d=7OSIH0CR -------------------------------------------------------------------- Continuing. http://img34.imageshack.us/img34/4332/tdi4.gif hxxp://www.megaupload.com/?d=4FEJ2JWB -------------------------------------------------------------------- PHASE CHANGE INDEX: --------------------- Green represents situation 1 and situation 3 in the document (which is momentum>0 and PCI<20) Red represents situation 2 and situation 4 in the document (which is momentum<0 and PCI>80) Orange represents situation 5(which is momentum>0 and PCI>80) and situation 6 (which is momentum<0 and PCI<20) in the document. http://img219.imageshack.us/img219/3406/pci23.gif hxxp://www.megaupload.com/?d=X1M3VE59 -------------------------------------------------------------------- The main difference comes from the usage of buffers and arrays. I am using arrays for everything except the values that need to be displayed on the chart. The way array are treated in my code (btw: it is not my invention, first one that I saw do something like that was igorad, I just added the usage of second dimension) means that array elements are accessed in "inverted logic" to buffer logic (in "buffer logic" buffer[0] is the current value, in that "array logic" array[0] is the oldest value) I like this way because apart of resizing the array to current bars size, it does not require any additional coding and allows simple using of two dimensional arrays instead of buffers (it is still an 8 buffer limitation in MT4, MT5 will not have that limitation) Also, there is one difference in my calculation compared to M.H.Pee way : in his article he calculates momentum(5) as a momentum of 5 elements and not what momentum(5) is - a momentum of 1st and 6th element (if we used Pee's logic, than momentum(1) would always be 0, and as we know, it is not) Hence I do not have the /(Length-1) part but rather simple /(Length). And further To get same values as Pee for his 35 PCI one should use length 34 Anyway, here are tose PCI and T3 smoothed PCI. There is no secret in the code, one really must read what for and how does Pee use that indicator. That is all http://img641.imageshack.us/img641/1025/pci1.gif hxxp://www.megaupload.com/?d=RPC60VJU ------------------------------------------------------------------ visual check diff conditions histo on index - or may be put histo on direction line? (thought it safer to mess-up Rosh's version ) ------ p.s. INTERPRETING THE INDEX (Trend Detection Index by M.H. Pee) The trend detection index will signal a trend if it shows a positive value and a consolidation if it shows a negative one As a trend-follower, I will enter a position in the direction of the trend when the TDI (line) is positive. Basically, it comes down to this: Enter long if both the TDI and direction (lines) are positive enter short if the TDI line is positive and the direction line is negative. http://img46.imageshack.us/img46/5664/tdi00hist1.gif hxxp://www.megaupload.com/?d=91W7KS8Z benny3, jdsim1, ⭐ chan123 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.