Monthly Pivots screener
Forums › ProRealTime English forum › ProScreener support › Monthly Pivots screener
- This topic has 4 replies, 3 voices, and was last updated 6 years ago by MAMAR.
-
-
01/30/2017 at 7:44 PM #23143
Hi there,
I tried to design a simple screener to test for thresholds to be met, in this instance: Monthly pivot points (eg R2M or S2M) and I’m at loss why it doesn’t work.
I’m using the following piece of code (that works) for the MPP (since the built-in coding assistant seems to only propose daily ones when pointing at a graph, notwithstanding the choice I make):
12345678910111213141516If Month<>Month[1] thenmonthlyHigh = Highest[BarIndex - lastMonthBarIndex](High)[1]monthlyLow = Lowest[BarIndex - lastMonthBarIndex](Low)[1]lastMonthBarIndex = BarIndexmonthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3monthlyR1 = 2*monthlyPivot - monthlyLowmonthlyS1 = 2*monthlyPivot - monthlyHighmonthlyR2 = monthlyPivot + (monthlyHigh - monthlyLow)monthlyS2 = monthlyPivot - (monthlyHigh - monthlyLow)monthlyR3 = monthlyR1 + (monthlyHigh - monthlyLow)monthlyS3 = monthlyS1 - (monthlyHigh - monthlyLow)Endifreturn monthlyS3 as "monthlyS3", monthlyS2 as "monthlyS2", monthlyS1 as "monthlyS1", MonthlyPivot as "MonthlyPivot", monthlyR1 as "monthlyR1", monthlyR2 as "monthlyR2", monthlyR3 as "monthlyR3"With this in mind I have the following screener:
12345ignored, ignored, ignored, ignored, ignored, R2M, ignored = CALL "MPP"c1 = (close > R2M)SCREENER[c1] (close - R2M AS "Close-R2M")And strangely enough no items are returned – which does not fly with what I have in front of me (for instance Platinum is currently trading above its R2M, and it was included in my list of targeted commodities).
Have you ever encountered such a strange behavior?
I’m at a loss as to why my code is not working.
Any help appreciated,
Best,
B
03/14/2018 at 2:28 PM #65291A bit of thread digging, but after more than one year I guess my problem won’t solve itself without a little outside help.
Nothing more to add to the above, except that I tried again this time with PRT 10.3 (I think it was 10.2 before) and nothing has changed.
Same troubling issue, as if PRT doesn’t want to have anything to do with monthly pivots !
Many thanks for your help,
B
03/15/2018 at 8:38 AM #65329We add the same issue in another topic, can’t find its link, but it could be resolve with the code below:
123456789101112131415161718If Month<>Month[1] thenmonthlyHigh = Highest[max(1,BarIndex - lastMonthBarIndex)](High)[1]monthlyLow = Lowest[max(1,BarIndex - lastMonthBarIndex)](Low)[1]lastMonthBarIndex = BarIndexmonthlyPivot = (monthlyHigh + monthlyLow + Close[1]) / 3//monthlyR1 = 2*monthlyPivot - monthlyLow//monthlyS1 = 2*monthlyPivot - monthlyHighmonthlyR2 = monthlyPivot + (monthlyHigh - monthlyLow)//monthlyS2 = monthlyPivot - (monthlyHigh - monthlyLow)//monthlyR3 = monthlyR1 + (monthlyHigh - monthlyLow)//monthlyS3 = monthlyS1 - (monthlyHigh - monthlyLow)Endifc1 = (close > monthlyR2)screener [c1](close - monthlyR2 AS "Close-R2M")The problem is that highest high and lowest low are calculated with a null period at the first month and it results of an internal error of proscreener. With this code, we force these periods to be at least equal to 1.
03/16/2018 at 8:50 PM #6547404/14/2018 at 10:15 AM #68340Hello Nicolas,
None of the screeners proposed here is working: either no stock returned or false stocks.
The indicator works fine, but when used in a screener in daily for ex., it returns both stocks with close higher then the pivot and stocks with close lower than the pivot…
monthlypivot = CALL “Pivot mensuel”
C1=(close>monthlyPivot)
SCREENER[C1]It’s just crazy !
Thanks for your help
-
AuthorPosts
Find exclusive trading pro-tools on