New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Options

how do I write a scan script for Maximum range over 30 days starting today

Hello I would like to write a scan script for "Maximum range over 30 days starting today is greater than maximum range over 15 days starting today". This scan is from trend trading for a living. I read the introduction to advanced scanning but could not find the answer. Thank you for your help

Comments

  • Options
    You need to use the max( ) and min( ) functions.

    The maximum range for a period of time is the difference between the highest high in that period and the lowest low in that period. So if the period you are looking at is x bars long, the range for that period would be max(x, high) - min(x, low).

  • Options
    Thanks. so screen for "Maximum range over 30 days starting today is greater than maximum range over 15 days starting today" the script would be [max(30, high) - min(30, low) > max(15, high) - min(15, low)]?
  • Options
    @daoism76 Yes.
  • Options
    great. thanks a bunch!!!
Sign In or Register to comment.