Scans with Bollinger bands

Want to scan for 5 consecutive closes either above or below my upper or lower band.

Comments

  • Your scan has to account for all five bars for each possible situations - above upper, below upper, above lower, below lower, and those situations have to be connected by an "or" statement.

    I'll give you the framework - you have to get the syntax right (using the advanced editor suggestions).

    Copy this into the editor ONE LINE AT A TIME so you get the brackets right, then correct each line for syntax.

    [group is sp500]

    and

    [
    [ close > upper band]
    and [ 1 day ago close > 1 day ago upper band ]
    and [ 2 days ago close > 2 days ago upper band ]

    etc.


    ]

    or

    [
    [close < upper band]
    and [ 1 day ago close < 1 day ago upper band ]
    and [ 2 days ago close < 2 days ago upper band ]


    etc.


    ]

    or

    [
    [ close > lower band]
    and [ 1 day ago close > 1 day ago lower band ]
    and [ 2 days ago close > 2 days ago lower band ]

    etc.

    ]

    or

    [
    [ close < lower band]
    and [ 1 day ago close < 1 day ago lower band ]
    and [ 2 days ago close < 2 days ago lower band ]

    etc.


    ]
    ]