Jump to content
Software FX Community

Plotting more than one prices series in the Financial Extension


User (Legacy)

Recommended Posts

Hi,

I am testing the Windows Forms .NET Financial Extensions Beta.

Is there a way of plotting two prices series in the chart. I would like to

compare two share prices charts on the same or different axes (depending on

the prices range).

I've tried various methods but I always get only the first series plotted.

Regards

Bojan

i=0

Chart1.OpenData(COD.Values, 2, COD.Unknown)

Chart1.OpenData(COD.XValues, 2, COD.Unknown)

Do While dDate <= dtpTo.Value

AddPoint = False

If ps1.Contains(dDate) Then

Chart1.Value(0, i) = ps1(dDate).Price

AddPoint = True

End If

If ps2.Contains(dDate) Then

Chart1.Value(1, i) = ps2(dDate).Price

AddPoint = True

End If

If AddPoint Then

Chart1.XValue(0, i) = dDate.ToOADate()

Chart1.XValue(1, i) = dDate.ToOADate()

i += 1

End If

dDate = dDate.AddDays(1)

Loop

Chart1.CloseData(COD.Values)

Chart1.CloseData(COD.XValues)

Link to comment
Share on other sites

Yes,

The way to do this like this:

One (stock) price would be added to the chart as you currently do.

The second (stock) price would be added using the StaticStudy Class.

What happens here is you would add that data into the chart as you normally

would and then you would create a StaticStudy that is assigned the index of

the data Array.

So,

If prices series one is the original and the second prices series is then

added it would be index 1

// Here we create the Static Study, the second parameter is true which

assigns it to the Prices pane

SoftwareFX.ChartFX.Financial.WinForms.StaticStudy secondStudy = new

SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second Study", true, 1);

// Here we add the Study to the Studies Collection.

finext.Gallery.Analytical.Studies.Add(index);

Hope this helps.

-charles

"Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

news:6LG82UPCFHA.2536@webserver3.softwarefx.com...

> Hi,

>

> I am testing the Windows Forms .NET Financial Extensions Beta.

>

> Is there a way of plotting two prices series in the chart. I would like to

> compare two share prices charts on the same or different axes (depending

> on the prices range).

>

> I've tried various methods but I always get only the first series plotted.

>

>

> Regards

>

> Bojan

>

>

> i=0

> Chart1.OpenData(COD.Values, 2, COD.Unknown)

>

> Chart1.OpenData(COD.XValues, 2, COD.Unknown)

>

> Do While dDate <= dtpTo.Value

>

> AddPoint = False

>

> If ps1.Contains(dDate) Then

>

> Chart1.Value(0, i) = ps1(dDate).Price

>

> AddPoint = True

>

> End If

>

> If ps2.Contains(dDate) Then

>

> Chart1.Value(1, i) = ps2(dDate).Price

>

> AddPoint = True

>

> End If

>

> If AddPoint Then

>

> Chart1.XValue(0, i) = dDate.ToOADate()

>

> Chart1.XValue(1, i) = dDate.ToOADate()

>

> i += 1

>

> End If

>

> dDate = dDate.AddDays(1)

>

> Loop

>

> Chart1.CloseData(COD.Values)

>

> Chart1.CloseData(COD.XValues)

>

>

Link to comment
Share on other sites

Thanks, that sort of works but I am unable to move the Static Study to the 

secundary axis. As I mentioned this is very important when the stocks have

very different prices or when charting index value and stock relative to

index value on the same chart.

Am I abusing the financial chart wanting it to do something it hasn't been

designd for? Should I use the core chart fx for the dual axes chart?

Regards

Bojan

"Software FX Support" <support@softwarefx.com> wrote in message

news:sgdx1IWCFHA.2536@webserver3.softwarefx.com...

> Yes,

> The way to do this like this:

> One (stock) price would be added to the chart as you currently do.

> The second (stock) price would be added using the StaticStudy Class.

> What happens here is you would add that data into the chart as you

> normally would and then you would create a StaticStudy that is assigned

> the index of the data Array.

> So,

> If prices series one is the original and the second prices series is then

> added it would be index 1

> // Here we create the Static Study, the second parameter is true which

> assigns it to the Prices pane

> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy secondStudy = new

> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second Study", true,

> 1);

> // Here we add the Study to the Studies Collection.

> finext.Gallery.Analytical.Studies.Add(index);

>

> Hope this helps.

> -charles

>

> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

> news:6LG82UPCFHA.2536@webserver3.softwarefx.com...

>> Hi,

>>

>> I am testing the Windows Forms .NET Financial Extensions Beta.

>>

>> Is there a way of plotting two prices series in the chart. I would like

>> to compare two share prices charts on the same or different axes

>> (depending on the prices range).

>>

>> I've tried various methods but I always get only the first series

>> plotted.

>>

>>

>> Regards

>>

>> Bojan

>>

>>

>> i=0

>> Chart1.OpenData(COD.Values, 2, COD.Unknown)

>>

>> Chart1.OpenData(COD.XValues, 2, COD.Unknown)

>>

>> Do While dDate <= dtpTo.Value

>>

>> AddPoint = False

>>

>> If ps1.Contains(dDate) Then

>>

>> Chart1.Value(0, i) = ps1(dDate).Price

>>

>> AddPoint = True

>>

>> End If

>>

>> If ps2.Contains(dDate) Then

>>

>> Chart1.Value(1, i) = ps2(dDate).Price

>>

>> AddPoint = True

>>

>> End If

>>

>> If AddPoint Then

>>

>> Chart1.XValue(0, i) = dDate.ToOADate()

>>

>> Chart1.XValue(1, i) = dDate.ToOADate()

>>

>> i += 1

>>

>> End If

>>

>> dDate = dDate.AddDays(1)

>>

>> Loop

>>

>> Chart1.CloseData(COD.Values)

>>

>> Chart1.CloseData(COD.XValues)

>>

>>

>

>

Link to comment
Share on other sites

Nope!

You are not the first person who has tried to use the Secondary Axis.

I even added a property called UseSecondaryAxis

to the StaticStudy Class

There was a bug there that was found and therefore I decided to add the

property.

But as a workaround:

SoftwareFX.ChartFX.Financial.WinForms.SeriesAttributes sa =

staticStudy.Series[0];

// NOW ADD THE Study

finext.Gallery.Analytical.Studies.Add(index);

// ONCE you have added the study you can do this

sa.YAxis = YAxis.Secondary;

chart1.AxisY2.Min = 40;

chart1.AxisY2.Max = 90;

Hope this helps.

-cjs

"Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

news:9Cjo4SXCFHA.2536@webserver3.softwarefx.com...

> Thanks, that sort of works but I am unable to move the Static Study to the

> secundary axis. As I mentioned this is very important when the stocks

> have very different prices or when charting index value and stock relative

> to index value on the same chart.

>

> Am I abusing the financial chart wanting it to do something it hasn't been

> designd for? Should I use the core chart fx for the dual axes chart?

>

> Regards

>

> Bojan

>

>

> "Software FX Support" <support@softwarefx.com> wrote in message

> news:sgdx1IWCFHA.2536@webserver3.softwarefx.com...

>> Yes,

>> The way to do this like this:

>> One (stock) price would be added to the chart as you currently do.

>> The second (stock) price would be added using the StaticStudy Class.

>> What happens here is you would add that data into the chart as you

>> normally would and then you would create a StaticStudy that is assigned

>> the index of the data Array.

>> So,

>> If prices series one is the original and the second prices series is then

>> added it would be index 1

>> // Here we create the Static Study, the second parameter is true which

>> assigns it to the Prices pane

>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy secondStudy = new

>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second Study", true,

>> 1);

>> // Here we add the Study to the Studies Collection.

>> finext.Gallery.Analytical.Studies.Add(index);

>>

>> Hope this helps.

>> -charles

>>

>> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

>> news:6LG82UPCFHA.2536@webserver3.softwarefx.com...

>>> Hi,

>>>

>>> I am testing the Windows Forms .NET Financial Extensions Beta.

>>>

>>> Is there a way of plotting two prices series in the chart. I would like

>>> to compare two share prices charts on the same or different axes

>>> (depending on the prices range).

>>>

>>> I've tried various methods but I always get only the first series

>>> plotted.

>>>

>>>

>>> Regards

>>>

>>> Bojan

>>>

>>>

>>> i=0

>>> Chart1.OpenData(COD.Values, 2, COD.Unknown)

>>>

>>> Chart1.OpenData(COD.XValues, 2, COD.Unknown)

>>>

>>> Do While dDate <= dtpTo.Value

>>>

>>> AddPoint = False

>>>

>>> If ps1.Contains(dDate) Then

>>>

>>> Chart1.Value(0, i) = ps1(dDate).Price

>>>

>>> AddPoint = True

>>>

>>> End If

>>>

>>> If ps2.Contains(dDate) Then

>>>

>>> Chart1.Value(1, i) = ps2(dDate).Price

>>>

>>> AddPoint = True

>>>

>>> End If

>>>

>>> If AddPoint Then

>>>

>>> Chart1.XValue(0, i) = dDate.ToOADate()

>>>

>>> Chart1.XValue(1, i) = dDate.ToOADate()

>>>

>>> i += 1

>>>

>>> End If

>>>

>>> dDate = dDate.AddDays(1)

>>>

>>> Loop

>>>

>>> Chart1.CloseData(COD.Values)

>>>

>>> Chart1.CloseData(COD.XValues)

>>>

>>>

>>

>>

>

>

Link to comment
Share on other sites

This doesn't work for me. The secondStudy is still ploted on the AxisY not 

on AxisY2. Also, just declaring SeriesAttributes variable sa in the code

bellow makes AxisY scal go crazy.

Regards

Bojan

....

....

Chart1.CloseData(COD.Values)

Chart1.CloseData(COD.XValues)

Dim secondStudy As SoftwareFX.ChartFX.Financial.WinForms.StaticStudy = _

New SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second

Study", True, 1)

Dim sa As SoftwareFX.ChartFX.Financial.WinForms.SeriesAttributes =

secondStudy.Series(0)

' As soon as I declare the variable sa above the Min and Max for AxisY go

crazy (in 10000000.00 increments)

' so I have to set them explicitly

Chart1.AxisY.Min = 500

Chart1.AxisY.Max = 18000

' Here we add the Study to the Studies Collection.

Financial1.Gallery.Analytical.Studies.Add(secondStudy)

'ONCE you have added the study you can do this

sa.YAxis = YAxis.Secondary

Chart1.AxisY2.Min = 500

Chart1.AxisY2.Max = 5000

"Software FX Support" <support@softwarefx.com> wrote in message

news:eAtVbyjCFHA.2544@webserver3.softwarefx.com...

> Nope!

> You are not the first person who has tried to use the Secondary Axis.

> I even added a property called UseSecondaryAxis

> to the StaticStudy Class

> There was a bug there that was found and therefore I decided to add the

> property.

> But as a workaround:

> SoftwareFX.ChartFX.Financial.WinForms.SeriesAttributes sa =

> staticStudy.Series[0];

> // NOW ADD THE Study

> finext.Gallery.Analytical.Studies.Add(index);

> // ONCE you have added the study you can do this

> sa.YAxis = YAxis.Secondary;

> chart1.AxisY2.Min = 40;

> chart1.AxisY2.Max = 90;

>

> Hope this helps.

> -cjs

>

> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

> news:9Cjo4SXCFHA.2536@webserver3.softwarefx.com...

>> Thanks, that sort of works but I am unable to move the Static Study to

>> the secundary axis. As I mentioned this is very important when the stocks

>> have very different prices or when charting index value and stock

>> relative to index value on the same chart.

>>

>> Am I abusing the financial chart wanting it to do something it hasn't

>> been designd for? Should I use the core chart fx for the dual axes

>> chart?

>>

>> Regards

>>

>> Bojan

>>

>>

>> "Software FX Support" <support@softwarefx.com> wrote in message

>> news:sgdx1IWCFHA.2536@webserver3.softwarefx.com...

>>> Yes,

>>> The way to do this like this:

>>> One (stock) price would be added to the chart as you currently do.

>>> The second (stock) price would be added using the StaticStudy Class.

>>> What happens here is you would add that data into the chart as you

>>> normally would and then you would create a StaticStudy that is assigned

>>> the index of the data Array.

>>> So,

>>> If prices series one is the original and the second prices series is

>>> then added it would be index 1

>>> // Here we create the Static Study, the second parameter is true which

>>> assigns it to the Prices pane

>>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy secondStudy = new

>>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second Study", true,

>>> 1);

>>> // Here we add the Study to the Studies Collection.

>>> finext.Gallery.Analytical.Studies.Add(index);

>>>

>>> Hope this helps.

>>> -charles

>>>

>>> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

>>> news:6LG82UPCFHA.2536@webserver3.softwarefx.com...

>>>> Hi,

>>>>

>>>> I am testing the Windows Forms .NET Financial Extensions Beta.

>>>>

>>>> Is there a way of plotting two prices series in the chart. I would like

>>>> to compare two share prices charts on the same or different axes

>>>> (depending on the prices range).

>>>>

>>>> I've tried various methods but I always get only the first series

>>>> plotted.

>>>>

>>>>

>>>> Regards

>>>>

>>>> Bojan

>>>>

>>>>

>>>> i=0

>>>> Chart1.OpenData(COD.Values, 2, COD.Unknown)

>>>>

>>>> Chart1.OpenData(COD.XValues, 2, COD.Unknown)

>>>>

>>>> Do While dDate <= dtpTo.Value

>>>>

>>>> AddPoint = False

>>>>

>>>> If ps1.Contains(dDate) Then

>>>>

>>>> Chart1.Value(0, i) = ps1(dDate).Price

>>>>

>>>> AddPoint = True

>>>>

>>>> End If

>>>>

>>>> If ps2.Contains(dDate) Then

>>>>

>>>> Chart1.Value(1, i) = ps2(dDate).Price

>>>>

>>>> AddPoint = True

>>>>

>>>> End If

>>>>

>>>> If AddPoint Then

>>>>

>>>> Chart1.XValue(0, i) = dDate.ToOADate()

>>>>

>>>> Chart1.XValue(1, i) = dDate.ToOADate()

>>>>

>>>> i += 1

>>>>

>>>> End If

>>>>

>>>> dDate = dDate.AddDays(1)

>>>>

>>>> Loop

>>>>

>>>> Chart1.CloseData(COD.Values)

>>>>

>>>> Chart1.CloseData(COD.XValues)

>>>>

>>>>

>>>

>>>

>>

>>

>

>

Link to comment
Share on other sites

Dear Bojan,

See Here

http://www.softwarefx.com/Extensions/Financial/default.aspx

If you download now you should get the new bits.

The issues we talked about should now be fixed. If not at least we have the

same bits and can go from there.

You will also get the newest API Docs and the Programmers Guide as part of

the Resource Center.

Thank you for choosing SoftwareFX.

-charles

"Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

news:vabPVvoCFHA.2536@webserver3.softwarefx.com...

> This doesn't work for me. The secondStudy is still ploted on the AxisY not

> on AxisY2. Also, just declaring SeriesAttributes variable sa in the code

> bellow makes AxisY scal go crazy.

>

> Regards

>

> Bojan

>

> ....

> ....

> Chart1.CloseData(COD.Values)

>

> Chart1.CloseData(COD.XValues)

>

> Dim secondStudy As SoftwareFX.ChartFX.Financial.WinForms.StaticStudy = _

>

> New SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second

> Study", True, 1)

>

> Dim sa As SoftwareFX.ChartFX.Financial.WinForms.SeriesAttributes =

> secondStudy.Series(0)

>

> ' As soon as I declare the variable sa above the Min and Max for AxisY go

> crazy (in 10000000.00 increments)

>

> ' so I have to set them explicitly

>

> Chart1.AxisY.Min = 500

>

> Chart1.AxisY.Max = 18000

>

> ' Here we add the Study to the Studies Collection.

>

> Financial1.Gallery.Analytical.Studies.Add(secondStudy)

>

> 'ONCE you have added the study you can do this

>

> sa.YAxis = YAxis.Secondary

>

> Chart1.AxisY2.Min = 500

>

> Chart1.AxisY2.Max = 5000

>

>

> "Software FX Support" <support@softwarefx.com> wrote in message

> news:eAtVbyjCFHA.2544@webserver3.softwarefx.com...

>> Nope!

>> You are not the first person who has tried to use the Secondary Axis.

>> I even added a property called UseSecondaryAxis

>> to the StaticStudy Class

>> There was a bug there that was found and therefore I decided to add the

>> property.

>> But as a workaround:

>> SoftwareFX.ChartFX.Financial.WinForms.SeriesAttributes sa =

>> staticStudy.Series[0];

>> // NOW ADD THE Study

>> finext.Gallery.Analytical.Studies.Add(index);

>> // ONCE you have added the study you can do this

>> sa.YAxis = YAxis.Secondary;

>> chart1.AxisY2.Min = 40;

>> chart1.AxisY2.Max = 90;

>>

>> Hope this helps.

>> -cjs

>>

>> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

>> news:9Cjo4SXCFHA.2536@webserver3.softwarefx.com...

>>> Thanks, that sort of works but I am unable to move the Static Study to

>>> the secundary axis. As I mentioned this is very important when the

>>> stocks have very different prices or when charting index value and stock

>>> relative to index value on the same chart.

>>>

>>> Am I abusing the financial chart wanting it to do something it hasn't

>>> been designd for? Should I use the core chart fx for the dual axes

>>> chart?

>>>

>>> Regards

>>>

>>> Bojan

>>>

>>>

>>> "Software FX Support" <support@softwarefx.com> wrote in message

>>> news:sgdx1IWCFHA.2536@webserver3.softwarefx.com...

>>>> Yes,

>>>> The way to do this like this:

>>>> One (stock) price would be added to the chart as you currently do.

>>>> The second (stock) price would be added using the StaticStudy Class.

>>>> What happens here is you would add that data into the chart as you

>>>> normally would and then you would create a StaticStudy that is assigned

>>>> the index of the data Array.

>>>> So,

>>>> If prices series one is the original and the second prices series is

>>>> then added it would be index 1

>>>> // Here we create the Static Study, the second parameter is true which

>>>> assigns it to the Prices pane

>>>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy secondStudy = new

>>>> SoftwareFX.ChartFX.Financial.WinForms.StaticStudy("Second Study", true,

>>>> 1);

>>>> // Here we add the Study to the Studies Collection.

>>>> finext.Gallery.Analytical.Studies.Add(index);

>>>>

>>>> Hope this helps.

>>>> -charles

>>>>

>>>> "Bojan Kuhar" <bkuhar@telkomsa.net> wrote in message

>>>> news:6LG82UPCFHA.2536@webserver3.softwarefx.com...

>>>>> Hi,

>>>>>

>>>>> I am testing the Windows Forms .NET Financial Extensions Beta.

>>>>>

>>>>> Is there a way of plotting two prices series in the chart. I would

>>>>> like to compare two share prices charts on the same or different axes

>>>>> (depending on the prices range).

>>>>>

>>>>> I've tried various methods but I always get only the first series

>>>>> plotted.

>>>>>

>>>>>

>>>>> Regards

>>>>>

>>>>> Bojan

>>>>>

>>>>>

>>>>> i=0

>>>>> Chart1.OpenData(COD.Values, 2, COD.Unknown)

>>>>>

>>>>> Chart1.OpenData(COD.XValues, 2, COD.Unknown)

>>>>>

>>>>> Do While dDate <= dtpTo.Value

>>>>>

>>>>> AddPoint = False

>>>>>

>>>>> If ps1.Contains(dDate) Then

>>>>>

>>>>> Chart1.Value(0, i) = ps1(dDate).Price

>>>>>

>>>>> AddPoint = True

>>>>>

>>>>> End If

>>>>>

>>>>> If ps2.Contains(dDate) Then

>>>>>

>>>>> Chart1.Value(1, i) = ps2(dDate).Price

>>>>>

>>>>> AddPoint = True

>>>>>

>>>>> End If

>>>>>

>>>>> If AddPoint Then

>>>>>

>>>>> Chart1.XValue(0, i) = dDate.ToOADate()

>>>>>

>>>>> Chart1.XValue(1, i) = dDate.ToOADate()

>>>>>

>>>>> i += 1

>>>>>

>>>>> End If

>>>>>

>>>>> dDate = dDate.AddDays(1)

>>>>>

>>>>> Loop

>>>>>

>>>>> Chart1.CloseData(COD.Values)

>>>>>

>>>>> Chart1.CloseData(COD.XValues)

>>>>>

>>>>>

>>>>

>>>>

>>>

>>>

>>

>>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...