Login Page - Create Account

Support Board


Date/Time: Mon, 29 Apr 2024 14:09:10 +0000



[Programming Help] - Moving Average Angle/Slope display next to Name Label

View Count: 1529

[2018-12-05 05:56:30]
jaxscott - Posts: 57
Is it possible to display the angle of a moving average next to their name label on the main price chart? I know how to get the angle through Study Angle. I know how to display the value of that angle with a Text Display for Study. I don't know how to display that text up next to the moving average on the right that follows the tracking of the average along with the label.

Clues?
[2018-12-05 14:55:44]
Sawtooth - Posts: 3983
A spreadsheet study can do this. I don't know of any other way.

Try this:

Add the Spreadsheet Study study:
-Set the Chart Region to 1
-Give it a name in the Spreadsheet Name field.
-Set the Number Of Rows to 2. (optional)

On the Subgraphs tab:
-Set the Draw Style of K(SG1) to Text and choose the color.
-Check 'Name Label' and choose its location.
Click OK and OK.

On the spreadsheet:
-Put this in cell K2:
=TEXT(VALUE(ID2.SG1@3),"0.###")
-Put this in cell K3:
=ID1.SG1@3

The formulas assume the Study Angle study is ID2 and the moving average is ID1.SG1. Edit as needed.
You can change the display format by editing the "0.###" in the K2 formula to your requirements.
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#TEXT_Function
[2018-12-05 15:00:18]
jaxscott - Posts: 57
Thank you for your reply!
[2019-04-09 03:18:04]
whats1thingnow - Posts: 407
@3

what does this do?

thanks :)
[2019-04-09 04:12:00]
Sawtooth - Posts: 3983
It is a portion of the spreadsheet study syntax identifying the row#. Row3 is the current bar.
Working with Spreadsheets: References to Study Subgraph Columns when using the Spreadsheet Study
[2020-06-11 18:40:54]
MichaelZ - Posts: 12
Hello,

Thanks for this, this is very useful. I have not managed to get the value showing on the screen though, despite having followed all steps. How can the value print on the right of the said EMA line?

Also when I enter "=ID1.SG1@3" in cell K3, this is very quickly updated with a different value, which I believe is the value of ID2.SG1 in bar -1 (the one before the current).

Clearly I am doing something wrong here, any hints what that might be?

Many thanks!
[2020-06-11 19:46:46]
Sawtooth - Posts: 3983
How can the value print on the right of the said EMA line?
Check 'Name Label' and choose its location.

any hints what that might be?
You must use the Sheet# that matches the Formula Source Sheet Number setting. By default this is the same as the Chart #.

From post #2:
Cell K2 is the value you want displayed.
Cell K3 is the y-axis location to display the K2 value.
The Name Label's Horizontal Align is its placement.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account