Screener for my own indicator

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #78037 quote
    malaguti
    Participant
    New

    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:

    myMSI2 = call MSI2
    Con1 = myMSI2 = 1 and myMSI2[1] = 0.5
    
    screener[con1]

    the indicator is here

    MyHigh = Highest[20](high)
    MyLow = Lowest[40] (low)
    //Ichimoku
    Tenkansen = (highest[9](high)+lowest[9](low))/2
    Kijunsen = (highest[26](high)+lowest[26](low))/2
    SpanA = (tenkansen[26]+kijunsen[26])/2
    SpanB = (highest[52](high[26])+lowest[52](low[26]))/2
    //MA Settings
    MyMA = WilderAverage[30](close)
    
    
    Long1 = High>MyHigh[1]
    Long2 = close > SpanA and close > SpanB
    Long3 = Close>Close[1] and close>MyHigh[1]
    Long4 = Close>MyMA
    Stage2 = Long1 and Long2 and Long3 and Long4
    
    Stage3 = Close<MyMA and Direction[1]=1
    
    Short1 = Close<MyLow[1]
    Short2 = close < SpanA and close < SpanB
    Short3 = Close<Close[1] and close<MyLow[1]
    Stage4 = Short1 and short2 and short3
    
    Stage1 = Close>MyMA and Direction[1]=-1
    
    if stage2 then
    direction=1
    elsif stage3 then
    direction=0.5
    elsif stage4 then
    direction=-1
    elsif stage1 then
    direction=-0.5
    endif
    
    return 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

     

     

     

     

    [attachment file=78038]

    could someone help where im going wrong?

    Capture.jpg Capture.jpg
    #78134 quote
    malaguti
    Participant
    New

    If I run the screener on the predefined UK stocks list, using the weekly selection criteria my results are attached:

    none of them fit the criteria of the screener.

    Does ProRealTime just not like the weekly criteria?[attachment file=”screener results.PNG”]

    screener-results.png screener-results.png
    #78136 quote
    robertogozzi
    Moderator
    Master

    It works, but only few results are returned.

    Try to san ALL instruments to see how many results you get, in different TFs.

    #78138 quote
    robertogozzi
    Moderator
    Master

    I suggest that you use your indicator as a strategy and debug it with ProOrder, changing GRAPHed variables to watch all of them:

    MyHigh    = Highest[20](high)
    MyLow     = Lowest[40](low)
    //Ichimoku
    Tenkansen = (highest[9](high)+lowest[9](low))/2
    Kijunsen  = (highest[26](high)+lowest[26](low))/2
    SpanA     = (tenkansen[26]+kijunsen[26])/2
    SpanB     = (highest[52](high[26])+lowest[52](low[26]))/2
    
    //MA Settings
    MyMA      = WilderAverage[30](close)
     
    Long1     = High>MyHigh[1]
    Long2     = close > SpanA and close > SpanB
    Long3     = Close>Close[1] and close>MyHigh[1]
    Long4     = Close>MyMA
    
    Stage2    = Long1 and Long2 and Long3 and Long4
     
    Stage3    = Close<MyMA and Direction[1]=1
     
    Short1    = Close<MyLow[1]
    Short2    = close < SpanA and close < SpanB
    Short3    = Close<Close[1] and close<MyLow[1]
    Stage4    = Short1 and short2 and short3
     
    Stage1    = Close>MyMA and Direction[1]=-1
    
    if stage2 then
    direction=1
    elsif stage3 then
    direction=0.5
    elsif stage4 then
    direction=-1
    elsif stage1 then
    direction=-0.5
    endif
    
    graph MyHigh
    graph MyLow
    graph MyMA
    graph close
    graph high
    
    buy at -close limit

    the last line is a dummy one required by ProOrder.

    #78140 quote
    malaguti
    Participant
    New

    I suggest that you use your indicator as a strategy and debug it with ProOrder, changing GRAPHed variables to watch all of them:

    the 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

    #78146 quote
    malaguti
    Participant
    New

    So 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?

    Capture.png Capture.png
    #78151 quote
    robertogozzi
    Moderator
    Master

    As 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:

    screener [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.

    #78152 quote
    malaguti
    Participant
    New

    Yes, and when you request to just bring back all with a 1, it brings back -0.5!

    I want to look for changes, just as probuilder was able to handle, when direction =1 and direction[1]=0.5

    [attachment file=78153]

    Capture-1.png Capture-1.png
    #78166 quote
    malaguti
    Participant
    New

    here the screener thinks I’m on a 1, whereas the indicator shows the correct value, which is -0.5

    in fact they all show as 1

    [attachment file=78167]

    any help would be appreciated

    Capture-2.png Capture-2.png
    #78304 quote
    malaguti
    Participant
    New

    OK, 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

    MyHigh = Highest[20](high)
    //MyLow = Lowest[40] (low)
    //Ichimoku
    Tenkansen = (highest[9](high)+lowest[9](low))/2
    Kijunsen = (highest[26](high)+lowest[26](low))/2
    SpanA = (tenkansen[26]+kijunsen[26])/2
    SpanB = (highest[52](high[26])+lowest[52](low[26]))/2
    //MA Settings
    MyMA = WilderAverage[30](close)
    
    
    Long1 = High>MyHigh[1]
    Long2 = close > SpanA and close > SpanB
    Long3 = Close>Close[1] and close>MyHigh[1]
    Long4 = Close>MyMA
    Stage2 = Long1 and Long2 and Long3 and Long4
    
    SCREENER [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?

    stage2-screener.png stage2-screener.png doesnt-like-higher-high.png doesnt-like-higher-high.png
    #78310 quote
    malaguti
    Participant
    New

    lets make it real simple just one condition..

    MyHigh = 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!

    Higherhigh.png Higherhigh.png
    #78356 quote
    robertogozzi
    Moderator
    Master

    Converting you screener to an indicator colouring the background when the result is true

    MyHigh = Highest[20](high)
    Long1 = High>MyHigh[1]
    IF Long1 THEN
       backgroundcolor(0,255,0)
    endif
    return

    then 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!

    Mal1.jpg Mal1.jpg Mal2.jpg Mal2.jpg
    #78359 quote
    robertogozzi
    Moderator
    Master

    Well… 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!

    #78362 quote
    malaguti
    Participant
    New

    Thanks 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!

    Higherhigh-1.png Higherhigh-1.png
    #78368 quote
    malaguti
    Participant
    New

    The plot thickens…

    Long = low<low[1]
    if long then
    backgroundcolor (0,255,0)
    endif
    return long

    wanting 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..

    refresh.png refresh.png refreshafter.png refreshafter.png
Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.

Screener for my own indicator


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
malaguti @malaguti Participant
Summary

This topic contains 20 replies,
has 3 voices, and was last updated by malaguti
7 years, 7 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 08/12/2018
Status: Active
Attachments: 15 files
Logo Logo
Loading...