- This topic has 5 replies, 4 voices, and was last updated 1 year ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
Optuma Forums › Optuma Scripting › Price percent amount above the moving average
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
Hi Paul,
The following script will display the value (in %) the close price of a chart is from a 200SMA:
1 2 3 4 5 6 7 |
//Set Variables V1 = MA(BARS=200) ; V2 = CLOSE(); //Formula for % from MA 100 * (V2-V1)/V1 |
This is how the script would look on a Show View (below the chart):
Thanks, Matthew – just what I needed. Much appreciated – Paul
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.
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?
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:
Cookie | Duration | Description |
---|---|---|
cname | 14 days | This cookie is set by Optuma. The cookies is used to store the users campaign selection for selecting the correct version of Optuma to trial and is "Necessary". |
cookielawinfo-checbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |