Login Page - Create Account

Support Board

Date/Time: Fri, 19 Oct 2018 01:40:09 +0000

[User Discussion] - Slope of two studies

Support Request:
[2017-11-25 05:25:41]
nicktrader - Posts: 320
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
imageTwo studies.png / V - Attached On 2017-11-25 05:20:06 UTC - Size: 23.32 KB - 104 views
[2017-11-26 23:04:14]
yon - Posts: 299
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.
Date Time Of Last Edit: 2017-11-27 08:13:31
[2017-11-26 23:54:15]
yon - Posts: 299
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: 320
@ yon

Many thanks vor your help.

The attached file is private and I can't download it
[2017-11-27 08:11:38]
yon - Posts: 299
disregard the previous dll I'll share a new one later today.
[2017-11-27 12:29:40]
yon - Posts: 299
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.
attachmentFill_Space_Between_2_Studies.dll - Attached On 2017-11-27 12:28:47 UTC - Size: 73.5 KB - 46 views
[2017-11-27 12:40:45]
nicktrader - Posts: 320
Many thanks Yon for your help.
[2017-11-27 12:43:00]
yon - Posts: 299
welcome :-)
[2017-11-27 14:04:34]
nicktrader - Posts: 320

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
imageColor slope.png / V - Attached On 2017-11-27 14:03:25 UTC - Size: 12.72 KB - 67 views
[2017-11-27 14:21:41]
yon - Posts: 299
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: 320

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
imageSlope Color 2.png / V - Attached On 2017-11-27 14:36:30 UTC - Size: 4.5 KB - 73 views
[2017-11-27 14:49:09]
yon - Posts: 299
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]
yon - Posts: 299
Here is the source code.
attachmentFill_Space_Between_2_Studies.cpp - Attached On 2017-11-27 21:33:22 UTC - Size: 3.4 KB - 60 views
[2017-11-28 02:24:23]
nicktrader - Posts: 320
Thanks very much for all your help.

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


Login Page - Create Account