Changing TMA Slope indicator by Nicolas to a Screener!!
Forums › ProRealTime English forum › ProScreener support › Changing TMA Slope indicator by Nicolas to a Screener!!
- This topic has 10 replies, 2 voices, and was last updated 4 years ago by crolakstrading.
-
-
02/08/2020 at 1:12 AM #118987
This is regarding TMA Slope indicator by Nicolas!!
https://www.prorealcode.com/prorealtime-indicators/tma-slope/just wondering if it is possible to make this indicator to a screener…
When ”Buy Only” — once we get the first green histogram to ”buy only” get a signal on the screener eg; 1
When ”Sell Only” — once we get the first red histogram ”Sell only” get a signal on the screener eg; -1I tried to do this but failed miserably.. is it possible?
Thank you in advance.
TMA Slope Screener12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576Period = 20edblHigh1 = 0.04edblLow1 = -0.04atrPeriod = 100atr = AverageTrueRange[atrPeriod](close)dblTma = TriangularAverage[eintPeriod](close)if barindex>eintPeriod thendblPrev = dblTma[1]gadblSlope = ( dblTma - dblPrev ) / atrif ( gadblSlope[0] > edblHigh1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp1 = gadblSlope[0]gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0gadblMid1 = 0gadblMid2 = 0elsegadblUp1 = 0gadblDn1 = 0gadblDn2 = 0gadblUp2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelsif ( gadblSlope[0] < edblLow1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp2 = 0gadblDn1 = 0gadblUp1 = 0gadblDn2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0elsegadblUp2 = 0gadblUp1 = 0gadblDn2 = 0gadblDn1 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelseif(gadblSlope[0] < gadblSlope[1]) thengadblMid2 = gadblSlope[0]gadblMid1 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0elsegadblMid1 = gadblSlope[0]gadblMid2 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0endifendifendifif gadblSlope>0 thenoffset = edblLow1elseoffset = edblHigh1endifResult = 0IF gadblSlope>edblHigh1 THEN //Buy OnlyResult = 1ELSIF gadblSlope<edblLow1 THEN //Sell OnlyResult = -1ENDIFSCREENER[result] (result AS "Slope")02/08/2020 at 1:19 AM #118990Screeners don’t like much -1, try replacing it with 2 at line 74.
02/08/2020 at 11:52 PM #119065Thanks for your response.
I tried replacing it with 2.. but I get loads of other Syntax errors:
I think I’ve not done this right!! 🙁02/09/2020 at 12:00 AM #119066I cannot check syntax errors on my mobile.
02/09/2020 at 12:43 AM #119076No Problem…@robertogozzi
please if you could have a look at this would be amazing!!!!!02/10/2020 at 12:58 AM #119122Line 1 should read eintPeriod.
Remove lines 65-69, since Offset was only required to plot on the chart.
Variables having their names starting with gadbl are not used, so they could probably be removed, but I am not sure about that since I did not test the code thoroughly so I suggest that you add this dummy line just before the last line, instead of removing them:
12IF gadblup1 OR gadblup2 OR gadbldn1 OR gadbldn2 OR gadblmid1 OR gadblmid2 THENENDIFremember to use 2 instead of -1.
1 user thanked author for this post.
02/10/2020 at 7:19 PM #119230Hi robertogozzi
Thanks to your help I kinda managed to get this without any errors 🙂 The problem now is it shows all Buy only and Sell only!!
Is it Possible to change this,
When ”Buy Only” — it only reads first 5 green candles only
When ”Sell Only” — it only reads first 5 Red candles only123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172eintPeriod = 20edblHigh1 = 0.04edblLow1 = -0.04atrPeriod = 100atr = AverageTrueRange[atrPeriod](close)dblTma = TriangularAverage[eintPeriod](close)if barindex>eintPeriod thendblPrev = dblTma[1]gadblSlope = ( dblTma - dblPrev ) / atrif ( gadblSlope[0] > edblHigh1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp1 = gadblSlope[0]gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0gadblMid1 = 0gadblMid2 = 0elsegadblUp1 = 0gadblDn1 = 0gadblDn2 = 0gadblUp2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelsif ( gadblSlope[0] < edblLow1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp2 = 0gadblDn1 = 0gadblUp1 = 0gadblDn2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelsegadblUp2 = 0gadblUp1 = 0gadblDn2 = 0gadblDn1 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelseif(gadblSlope[0] < gadblSlope[1]) thengadblMid2 = gadblSlope[0]gadblMid1 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0elsegadblMid1 = gadblSlope[0]gadblMid2 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0endifendifIF gadblup1 OR gadblup2 OR gadbldn1 OR gadbldn2 OR gadblmid1 OR gadblmid2 THENENDIFResult = 0IF gadblSlope>edblHigh1 THEN //Buy OnlyResult = 1ELSIF gadblSlope<edblLow1 THEN //Sell OnlyResult = 2ENDIFSCREENER[result] (result AS "Slope")02/10/2020 at 7:43 PM #119234This is probably due to the high number of items returned (max. 50 allowed on demo account, 100 on real account). You can read how many have been displayed aot of XXXX at the bottom of the screener window.
I may suggest that you duplicate it and run both of them one to search BUY only with lines 67-71 replaced by:
123IF gadblSlope>edblHigh1 THEN //Buy OnlyResult = 1ENDIFand the SELL only one with:
123IF gadblSlope<edblLow1 THEN //Sell OnlyResult = 2ENDIF02/12/2020 at 6:48 PM #119472Hi @roberto
It still reads all of it in the list..
Is there a way to read-only past 5 histograms when BUY ONLY or SELL ONLY means it will show up the new signals.. within 5 histograms?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475eintPeriod = 20edblHigh1 = 0.03edblLow1 = -0.03atrPeriod = 100atr = AverageTrueRange[atrPeriod](close)dblTma = TriangularAverage[eintPeriod](close)if barindex>eintPeriod thendblPrev = dblTma[1]gadblSlope = ( dblTma - dblPrev ) / atrif ( gadblSlope[0] > edblHigh1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp1 = gadblSlope[0]gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0gadblMid1 = 0gadblMid2 = 0elsegadblUp1 = 0gadblDn1 = 0gadblDn2 = 0gadblUp2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelsif ( gadblSlope[0] < edblLow1 ) thenif(gadblSlope[0] < gadblSlope[1]) thengadblUp2 = 0gadblDn1 = 0gadblUp1 = 0gadblDn2 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelsegadblUp2 = 0gadblUp1 = 0gadblDn2 = 0gadblDn1 = gadblSlope[0]gadblMid1 = 0gadblMid2 = 0endifelseif(gadblSlope[0] < gadblSlope[1]) thengadblMid2 = gadblSlope[0]gadblMid1 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0elsegadblMid1 = gadblSlope[0]gadblMid2 = 0gadblUp1 = 0gadblUp2 = 0gadblDn1 = 0gadblDn2 = 0endifendifIF gadblup1 OR gadblup2 OR gadbldn1 OR gadbldn2 OR gadblmid1 OR gadblmid2 THENENDIFResult = 0IF gadblSlope>edblHigh1 THEN //Buy OnlyResult = 1ENDIFIF gadblSlope<edblLow1 THEN //Sell OnlyResult = 2ENDIFSCREENER[result] (result AS "Slope")02/12/2020 at 8:02 PM #119483Line 67 and 71 should read, respectively:
12if summation[5](gadblSlope>edblHigh1) then //line 67if summation[5](gadblSlope<edblLow1) then //line 711 user thanked author for this post.
02/18/2020 at 6:28 PM #119869robertogozzi i think it works!! thank you very much for help as always!!
-
AuthorPosts
Find exclusive trading pro-tools on