Login Page - Create Account

Support Board


Date/Time: Tue, 23 Apr 2024 06:23:22 +0000



[User Discussion] - Color specific point on Indicator, acsil

View Count: 695

[2020-08-24 20:19:44]
User681150 - Posts: 62
i have a indicator (Stoch MOM) that i wanted to paint the line a different color when it crosses a threshold

i grab the study array, then compare array to a theshold, then I am using sc.SetStudySubgraphColors BUT it paints all the points the same color (even when i fill in the secondary color or if i use an ELSE statement).

what is the best way to color specific points on an indicator using ACSIL ? thanks
* study added to chart by using Studies functionality. so i am trying to manipulate a current studies subgraph based on a condition


sc.GetStudyArrayUsingID(6, 0, stochMoM); //get study array

if(stochMOM[sc.Index] > 70)
{ sc.SetStudySubgraphColors(4, 6, 0 , RGB( 0, 0,255), RGB(250,0,0), 1); }

//sc.SetStudySubgraphColors(chart#, study#1, subg#, PrimaryColor, SecondaryColor, SecondaryColorUsed)

Date Time Of Last Edit: 2020-08-24 20:22:33
[2020-08-24 20:46:05]
Ackin - Posts: 1865

//SG stochMOM
stochMOM.DataColor[sc.Index] = stochMOM.PrimaryColor;
if(stochMOM[sc.Index] > 70) stochMOM.DataColor[sc.Index] = stochMOM.SecondaryColor;

Date Time Of Last Edit: 2020-08-24 20:47:36
[2020-08-24 21:20:13]
User681150 - Posts: 62
thanks Ackin. but i get a "SCFloatArray has no member DataColor". i assigned this Type for the study array.


SCFloatArray stochMOM
sc.GetStudyArrayUsingID(6, 0, stochMOM)

if(stochMOM[sc.Index] > 70)
{ sc.SetStudySubgraphColors(4, 6, 0 , RGB( 0, 0,255), RGB(250,0,0), 1); }


i use a SCFloatArray for the GetStudyArrayUsingID() so i assume this is the reason. the first line of your script is members of a Subgraph, so how do i convert this array into a subgraph. or whats the best way to use the GetStudyArrayUsingID() to get all the features of the Subgraph so i can use the
DataColor member

SCFloatArray stochMOM;   
sc.GetStudyArrayUsingID(6, 0, stochMOM);

sc.SetStudySubgraphColors( 4, 6, 0 , RGB( 0, 0,255), RGB(255,0,0), 1 );
stochMOM.DataColor[sc.Index] = stochMOM.PrimaryColor;

if(stochMOM[sc.Index] > 70) stochMOM.DataColor[sc.Index] = stochMOM.SecondaryColor;

Date Time Of Last Edit: 2020-08-24 21:34:45
[2020-08-24 21:52:43]
Ackin - Posts: 1865
StochSG[sc.Index] = stochMOM [sc.Index];
[2020-08-24 21:58:58]
Ackin - Posts: 1865
Look at scsf_StudySubgraphReference in the studies2.cpp, From that you will understand everything.

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

Login

Login Page - Create Account