Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
s_UseTool CustomToolName;
CustomToolName.Clear();
CustomToolName.AddAsUserDrawnDrawing = 1;
CustomToolName.ChartNumber = sc.ChartNumber;
CustomvName.DrawingType = DRAWING_HORIZONTALLINE;
CustomToolName.Color = //RGB Code or referfernce to a Subgraph's Color
CustomToolName.Width = //Integer or referfernce to a Subgraph's width
CustomToolName.BeginValue = sc.Close[sc.Indec];
sc.UseTool(CustomToolName);
I am sure there is a simple answer but I do not fully understand what you are trying to do. If you can ask your question differently, maybe I or someone else might be able to help.
Are you looking at some Acsil code or a line drawn by a study? Not sure.
You can loop through all the Horizontal Lines that are on the chart and assign their values to a variable.
s_UseTool HorLine;
int i = 0;
While(sc.GetChartDrawing(0, DRAWING_HORIZONTALLINE, HorLine, i)){
int HorLineColor = HorLine.Color;
i++;
}
This example assigns the RGB color of each Horizontal Line on the chart to the integer HorLineColor .
At the end of the loop HorLineColor will hold the color value of the Horizolntal Line that was ldrawn last.
Not sure about the specifics of converting RGB (###,###,###) to an integer.
The code I gave you above (#7) does exactly that. But I just notices that the sc.GetChartDrawing() function was replaced with sc.GetUserDrawnChartDrawing()
Of course you will have to embed those lines into a full SC study code. Do you know how to do that?
Do you need the colors of the lines for programming purposes or you just want to know the colors ?
Here is an example of a full code for a study that will write to the Message Log the color of every new Horizontal line that is manually added to the chart.