Support Board
Date/Time: Thu, 31 Oct 2024 12:15:02 +0000
Auto Calculate Horizontal Lines as % of Prior Month/Weeks Range
View Count: 66
[2024-10-17 14:36:05] |
User203740 - Posts: 2 |
Hello, (New to SC - love it so far - and your knowledge base is amazing - super detailed and clear to follow - thanks!) Wondering if there's a more efficient way to achieve the following than my current method. I have checked the KB but not found anything beyond my methods below. Desired outcome: Set horizontal lines on a daily chart (index future) based upon the prior week's (or month's) range, drawn as percentages of the range at 25% increments, going from -200% to +200% (8 increments above and below the 0% anchor price). I guess it would be called something like: Horizontal Lines/Quadrants based upon n-period prior range I have found two ways to do this, manually, and want to know if there's a way to perhaps set a study to use the range data in study summary table, rather than calculate manually, or if there's a better way to achieve the outcome? Method 1 - Use the price expansion tool; measure prior week's range; change levels to be +/- 25% increments - this is limited to 9 levels. Cannot add custom labels to each line Method 2 - Use the Horizontal Lines at Increment study - calculate the range of prior week; divide by 4 for the 25% increments. Set the start value and line increments accordingly to give above and below market % lines. Repeat the same for the prior month's range on a different instance of the HLaI study, either on same or new chart. Please do kindly let me know - thanks |
[2024-10-17 15:32:49] |
John - SC Support - Posts: 35639 |
The way to automate this is to do the following: - Add as many copies of the "Period OHLC - Variable Period" to your chart to cover the time frames for which you want to determine the range. For instance, one copy for the previous week and one copy for the previous month. Make sure to set the Input for "Use Current Period" to "No" in order to get the previous period's information. You can hide this study, as you will not need it displayed. - Add the "Spreadsheet Study" to the chart. Within the Spreadsheet Study the data for other studies are displayed starting in column AA (by default). Therefore, you can then reference that information in a calculation column and get your desired lines. For example, the formula to place a line at 25% of the previous range would look like the following in cell K3: =((ID1.SG2@$3 - ID1.SG3@$3) * .25) + ID1.SG3@$3 Where ID1 is the ID of one of the Period OHLC - Variable Period studies. SG2 is the High subgraph of the Period OHLC - Variable Period study, SG3 is the Low of the Period OHLC - Variable Period. The @$3 is an explicit reference to row three of the study. Refer to the following: Previous/Period OHLC-Variable Period Working with Spreadsheets For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-10-17 17:13:53] |
User203740 - Posts: 2 |
Amazing - thank you very much. [solved] |
To post a message in this thread, you need to log in with your Sierra Chart account: