Price percent amount above the moving average

Optuma Forums Optuma Scripting Price percent amount above the moving average

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54163
    Paul
    • Topics: 10
    • Replies: 8
    • Posts: 18

    I need help with a script that would create a chart indicator showing the percent price (close) is above or below the moving average (e.g., 200 day simple moving average)

    Thanks,

    Paul

    #54167
    Matthew
    • Topics: 5
    • Replies: 616
    • Posts: 621

    Hi Paul,

    The following script will display the value (in %) the close price of a chart is from a 200SMA:

    This is how the script would look on a Show View (below the chart):

    Ex3

    #54173
    Paul
    • Topics: 10
    • Replies: 8
    • Posts: 18

    Thanks, Matthew – just what I needed.  Much appreciated – Paul

    #54319
    Darren
    • Topics: 70
    • Replies: 802
    • Posts: 872

    Sample workbook attached for US and ASX data. Remember you can save the Watchlist columns as a layout and apply them to any other watchlist.

    Capture

    #58835
    Lorenzo
    • Topics: 4
    • Replies: 2
    • Posts: 6

    I used this template

    can I know why the column % below 52 week high is partly in white and does not take the red and green formatting?

    #58861
    Darren
    • Topics: 70
    • Replies: 802
    • Posts: 872

    Hi Lorenzo,

    The custom colour formatting in this example was set to green for within 5% of the 52 week high and red when more than 20% away, so those between 5% and 20% were not defined.

    To modify, right-click on the column heading and change the conditional values under Custom Labels:

    Capture

    • This reply was modified 1 year ago by Darren.
    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest