How to access first bar on the chart

Questions about MultiCharts .NET and user contributed studies.
mirek
Posts: 24
Joined: 08 Jan 2013
Has thanked: 3 times
Been thanked: 3 times

How to access first bar on the chart

Postby mirek » 06 Dec 2013

Hi all,

I would like to write some text data to replace 1st bar on the chart. I would like to know how to use ChartPoint to write to the most left location of the chart.

Thank you
mirek

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: How to access first bar on the chart

Postby JoshM » 06 Dec 2013

How to access first bar on the chart
Bars.FullSymbolData gives access to the full data series, regardless of the MaxBarsBack setting. For example, Bars.FullSymbolData.Close[0] gives the closing price for the first price bar on the chart.

mirek
Posts: 24
Joined: 08 Jan 2013
Has thanked: 3 times
Been thanked: 3 times

Re: How to access first bar on the chart

Postby mirek » 06 Dec 2013

Hi JoshM,

the problem is to identify how many bars are displayed in the current chart. It could be changed when you adjust distance between bars and so on.

The magic is done by following code:-(

Code: Select all

ChartPoint(Environment.LeftScreenTime.AddMinutes(0))

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: How to access first bar on the chart

Postby JoshM » 06 Dec 2013

the problem is to identify how many bars are displayed in the current chart. It could be changed when you adjust distance between bars and so on.
Look up

Code: Select all

Bars.FullSymbolData.Count


Return to “MultiCharts .NET”