Crosses multiple indicators over 10 periods

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #127346 quote
    bilsko
    Participant
    New

    Hi,

    Im looking to create a screener than gives me results when the upper BolBand, Lower BolBand and Moving Average have been crossed in that order over the last 10 bars.

    The result doesnt seem to want to execute. Thanks. I have just put in the // so the code can been seen.

    timeframe(30mn)
    
    Bol5 = (BollingerUp[15](close))
    boldown = (BollingerDown[15](close))
    movingA = average[15]
    c1= high crosses over bol5
    c2= low crosses under boldown
    c3= close crosses over movingA
    //result= summation[10](c1 then c2 then c3)
    
    screener [result]
    #127355 quote
    robertogozzi
    Moderator
    Master

    Try this (not tested):

    timeframe(30mn)
    Bol5    = (BollingerUp[15](close))
    boldown = (BollingerDown[15](close))
    movingA = average[15]
    c1= high crosses over bol5
    if c1 then
       bar1 = barindex                    //it must have the lowest barindex
    endif
    c2= low crosses under boldown
    if c2 then
       bar2 = barindex
    endif
    c3= close crosses over movingA
    if c3 then
       bar3 = barindex                    //it must have the highest barindex
    endif
    //
    MaxBar = (c3 = max(bar1,max(bar2,bar3)))
    MinBar = (c1 = min(bar1,min(bar2,bar3)))
    result = MaxBar AND MinBar AND ((BarIndex - bar1) <= 10)
    screener [result]
    #127356 quote
    robertogozzi
    Moderator
    Master

    Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.

    Thank you 🙂

    I deleted the other topic.

    bilsko thanked this post
    #127379 quote
    bilsko
    Participant
    New

    I dont seem to be getting any hits with the above code on Australian stocks considering i can see there are a few companies in their last 10 (30min) bars have all 3 definitions meet. I even tried to stretch it further (15 bars) out to have a bigger possible pool and no luck.

    #127388 quote
    robertogozzi
    Moderator
    Master

    Try writing (30 minute) at line 1.

    #127424 quote
    robertogozzi
    Moderator
    Master

    Sorry, my fault, lines 18 and 19 are wrong. This is correct:

    timeframe(30mn)
    Bol5    = (BollingerUp[15](close))
    boldown = (BollingerDown[15](close))
    movingA = average[15]
    c1= high crosses over bol5
    if c1 then
       bar1 = barindex                    //it must have the lowest barindex
    endif
    c2= low crosses under boldown
    if c2 then
       bar2 = barindex
    endif
    c3= close crosses over movingA
    if c3 then
       bar3 = barindex                    //it must have the highest barindex
    endif
    //
    MaxBar = (bar3 = max(bar1,max(bar2,bar3)))
    MinBar = (bar1 = min(bar1,min(bar2,bar3)))
    result = MaxBar AND MinBar AND ((BarIndex - bar1) <= 10)
    screener [result]
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Crosses multiple indicators over 10 periods


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
bilsko @bilsko Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 11 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 04/21/2020
Status: Active
Attachments: No files
Logo Logo
Loading...