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.

Moving average offset

Hi,

Programming a scanner, how can I had a 3 period offset to a moving average? Can you help?

Thanks in advance

Comments

  • I think you can just use "3 days ago".

    For instance, if you move the MA ahead three days, and you want to know if today's price intersected, you would write

    and [close x 3 days ago sma(10, close)]

    But maybe you have something else in mind.
  • lmkwinlmkwin ✭✭
    I have no idea what you are looking for but this might also be accomplished using the MA offset.

    and [close x sma(10,-3, close)]

    may also work. It passed syntax check.



    "Moving averages are available in SharpCharts as a price overlay. Using the Overlays drop-down menu, users can choose either a simple moving average or an exponential moving average. The first parameter is used to set the number of time periods.

    An optional parameter can be added to specify which price field should be used in the calculations - “O” for the Open, “H” for the High, “L” for the Low, and “C” for the Close. A comma is used to separate parameters.

    Another optional parameter can be added to shift the moving averages to the left (past) or right (future). A negative number (-10) would shift the moving average to the left 10 periods. A positive number (10) would shift the moving average to the right 10 periods.

    Multiple moving averages can be overlaid the price plot by simply adding another overlay line to the workbench. StockCharts members can change the colors and style to differentiate between multiple moving averages. After selecting an indicator, open “Advanced Options” by clicking the little green triangle."


  • Thanks a lot to both of you.
    markd´s line works just fine!
Sign In or Register to comment.