Based on my Trend Checker indicator but converting the results into a weighted graph with a range from 100 to -100. Above zero indicates that long trades are favoured and below zero that short trades are favoured.
You can set as many look back periods as you wish up to a total of eight and for whatever length look back periods you wish.
The indicator simply compares the price now to the price at the beginning of each look back period and decides if it is up or down. The longer the look back period the more weight is given to the result in the final calculation as it is difficult to argue with a long term trend.
It works on all markets and all time frames although you will have to set each period for the chosen time frame as required.
For example if you apply the indicator to a 1 hour chart you may wish to set periods of 1, 4, 24 and 144 to represent 1 hour, 4 hour, 1 day and 1 week periods. On a daily chart you might have 1, 6, 24, 96, and 312 to represent 1 day, 1 week, 1 month and 1 year. You can choose whatever periods you like in whatever order you like and you can turn any period setting off by setting it to zero.
The price used can be set to any of the following by changing the PriceType setting to:
0 – Close
1 – Open
2 – Total Price
3 – Typical Price
4 – Weighted Close
5 – Median Price
I advise downloading the itf file rather than cut and paste to ensure you get all the functions to work correctly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
//Trend Checker Graph //Created by Vonasi //Row1 = 1 //Row1 = 2 //Row1 = 4 //Row1 = 8 //Row1 = 12 //Row1 = 24 //Row1 = 48 //Row1 = 96 //PriceType = 0 IF PriceType >=0 and PriceType <=5 THEN IF PriceType = 0 THEN PT = close ENDIF IF PriceType = 1 THEN PT = open ENDIF IF PriceType = 2 THEN PT = TotalPrice ENDIF IF PriceType = 3 THEN PT = TypicalPrice ENDIF IF PriceType = 4 THEN PT = WeightedClose ENDIF IF PriceType = 5 THEN PT = MedianPrice ENDIF ELSE PT = 0 ENDIF Trend = 0 Factor = 100/(Row1 + Row2 + Row3 + Row4 + Row5 + Row6 + Row7 + Row8) IF Row1 > 0 THEN IF PT > PT[Row1] THEN Trend = Trend + (Row1*Factor) ELSE IF PT < PT[Row1] THEN Trend = Trend - (Row1*Factor) ENDIF ENDIF ENDIF IF Row2 > 0 THEN IF PT > PT[Row2] THEN Trend = Trend + (Row2*Factor) ELSE IF PT < PT[Row2] THEN Trend = Trend - (Row2*Factor) ENDIF ENDIF ENDIF IF Row3 > 0 THEN IF PT > PT[Row3] THEN Trend = Trend + (Row3*Factor) ELSE IF PT < PT[Row3] THEN Trend = Trend - (Row3*Factor) ENDIF ENDIF ENDIF IF Row4 > 0 THEN IF PT > PT[Row4] THEN Trend = Trend + (Row4*Factor) ELSE IF PT < PT[Row4] THEN Trend = Trend - (Row4*Factor) ENDIF ENDIF ENDIF IF Row5 > 0 THEN IF PT > PT[Row5] THEN Trend = Trend + (Row5*Factor) ELSE IF PT < PT[Row5] THEN Trend = Trend - (Row5*Factor) ENDIF ENDIF ENDIF IF Row6 > 0 THEN IF PT > PT[Row6] THEN Trend = Trend + (Row6*Factor) ELSE IF PT < PT[Row6] THEN Trend = Trend - (Row6*Factor) ENDIF ENDIF ENDIF IF Row7 > 0 THEN IF PT > PT[Row7] THEN Trend = Trend + (Row7*Factor) ELSE IF PT < PT[Row7] THEN Trend = Trend - (Row7*Factor) ENDIF ENDIF ENDIF IF Row8 > 0 THEN IF PT > PT[Row8] THEN Trend = Trend + (Row8*Factor) ELSE IF PT < PT[Row8] THEN Trend = Trend - (Row8*Factor) ENDIF ENDIF ENDIF DrawHLine(0) Return Trend |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
I noticed a couple of typo errors in the code. The list of variables lines 4 to 11 should be //Row1 //Row2 //Row3 etc to 8 and not //Row1 //Row1 //Row1 etc. Just in case someone wants to remove the // and enter the values manually. If you install the ITF and change the values in the indicator windows this is irrelevant.
The other minor error is that line 40 should read PT = close so that the indicator defaults to close for any incorrect value entered. If you don’t change this minor error then you just don’t get any arrows for an incorrect value.
Thank you for your important contribution this week which is much appreciated! Happy New Year 2018
No problem. I hope they are useful to someone. Happy and hopefully prosperous New Year to you too!