Support Board
Date/Time: Mon, 12 May 2025 09:32:38 +0000
[User Discussion] - Slope of two studies
View Count: 1605
[2017-11-25 05:25:41] |
nicktrader - Posts: 748 |
I use two different studies, as shown in the pic. If both are going in the same direction, the background within the studies should be red or green . Unfortunately, I do not have any idea how to implement this. I would be very happy about suggestions. Many Thanks |
![]() |
[2017-11-26 23:04:14] |
Zosimus - Posts: 345 |
Hi nicktrader, Attached is a custom study that I wrote for this purpose. Save the study to the data folder and then add it to the chart with the 2 studies (Analysis >> Studies >> Add Custom Study) In the Settings and inputs choose the Study and Subgraph for the 2 lines that you have on this chart. In the subgraphs settings you can change the color that will fill the space between the 2 lines and also you can change the Fill Bottom and Fill Top Draw Styles to Transparent Fiil Bottom and Transparent fill top respectively if you want a transparent fill. You must have release 1648 or above for this study to work. Enjoy. Date Time Of Last Edit: 2017-11-27 08:13:31
|
[2017-11-26 23:54:15] |
Zosimus - Posts: 345 |
Ahh sorry I missed the part about going the same direction and the green and red. Will add this when I find time.
|
[2017-11-27 03:55:14] |
nicktrader - Posts: 748 |
@ yon Many thanks vor your help. The attached file is private and I can't download it |
[2017-11-27 08:11:38] |
Zosimus - Posts: 345 |
disregard the previous dll I'll share a new one later today.
|
[2017-11-27 12:29:40] |
Zosimus - Posts: 345 |
Here is the new DLL with the colors set according to the slope. If the values of both studies at the current bar are larger than their values on the previous bar then the fill color is green. And if both are lower then red. If mixed then blue. The colors can be changed. |
![]() |
[2017-11-27 12:40:45] |
nicktrader - Posts: 748 |
Many thanks Yon for your help.
|
[2017-11-27 12:43:00] |
Zosimus - Posts: 345 |
welcome :-)
|
[2017-11-27 14:04:34] |
nicktrader - Posts: 748 |
@Yon I saved and start it as you said. I placed it in Region 2 but there is only one color ==>> blue. I used the correct studies (in my case ID 18 + ID19). Yon, is it possible to take a look on it? Maybe you have to know that one studies is an "Overlay" and the other one is a "Study/ Price Overlay". Yon, one additional question. Is it possible to take a look on your programming for learning purposes and if yes, how? Many thanks |
![]() |
[2017-11-27 14:21:41] |
Zosimus - Posts: 345 |
1.It has to be on region 1. 2.The settings og the colors are on the Settings and Inputs tab. 3. Ill share the code later today when Im back home. |
[2017-11-27 14:38:52] |
nicktrader - Posts: 748 |
@Yon I got it and understand the coloring. It changes the color for the complete background. I thought the coloring is sepate for each event. In Region 2 it works too. Many thanks |
![]() |
[2017-11-27 14:49:09] |
Zosimus - Posts: 345 |
Yes it is much more complicated to change the colors for each event separately. If you use region 1 it will fill the space between the 2 lines. |
[2017-11-27 21:33:41] |
Zosimus - Posts: 345 |
Here is the source code.
|
![]() |
[2017-11-28 02:24:23] |
nicktrader - Posts: 748 |
@Yon Thanks very much for all your help. |
To post a message in this thread, you need to log in with your Sierra Chart account: