Breakout Scan Script

Optuma Forums Optuma Scripting Breakout Scan Script

  • This topic has 2 replies, 2 voices, and was last updated 5 months ago by AvatarIan.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #58817
    AvatarIan
    • Topics: 4
    • Replies: 5
    • Posts: 9

    Hi,

    I’m looking to backtest and scan for breakouts from a sideways range, something like this.

    Breakout2

    In its simplest form, a pattern where:

    The previous (say) 20 bars were in a fairly narrow range (say) 20% between the highest high and lowest low, and

    The last bar high exceeds any of the prior 20 days, and

    The last bar range is substantially higher than any range of the prior 20 days.

    For the last bar high, I have:

    #58823
    DarrenDarren
    • Topics: 62
    • Replies: 503
    • Posts: 565

    Thanks Ian. To calculate the highest range of the previous 20 days you would need to get the highest high and lowest low, and calculate the range as a % of the highest high.

    This will calculate when that range is less than 20% (which is quite wide over a short period) and the last high broke out 2% higher than the 20 day high:

    #58827
    AvatarIan
    • Topics: 4
    • Replies: 5
    • Posts: 9

    Thank you Darren!

    I’ve used your script in the Scanning Manager with a sample workbook and it looks like it is identifying the breakout correctly.

    Next step is to test it in the Backtester with some different variables. (Yes, the 20% is quite wide, but different values will be used in backtesting.)

    Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close