Screener for my own indicator
Forums › ProRealTime English forum › ProScreener support › Screener for my own indicator
- This topic has 20 replies, 3 voices, and was last updated 6 years ago by malaguti.
-
-
08/12/2018 at 11:34 AM #78037
I have developed an indicator using v10.3, very simple, but its my first one!
what i am trying to do is now create the screener, however its not coming back with what i would expect. I want to screen new breakouts, so where the condition today exists, whereas yesterday it didn’t. although weekly, so this week vs last week
here is the screener:
Screener from indicator created1234myMSI2 = call MSI2Con1 = myMSI2 = 1 and myMSI2[1] = 0.5screener[con1]the indicator is here
Indicator12345678910111213141516171819202122232425262728293031323334353637MyHigh = Highest[20](high)MyLow = Lowest[40] (low)//IchimokuTenkansen = (highest[9](high)+lowest[9](low))/2Kijunsen = (highest[26](high)+lowest[26](low))/2SpanA = (tenkansen[26]+kijunsen[26])/2SpanB = (highest[52](high[26])+lowest[52](low[26]))/2//MA SettingsMyMA = WilderAverage[30](close)Long1 = High>MyHigh[1]Long2 = close > SpanA and close > SpanBLong3 = Close>Close[1] and close>MyHigh[1]Long4 = Close>MyMAStage2 = Long1 and Long2 and Long3 and Long4Stage3 = Close<MyMA and Direction[1]=1Short1 = Close<MyLow[1]Short2 = close < SpanA and close < SpanBShort3 = Close<Close[1] and close<MyLow[1]Stage4 = Short1 and short2 and short3Stage1 = Close>MyMA and Direction[1]=-1if stage2 thendirection=1elsif stage3 thendirection=0.5elsif stage4 thendirection=-1elsif stage1 thendirection=-0.5endifreturn direction as "MSI"the indicator when plotted has a 1,0.5, -0.5 or -1 value. Im just trying to pick up the 1 where last week it wasn’t however im getting back items where there is no 1 but still 0.5
could someone help where im going wrong?
08/14/2018 at 11:07 AM #7813408/14/2018 at 11:55 AM #78136It works, but only few results are returned.
Try to san ALL instruments to see how many results you get, in different TFs.
08/14/2018 at 12:17 PM #78138I suggest that you use your indicator as a strategy and debug it with ProOrder, changing GRAPHed variables to watch all of them:
1234567891011121314151617181920212223242526272829303132333435363738394041424344MyHigh = Highest[20](high)MyLow = Lowest[40](low)//IchimokuTenkansen = (highest[9](high)+lowest[9](low))/2Kijunsen = (highest[26](high)+lowest[26](low))/2SpanA = (tenkansen[26]+kijunsen[26])/2SpanB = (highest[52](high[26])+lowest[52](low[26]))/2//MA SettingsMyMA = WilderAverage[30](close)Long1 = High>MyHigh[1]Long2 = close > SpanA and close > SpanBLong3 = Close>Close[1] and close>MyHigh[1]Long4 = Close>MyMAStage2 = Long1 and Long2 and Long3 and Long4Stage3 = Close<MyMA and Direction[1]=1Short1 = Close<MyLow[1]Short2 = close < SpanA and close < SpanBShort3 = Close<Close[1] and close<MyLow[1]Stage4 = Short1 and short2 and short3Stage1 = Close>MyMA and Direction[1]=-1if stage2 thendirection=1elsif stage3 thendirection=0.5elsif stage4 thendirection=-1elsif stage1 thendirection=-0.5endifgraph MyHighgraph MyLowgraph MyMAgraph closegraph highbuy at -close limitthe last line is a dummy one required by ProOrder.
08/14/2018 at 12:33 PM #78140I suggest that you use your indicator as a strategy and debug it with ProOrder, changing GRAPHed variables to watch all of them:
1234567891011121314151617181920212223242526272829303132333435363738394041424344MyHigh = Highest[20](high)MyLow = Lowest[40](low)//IchimokuTenkansen = (highest[9](high)+lowest[9](low))/2Kijunsen = (highest[26](high)+lowest[26](low))/2SpanA = (tenkansen[26]+kijunsen[26])/2SpanB = (highest[52](high[26])+lowest[52](low[26]))/2//MA SettingsMyMA = WilderAverage[30](close)Long1 = High>MyHigh[1]Long2 = close > SpanA and close > SpanBLong3 = Close>Close[1] and close>MyHigh[1]Long4 = Close>MyMAStage2 = Long1 and Long2 and Long3 and Long4Stage3 = Close<MyMA and Direction[1]=1Short1 = Close<MyLow[1]Short2 = close < SpanA and close < SpanBShort3 = Close<Close[1] and close<MyLow[1]Stage4 = Short1 and short2 and short3Stage1 = Close>MyMA and Direction[1]=–1if stage2 thendirection=1elsif stage3 thendirection=0.5elsif stage4 thendirection=–1elsif stage1 thendirection=–0.5endifgraph MyHighgraph MyLowgraph MyMAgraph closegraph highbuy at –close limitthe last line is a dummy one required by ProOrder.
Its not so much the volume, its just they are all inaccurate. I will try your suggestion however on proorder, I haven’t tried that yet, hoping it was an obvious error in my indicator
08/14/2018 at 2:00 PM #78146So I created the probacktest, and graphed the indicator, and it buys and sells exactly where it should
the screener just cant pick up the right information however
I am keeping it nice and simple to just return where the condition is true, in this case where the indicator value is -0.5
it returns a stock where its -1
probacktest works perfectly, just the screener cant work it out
this time I also included everything within the screener rather than “calling” it and still incorrect results
any ideas?
08/14/2018 at 2:49 PM #78151As an indicator it returns all values and they are pletted correctly under the chart.
Using the same code as a screener, simply replacing return with screener:
1screener [direction] (direction as "Dir")only returns 1 and 0.5!
I launched it on a 1-minute TF, to watch any fast update, but I did not see other that 1’s and 0.5’s.
08/14/2018 at 3:14 PM #7815208/14/2018 at 5:28 PM #7816608/15/2018 at 6:13 PM #78304OK, decided to try again and perhaps narrow down where the screener is going wrong and wanted to just test any standard code in case it was my own poor coding being such a novice.
the below screener looks at 4 conditions, and it still brings back incorrect results from standard code
standard code123456789101112131415161718MyHigh = Highest[20](high)//MyLow = Lowest[40] (low)//IchimokuTenkansen = (highest[9](high)+lowest[9](low))/2Kijunsen = (highest[26](high)+lowest[26](low))/2SpanA = (tenkansen[26]+kijunsen[26])/2SpanB = (highest[52](high[26])+lowest[52](low[26]))/2//MA SettingsMyMA = WilderAverage[30](close)Long1 = High>MyHigh[1]Long2 = close > SpanA and close > SpanBLong3 = Close>Close[1] and close>MyHigh[1]Long4 = Close>MyMAStage2 = Long1 and Long2 and Long3 and Long4SCREENER [Stage2] (Stage2 AS "Stage2")PRTs screener is not able to bring back the correct results even from standard code
in the attached chart, the high is clearly not greater than last week’s high, so Long 1 isn’t satisfied and Long3 also isn’t satisfied
I’ve overlaid the donchian channel, highest high for 20 periods. it brings back Vedanta as saying its higher than last period, whereas it clearly isnt
so its not certainly not my indicator that is the issue. Nobody else has similar results?
08/15/2018 at 6:24 PM #78310lets make it real simple just one condition..
just one condition1234MyHigh = Highest[20](high)Long1 = High>MyHigh[1]SCREENER [Long1] (Long1 AS "Higher")on the weekly screener for predefined UK200 stocks..brings back some very odd results. definitely not higher!
08/16/2018 at 11:35 AM #78356Converting you screener to an indicator colouring the background when the result is true
123456MyHigh = Highest[20](high)Long1 = High>MyHigh[1]IF Long1 THENbackgroundcolor(0,255,0)endifreturnthen launching your scan on UK stocks (weekly TF), results can be seen from attached pics, the first one is correct while the second one isn’t.
The only explanation is that you are using end-of-day data, because the screener, as well as the indicator, are both correct if you don’t look at the current bar!
08/16/2018 at 11:41 AM #78359Well… I’m afraid there’s something wrong elsewhere, because that does not explain why in my first screenshot, on July 16th or 23rd…, the background is coloured while there’e no NEW high!
08/16/2018 at 12:35 PM #78362Thanks Roberto, yes I’ve just marked up where it shouldn’t have occurred. It is odd. and I do just use just end of day, as I’m only interested in weekly timeframes
I’ve raised a support ticket but I do appreciate your responses, and at least confirms I’m not losing my mind!
08/16/2018 at 2:05 PM #78368The plot thickens…
12345Long = low<low[1]if long thenbackgroundcolor (0,255,0)endifreturn longwanting to check now very very simple indicator checking one high to another or one low to another, I’m finding that PRT isn’t updating the indicator. ie if I switch from one timescale to another I get incorrect results, unless I go into modify an indicator and then choose to re-apply the same indicator. its almost as though when switching that PRT isn’t catching up when switching and reading the code
attachment 1 is supposed to highlight just where the low is lower than last period, compared to the exact same indicator after ive modified the indicator and added the indicator to the chart again.
its the exact same timeframe, same chart, two different results after reapplying
ive tried closing down the indicator, after creating it. but I wonder is this why the screener is coming back with the odd results..
-
AuthorPosts
Find exclusive trading pro-tools on