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.

Scanning for an event

Hie do i scan for event 'in the last ten days' for example' how would i write it..thanks..

Answers

  • It depends what you are looking for.

    If you are looking for a crossover of some kind - an indicator crossing zero, or indicator line crossing another, or a short average crossing a longer average - then you would either write a long scan, testing one value against another for each of the ten days and run the scan once, e.g.

    and

    [

    [sma(5, close) x sma(20, close)]
    or [1 day ago sma(5, close) x 1 day ago sma(20, close)]
    or [2 days ago ... etc.

    ]

    OR, you could write the scan for today only, and run the scan ten times, using the offset tool (the calendar drop down that appears when you click on the white box at Starting ... days ago.. to set the date back one day each time.

    If you are looking for a maximum or minimum value over the last 10 days, then you would use the max or min functions, e.g. [max(10, close) > 23].



  • lmkwinlmkwin ✭✭
    I'd probably use the search on the forum.

    "in the last ten days" in the Search pulls up several previous discussions.
Sign In or Register to comment.