Jump to content
Software FX Community

Multiple Colors


User (Legacy)
 Share

Recommended Posts

Hi,

I am trying to change the color of the last candle in a Financial

Candlestick chart.

This is the snippet in the help file that deals with multiple colors:

Chart1.MultipleColors = TRUE

'Then open the comm. channel with COD_COLORS.

Chart1.OpenDataEx COD_COLORS,2,0

'Obtain the total number of points

nTotalPoints=Chart1.nValues

'Finally assign colors depending on their value using the Color Property

for j=0 to (nValues-1)

if (Chart1.Value(j) <0) Then

Chart1.Color(j) = RGB(0,0,255)

else

Chart1.Color(j) = RGB(255,0,0)

End If

Next j

Chart1.CloseData COD_COLORS

Two questions: 1 - How do I adjust this for multiple series (open, high,

low, close) and 2 - Is there a way to only set the color of the last point

of data and leave all the other colors unchanged?

Thanking you in advance,

Chase Gale

Link to comment
Share on other sites

If you want to assign color in a per-point basis, you need to allocate as

many colors as points are in the chart. For example:

Chart1.OpenDataEx COD_COLORS,chart.NSeries*Chart.NValues,0

Then you can assign a color individually for each point/series in the chart

using the Color property.See the Remarks section in the API documentation

for Color. It explains how to map each (series,point) pair to an index in

the color array.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...